See the CUDA project pageopen in new window. To use CUDA, you’ll use the module tool.

You can see what versions are available by using:

[me@login01 ~]$ module avail cuda

------------------------------ /opt/modulefiles -------------------------------
   cuda/12.2

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".

To load a specific version, you would use:

[me@login01 ~]$ module load cuda/12.2

while the "cuda" wildcard will load the default version, cuda-12.2 in this case.

You should now be able to run CUDA commands:

[me@login01 ~]$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0