Using CUDA 12 with NV HPC SDK 22.11

Hi all,

Over the past few months I’ve been doing some benchmarking using Nvidia HPC SDK 22.11. On one of our servers, we have just installed a new L4 GPU, installed CUDA 12.1 and updated the nvidia driver to 530.30.02 (which comes with CUDA 12.1). I’d like to be able to tell nvc++ to use the new CUDA 12.1 installation instead of the 11.8 that came with the 22.11 SDK but so far I haven’t been able to do so. Here’s what I’ve tried:

  1. Placed “-gpu=cuda12.1” into nvc++ build string
  2. export CUDA_HOME=/usr/local/cuda-12.1
  3. Upon seeing a message that “CUDA_HOME” was deprecated: “export NVHPC_CUDA_HOME=/usr/local/cuda-12.1

This is the error I’m getting:

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

I’d prefer to not have to download a new HPC SDK that may or may not have CUDA 12x installed since that would require a lengthy approval process. In my search of these forums, it appears to me that setting CUDA_HOME and using the -gpu=cudax.y build argument would allow me to point to an external CUDA installation from the SDK, but so far this hasn’t worked for me. Any ideas?

Try removing “-gpu=cuda12.1” and just setting NVHPC_CUDA_HOME. The -gpu=cudaXX.Y flag only switches between the CUDA versions that are installed as part of the NVHPC SDK.

If you add the verbose flag (-v), you can see the paths being used by the compiler and confirm that it’s using your local CUDA install.

-Mat

Thanks Mat. It seems that lets me point to my CUDA 12.1 install and the -v flag does confirm that. The wrinkle here for me is that there seems to be a linking issue:

/home/username/nv_hpc_sdk/22.11/compilers/lib/libacccuda.so: undefined reference to `__cudaRegisterTexture’

Looks like an openACC library issue. Does that look expected?

Looks like this was removed from CUDA in 12.0 and we rebuilt our OpenACC/CUDA interface library to remove it in 23.1.

The acccuda library only gets added to the link if “-cuda” or “-Mcuda” is used, so if you aren’t mixing OpenACC with CUDA C or Fortran, then you should be able to remove this flag.

Otherwise, you’ll either need to update the compiler to 23.x in order to get CUDA 12.x support.

Alternately, you can try building with CUDA 11.8 but you may need to install the CUDA Forward compatibility package. CUDA Compatibility :: NVIDIA Data Center GPU Driver Documentation