cuda.bindings._v2.nvrtc.install_bundled_headers#
- cuda.bindings._v2.nvrtc.install_bundled_headers(install_path, unsigned int flags) bytes#
nvrtcInstallBundledHeaders extracts CUDA headers bundled with NVRTC to a specified directory for use during compilation.
NVRTC bundles a set of CUDA Toolkit headers and CUDA C++ Core Libraries (CCCL) within libnvrtc-builtins. This function extracts these headers to the specified directory, allowing NVRTC programs to compile without requiring a separate CUDA Toolkit installation. The bundled headers match those available in the CUDA Toolkit plus CCCL libraries. After extraction, users can compile kernels by passing appropriate include paths (such as “-I<install_path>” and “-I<install_path>/cccl”) to nvrtcCompileProgram. A version marker file (.nvrtc_headers_version) is created in the installation directory to track the installed version. This function is thread-safe and process-safe. Concurrent calls from multiple threads or processes will be serialized using file locking. By default, the function waits for the lock; use NVRTC_INSTALL_HEADERS_NO_WAIT to return immediately with NVRTC_ERROR_BUSY if another process holds the lock.
- Parameters:
install_path (str) – Path where headers should be extracted (UTF-8 encoded). The directory will be created if it doesn’t exist.
flags (unsigned int) – NVRTC_INSTALL_HEADERS_* flags:.
- Returns:
- Optional pointer to receive detailed error message on
failure. If non-NULL,
*error_logwill be set to point to a string describing the error cause. Note: subsequent API calls from the same thread may overwrite this message. May be NULL if error details are not needed.
- Return type:
Note
Use NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS to avoid reinstalling if headers already exist. Use NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE to guarantee consistency by clearing the directory first.
See also
nvrtcInstallBundledHeaders