Browse by type
NVRHI (NVIDIA Rendering Hardware Interface) is a library that implements a common abstraction layer over multiple graphics APIs (GAPIs): Direct3D 11, Direct3D 12, and Vulkan 1.3. It works on Windows (x64 only) and Linux (x64 and ARM64).
Key features:
NVRHI is used in several NVIDIA SDKs:
Notable third-party projects using NVRHI:
Various early versions of NVRHI have been used in various projects created at NVIDIA, including:
NVRHI can be configured to be used a set of static libraries in CMake-based projects, or as a single dynamic library.
To include NVRHI into a CMake project as static libraries:
add_subdirectory(nvrhi) directive to the parent CMakeLists.txt.nvrhi for the interface headers, common utilities, and validation;nvrhi_d3d11 for DX11 (enabled when NVRHI_WITH_DX11 is ON);nvrhi_d3d12 for DX12 (enabled when NVRHI_WITH_DX12 is ON); andnvrhi_vk for Vulkan (enabled when NVRHI_WITH_VULKAN is ON).To build NVRHI as a shared library (DLL or .so):
NVRHI_BUILD_SHARED variable to ON.NVRHI depends on the Vulkan-Headers and DirectX-Headers libraries for platform headers (where applicable). These libraries can be provided externally by importing them into the CMake project before NVRHI, or they can be downloaded automatically at project configuration time using CMake FetchContent. This behavior is controlled with the following CMake variables:
NVRHI_FETCH_VULKAN_HEADERS enables downloading of the Vulkan-Headers library (otherwise it must be provided externally if Vulkan is enabled)NVRHI_VULKAN_HEADERS_GIT_REPOSITORY sets the git repository URL for Vulkan-HeadersNVRHI_VULKAN_HEADERS_GIT_TAG sets the git tag or commit hash for Vulkan-HeadersNVRHI_VULKAN_HEADERS_FETCH_DIR sets the path that Vulkan-Headers will be downloaded to - empty means the default location in build/_depsNVRHI_FETCH_DIRECTX_HEADERS enables downloading of the DirectX-Headers library (otherwise it must be provided externally if Vulkan is enabled)NVRHI_DIRECTX_HEADERS_GIT_REPOSITORY sets the git repository URL for DirectX-HeadersNVRHI_DIRECTX_HEADERS_GIT_TAG sets the git tag or commit hash for DirectX-HeadersNVRHI_DIRECTX_HEADERS_FETCH_DIR sets the path that DirectX-Headers will be downloaded to - empty means the default location in build/_depsThe default values of these configuration variables should be OK for most use cases.
See the programming guide and the tutorial.
NVRHI includes optional support for certain DX11 and DX12 extensions available through the NVAPI library. The library is not distributed with NVRHI but is available separately here.
To enable NVAPI support, extract the NVAPI SDK into the nvapi subfolder of your main project and set the NVRHI_WITH_NVAPI CMake variable to ON.
The following extensions are supported:
NVRHI includes an optional integration of the RTXMU library. The library is downloaded at project configuration time using CMake FetchContent when the NVRHI_WITH_RTXMU CMake variable is set to ON. Similar to the platform header libraries, the RTXMU dependency can be configured using the following CMake variables:
NVRHI_RTXMU_GIT_REPOSITORY sets the git repository URL for RTXMUNVRHI_RTXMU_GIT_TAG sets the git tag or commit hash for RTXMUNVRHI_RTXMU_FETCH_DIR sets the path that RTXMU will be downloaded to - empty means the default location in build/_depsWhen RTXMU integration is enabled, all bottom-level ray tracing acceleration structures (BLAS'es) are managed by that library. All built BLAS'es that have the AllowCompaction flag set are automatically compacted when ICommandList::compactBottomLevelAccelStructs method is called. No other configuration is necessary.
NVRHI is licensed under the MIT License.
$ claude mcp add NVRHI \
-- python -m otcore.mcp_server <graph>