Basic cross-compilation misses CUDA drivers

I’m trying to cross-compile Fortran code on a system without any GPU and CUDA installation to run on another system with GPUs. As far as I understand, this should be easily done e.g. by

nvfortran -mp=gpu -gpu=cc80 test.f90

or -acc=gpu for OpenACC, and so on. I am using the nvhpc module of the Nvidia HPC SDK, version 24.9. I have also set CUDA_HOME to point to the cuda directory therein. However, the compilation fails with

nvfortran-Error-A CUDA toolkit matching the current driver version (0) or a supported older version (11.8) was not installed with this HPC SDK.

It makes sense that no CUDA driver is found, since none is installed. But this shouldn’t matter for cross-compilation, shouldn’t it?

What am I missing out on here? As far as I understand, there is no additional flag required for cross compilation.

Regards,
Christian

You’re missing the target CUDA version, i.e. “-gpu=cudaXX.YY”.

Like the target device, the compiler auto-detects the CUDA driver version on the system to know which version to target. If you don’t have a driver installed, then you need to specify it.

Note that we ignore CUDA_HOME. If you want to use a different CUDA install than the ones that ship with the NVHPC SDK, use NVHPC_CUDA_HOME. Though this shouldn’t be necessary since all the CUDA components are included in the SDK.

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