Nvc++ with cuda 12.0

Dear dev,

Is there a way (compile, download, install, setup or other) to have a nvc++ compiler (and its eco-system) compatible with cuda 12.0 (required by my graphical card and its driver)?
May a new nv HPC SDK will be released soon ?

Best.

Hi D.R.N.O.

Unfortunately CUDA 12 was released too late for us to get it included with 22.11, but it will be included in the upcoming 23.1 release available soon.

In the meantime, you can set the environment variable “NVHPC_CUDA_HOME” to point at your local CUDA 12.0 installation to have the compilers use it. The caveat being that since CUDA 12 is a major release, there could be issues depending on what you’re doing. I’m not sure if you will or will not have issues, but it’s easy so give it a try.

-Mat

Hello Mat,

Thanks for your answer, yes there is nothing to lose to try.
So I did.
The compilation returned me the following error:

nvvmCompileProgram error 7: NVVM_ERROR_INVALID_OPTION.
Error: libnvvm : error: -arch=compute_86 is an unsupported option
ptxas fatal   : Value 'sm_86' is not defined for option 'gpu-name'
NVC++-F-0155-Compiler failed to translate accelerator region

About “there could be issues depending on what you’re doing”: I am trying to compile a C++/OpenACC code (that is perfectly compiling and running on an older computer).

-D.R.N.0

Hmm. libnvvm is the back-end LLVM device code generator and comes with the CUDA SDK. Not sure why it’s not recognizing cc86.

I should have asked before, but which device are you using and which release of the compilers?

I assumed you have a Hopper (cc90) based card since you said you needed CUDA 12.0, but for some reason the compiler is detecting it as a new Ampere (cc86) so I’m not sure.

You can try explicitly setting the target architecture using the “-gpu=ccXY” flag, example “-gpu=cc90”. Or possibly fall back to “-gpu=cc80”.

If it still doesn’t work, it’s probably best to wait the few weeks till 23.1 is released with CUDA 12.0 support.

-Mat

I am using a RTX A2000 with compilers from nvhpc 22.1 (not newer because of the bug I reported and a bit of laziness).
So the target architecture -gpu=cc86 is fine: I used it on a different project.

Following your advice when I force the option “-gpu=cc86”, I have the following error message:

nvc++-Error-A CUDA toolkit matching the current driver version (12.0) or a supported older version (11.0 or 11.1) was not installed with this HPC SDK.

However, the fall back idea was a good idea, because I could compile and run my code. Thanks !

I am still looking forward the 23.1 release with CUDA 12.0 support to have something cleaner.

However, the fall back idea was a good idea, because I could compile and run my code. Thanks !

Excellent! From a compiler point of view, there’s not much difference between cc80 and cc86, so performance-wise using cc80 should be the same.

I am still looking forward the 23.1 release with CUDA 12.0 support to have something cleaner.

Sounds good. The caveat being that given 23.1 is in the final stages of QA testing, they may not be able to get the fix in for the __has_builtin with ctz issue. Granted it sounds like it’s an easy fix and low impact, so possibly, but more likely wouldn’t get in until later.

-Mat

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.