NVIDIA Runtime Compilernvrtc
A library that compiles CUDA C++ to PTX at runtime, inside your process, without launching nvcc.
The NVIDIA Runtime Compiler (nvrtc) is a runtime compilation library for CUDA C. It compiles CUDA C++ to PTX in-process, so there's no need to launch the NVIDIA CUDA Compiler Driver (nvcc) as a separate process. Some libraries and frameworks use it to turn C/C++ code they generate into PTX that can run on a GPU.
A second compilation step#
PTX is an intermediate representation, not what the GPU executes. The NVIDIA GPU drivers JIT-compile it further into SASS assembly. That step is separate from the compilation NVRTC does.
CUDA binaries that contain PTX, as required for forward compatibility, pass through the same driver JIT step.
NVRTC is closed source. See the NVRTC documentation.
Related#
- nvcc: the ahead-of-time, out-of-process compiler
- PTX: what NVRTC outputs
- NVIDIA GPU Drivers: JIT-compile PTX to SASS