I am porting a CUDA application from the CUDA runtime to using the CUDA driver API.
In that, I am having issues in both understanding and make working the online compilation.
I get a CUDA_ERROR_UNSUPPORTED_PTX_VERSION
failure when calling cuModuleLoadDataEx(&module, ptx, 0, 0, 0)
, where ptx
is a NULL-terminated char *
containing the program generated PTX source.
The program is compiled via nvrtcCompileProgram
with the --gpu-architecture sm_90
passed, since I am on a cluster with NVIDIA H100 9.0 compute capable.
For the same reason, I find it very unlikely the provided toolkit to suffer versioning incompatibility issues (like explained here). I assume the line at which the module loading function is failing is the very first one .version 8.5
, but I don't know how to control that.
The first header sections are:
.version 8.5
.target sm_90
.address_size 64
Can it be that the 8.5 version is incompatible with real sm_90
architecture?
(answer due to @RobertCrovella's comments)
What CUDA_ERROR_UNSUPPORTED_PTX_VERSION
implies is not that your GPU doesn't support the PTX version. GPUs don't actually get PTX at all; the PTX is compiled into SASS (Streaming Assembly) language, with the instruction set used by the GPU, and that's what the GPU does get.
However, each CUDA version - or rather, the NVIDIA driver and its associated library (libcuda.so
on Linux) - is only knowledgeable about versions of the PTX standard up to a certain number. In your case:
... so you got exactly what you were supposed to: The error of "I am not familiar with the PTX version you've shown me". Nothing was said about your GPU.
You should probably update the NVIDIA driver, or CUDA overall (including the driver).