What CUDA driver version do you have installed? (you can find this info by running ‘nvaccelinfo’).
I suspect what’s going on is that you’ve installed the HPC SDK that only includes the latest CUDA 11.2. We also have a ‘multi’ package that also includes the most current plus two previous CUDA releases.
By default, the compiler will use the CUDA libraries that match the CUDA driver version. So if you had for example a CUDA 11.0 driver, the compiler will include the library path of “/opt/nvidia/hpc_sdk/Linux_x86_64/21.3/math_libs/11.0/lib64”. But if 11.0 is not available, you’d get this error.
You can use the option “-Mcuda=cuda11.2” to have the compiler use the CUDA 11.2 toolset, but this may cause runtime issues if your CUDA driver can’t run CUDA 11.2 binaries.
If this is indeed the issue, then your best option is to update your CUDA driver or install the HPC SDK ‘multi’ package to get the older CUDA toolset.
Note that “LD_LIBRARY_PATH” sets the path for the dynamic loader to find shared libraries at runtime. It’s not used by the static linker. For this, you need to use the “-L”