-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update cuda version for doppio to use cuda 10.0 #141
base: gpu
Are you sure you want to change the base?
Conversation
Rather than hardwiring in different CUDA versions for different computer names, would it be better to have a variable |
Updated. How does this look like? |
Setting
means to set Maybe you want to first set And then always do
so that the value set as |
Is there not a canonical way to do this? I looked a bit and it looks like you can run |
One can do nvcc --version to get something like
But then you have to parse these strings to get what you want. In this case it's "10.0". Also the cuda compiler does not define an environment variable like CUDA_VERSION for us. What @rjleveque suggested looks like a simple approach with the caveat that user will need to set this in their bashrc file. What option do you guys think we should use, 1) parse the string return by "nvcc --version"; 2) use environment variable set by the user? |
I don't think we should try to parse the version string ourselves. Setting a variable with One way or another I think the user is responsible for setting this and we should make it easy for them to do so in their own |
Also it looks like there are some other things on the same ALL_FLAGS line as cuda10.1 that are machine-dependent, e.g. cc35 vs cc60? What is this and does it also need to be an environment variable? |
Sounds good. I will go ahead to use this approach. cc35 and cc60 are "compute capabilities". Those can be interpreted as version numbers that indicate what features are supported. Different generations of GPU has different compute capabilities. More details can be seen at: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#compute-capabilities |
…nd CUDA_CC. CUDA_VERSION should be set to the version "nvcc --version" returns. CUDA_CC should be set to the compute capability supported by the machine you compile this code on. The users are expected to set the two environment variables. They will be passed to the compiler as compilation flags: ALL_FFLAGS += -Mcuda=cuda$(CUDA_VERSION),$(CUDA_CC)
I updated the makefile to use CUDA_VERSION and CUDA_CC. CUDA_VERSION should be set to the version "nvcc --version" returns. The users are expected to set the two environment variables. They will |
I would be a bit cautious about adding this to something like |
Maybe we should have the application point to a new common Makefile for the GPU, e.g. CLAWMAKE = $(CLAW)/clawutil/src/Makefile.common.gpu so there could be a common one for gpu applications without messing with the standard one. Or maybe better to just have in the application Makefile as @mandli suggests, which might make it easier for the user to see exactly what's being set and modify it appropriately. |
You mentioned two options for this case:
For option 1, users don't have to set it multiple times for every example. Option 2 is easier for the user to see what's being set or what they need to set. I can't come up with other reasonings here to compare the two. But this is an important design decision to make. |
Any thoughts on which of the two option we should choose? |
I tend to use the |
Just updated it to use variables set in local Makefiles. Relevant changes are also made in: |
else | ||
CLAW_FC ?= pgfortran | ||
endif | ||
CLAW_FC ?= pgfortran |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually FC
is set to the fortran compiler command. Here you seem to be setting it to pgi
and then using that to set CLAW_FC
to the compiler command. Why not just set FC ?= pgfortran
in the application makefile, which would be more consistent with other usage?
I see from the old version that on some machines the pgi compiler name is ftn
but when running on such a machine the user should just set FC
to ftn
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was just following what's done in regular Makefile.common where we have FC and then CLAW_FC ?= FC. Then in order to stress that you need a special GPU-enable pgi compiler, I set it to pgi to distinguish it from regular pgfortran. "ftn" is just an alias to pgfortran on one of the machine I have used.
I can change this if that's better. I don't fully understand why do we have both FC and CLAW_FC though. Why not just FC?
No description provided.