I am building a simple Optix based application and I came across the Compute Capability solution configuration. I am using Optix8 and cuda 12.6. My card is RTX 3050.
My Compute Capability is 8.6.
My question is how can I ensure that this application will run in other machines with higher or lower Compute Capabilities?
Should I set multiple Compute Capabilities at nvcc -gencode=arch=?
Thanks!
With OptiX, if you’re compiling to PTX or OptiX-IR, you can use the compute capability for whatever the minimum GPU version you need to support is, and newer GPUs will work. For example, use 50 if you need Maxwell support, or 60 for Pascal and beyond. This is detailed in the “Program Input” section of the “Pipeline” chapter in the OptiX Programming Guide: https://raytracing-docs.nvidia.com/optix8/guide/index.html#program_pipeline_creation#program-input
Specifically:
The streaming multiprocessor (SM) target of the input OptiX program must be less than or equal to the SM version of the GPU for which the module is compiled.
To generate code for the minimum supported GPU (Maxwell), use architecture targets for SM 5.0, for example, --gpu-architecture=compute_50. Because OptiX rewrites the code internally, those targets will work on any newer GPU as well.
CUDA Toolkits 10.2 and newer throw deprecation warnings for SM 5.0 targets. These can be suppressed with the compiler option -Wno-deprecated-gpu-targets.
If support for Maxwell GPUs is not required, you can use the next higher GPU architecture target SM 6.0 (Pascal) to suppress these warnings.
Define the output type with --optix-ir or --ptx. Do not compile to obj or cubin.
Here are some additional general CUDA resources about compute capability, in case you have further questions.