I recently updated to the CUDA Toolkit version 12.8. The nvcc compiler is now emitting this warning:
Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
I have a basic understanding of CUDA compilation. That the nvcc compiler generates PTX for various architectures and compute capability, and that the PTX is JIT compiled by the NVidia driver at runtime.
I do not understand what "offline compilation" is.
My main concern is what the warning means with regard to supporting Compute 6.1 devices and later. I need to continue to support Compute 6.1. My Visual Studio CUDA Code Generation build setting is compute_61,sm_61
. If I remove this setting, my app does not run on Compute 6.1 devices. The error at runtime is something about not having a kernel. I would like to know the correct code generation option to support Compute 6.1 devices and not emit this warning without disabling the warning.
You’re getting that warning because CUDA 12.8 is letting you know:
“Hey, we’re gonna drop offline compilation (aka precompiled binaries) for old GPUs like Pascal (sm_61) in a future version.”
Offline compilation just means nvcc
is generating actual GPU-ready code (sm_61
) at build time, instead of leaving it as PTX (which gets compiled later when the app runs).
So you are totally fine for now, but NVidia is saying that in the future, this might (and that means it will) stop working. They’ll only support PTX for older GPUs, and expect the driver to do the heavy lifting at runtime. That's the reason of the warning:
Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release
When you specify:
-gencode arch=compute_61,code=sm_61
You are telling nvcc to compile directly to code that runs on a GPU with compute capability 6.1; This is offline compilation for sm_61.
You can suppress the warning with the flag:
-Wno-deprecated-gpu-targets
But that's only a temporal workaround until offline compilation for old GPUs is deprecated.