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â