I recently found NRI and it’s really great. Unlike NVRHI, NRI has a cleaner design and modern Vulkan/DX12-ish low-level APIs. It also supports many modern features with official support, such as DLSS. As a PhD student specialising in VR & HPG, NRI seems to be the best RHI for my needs.

NRI

GitHub link: https://github.com/NVIDIA-RTX/NRI

NRI is a modular, extensible, low-level abstract rendering interface that was designed to support all low-level features of D3D12 and Vulkan GAPIs. At the same time, it aims to simplify usage and reduce the amount of code needed (especially compared with VK).

Goals:

  • Generalization and unification of D3D12 (spec) and VK (spec)
  • Explicitness (providing access to low-level features of modern GAPIs)
  • Quality-of-life and high-level extensions (e.g., streaming and upscaling)
  • Low overhead
  • Cross-platform and platform independence (AMD/INTEL friendly)
  • D3D11 support (spec) (as much as possible)

Non-goals:

  • Exposing entities not existing in GAPIs
  • High-level (D3D11-like) abstraction
  • Hidden management of any kind (except for some high-level extensions where it’s desired)
  • Automatic barriers (better handled in a higher-level abstraction)

Supported GAPIs:

  • Vulkan
  • D3D12
  • D3D11
  • Metal (through MoltenVK)
  • None / dummy (everything is supported but does nothing)
Required Vulkan extensions:
  • for Vulkan < 1.3:
    • VK_KHR_synchronization2
    • VK_KHR_dynamic_rendering
    • VK_KHR_copy_commands2
    • VK_KHR_maintenance4 (optional, but recommended)
    • VK_EXT_extended_dynamic_state
  • for Vulkan < 1.4:
    • _VK_KHR_push_descriptor
    • _VK_KHR_maintenance5 (optional, but recommended)
    • _VK_KHR_maintenance6 (optional, but recommended)
  • for APPLE:
    • VK_KHR_portability_enumeration (instance extension)
    • VK_KHR_get_physical_device_properties2 (instance extension)
    • VK_KHR_portability_subset
Supported Vulkan extensions:
  • Instance:
    • VK_KHR_get_surface_capabilities2
    • VK_KHR_surface
    • VK_KHR_win32_surface (VK_KHR_xlib_surface, VK_KHR_wayland_surface, VK_EXT_metal_surface)
    • VK_EXT_swapchain_colorspace
    • VK_EXT_debug_utils
  • Device:
    • VK_KHR_swapchain
    • VK_KHR_present_id
    • VK_KHR_present_wait
    • VK_KHR_swapchain_mutable_format
    • VK_KHR_maintenance7
    • VK_KHR_maintenance8
    • VK_KHR_maintenance9
    • VK_KHR_fragment_shading_rate
    • VK_KHR_pipeline_library
    • VK_KHR_ray_tracing_pipeline
    • VK_KHR_acceleration_structure (depends on VK_KHR_deferred_host_operations)
    • VK_KHR_ray_query
    • VK_KHR_ray_tracing_position_fetch
    • VK_KHR_ray_tracing_maintenance1
    • VK_KHR_line_rasterization
    • VK_KHR_fragment_shader_barycentric
    • VK_KHR_shader_clock
    • VK_KHR_compute_shader_derivatives
    • VK_EXT_mutable_descriptor_type
    • VK_EXT_subgroup_size_control
    • VK_EXT_swapchain_maintenance1
    • VK_EXT_present_mode_fifo_latest_ready
    • VK_EXT_opacity_micromap
    • VK_EXT_sample_locations
    • VK_EXT_conservative_rasterization
    • VK_EXT_mesh_shader
    • VK_EXT_shader_atomic_float
    • VK_EXT_shader_atomic_float2
    • VK_EXT_memory_budget
    • VK_EXT_memory_priority
    • VK_EXT_image_sliced_view_of_3d
    • VK_EXT_custom_border_color
    • VK_EXT_image_robustness
    • VK_EXT_robustness2
    • VK_EXT_pipeline_robustness
    • VK_EXT_fragment_shader_interlock
    • VK_NV_low_latency2
    • VK_NVX_binary_import
    • VK_NVX_image_view_handle

Requirement

  • OpenXR
  • Multi-view
  • Raytracing
  • Mesh Shaders
  • Wayland

Before I start coding, I need to make sure that it is possible to make it work with OpenXR SDK.

Fortunately, it supports both Vulkan and DX12 which means it should work with OpenXR.

Next, I need to check whether it supports multi-view, because that’s the baseline for many VR applications.

I notices that they do support Multi-View but VK_KHR_multiview is not listed in the README.md. Check out this issue: https://github.com/NVIDIA-RTX/NRI/issues/42

Finally, it should support real-time ray tracing and mesh shaders, and it does (^_^).

What about running it on an AMD GPU machine with Linux and Wayland? Currently, no. X11? Yes. However, I believe that support for Wayland will be added in the future.

Why not just Vulkan or DX12

Since I’m using NVIDIA’s techniques, it would be better to use their official, more powerful SDK. It can also save me time when it comes to integrating DLSS, FSR and similar features.

Still experimental

Although it’s great, it has some limitations. For example, we can’t add a Vulkan extension directly; we have to consider the equivalent in DX12 instead. Fortunately, it’s a community-driven project, which means that others can contribute extensions and features to strengthen it. Its ability is sufficient for my studies for now.