# nvidia-rs
[](https://github.com/attackgoat/nvidia/actions/workflows/ci.yml)
[](https://www.rust-lang.org/tools/install)
[](#license)
[](https://github.com/attackgoat/nvidia)
Rust integrations for selected NVIDIA graphics SDKs.
| SDK acquisition and SHARC headers | [](https://crates.io/crates/nvidia-sdk) | [](https://docs.rs/nvidia-sdk) |
| DLSS / NGX | [](https://crates.io/crates/nvidia-dlss) | [](https://docs.rs/nvidia-dlss) |
| NRD | [](https://crates.io/crates/nvidia-nrd) | [](https://docs.rs/nvidia-nrd) |
| OMM CPU baker | [](https://crates.io/crates/nvidia-omm) | [](https://docs.rs/nvidia-omm) |
| Streamline | [](https://crates.io/crates/nvidia-streamline) | [](https://docs.rs/nvidia-streamline) |
See the [changelog](https://github.com/attackgoat/nvidia/blob/main/CHANGELOG.md)
and [release checklist](https://github.com/attackgoat/nvidia/blob/main/RELEASE.md).
> [!NOTE]
> This project is independently maintained. It is not affiliated with, sponsored
> by, or endorsed by NVIDIA Corporation.
>
> NVIDIA and the names of its products are trademarks of NVIDIA Corporation.
The repository contains no NVIDIA SDK payloads. Native builds use an explicitly
configured SDK or a local cache. They can download a pinned official release
when neither is available.
Downloaded SDKs retain their upstream licenses. This project's open-source
license does not cover them.
## Status
The crates share one SDK resolver and command-line interface. Each integration
has its own platform requirements.
| DLSS Ray Reconstruction through Vulkan NGX | x86-64 GNU Linux | Pinned NGX/DLSSD SDK |
| Streamline | x86-64 MSVC Windows | Pinned Streamline SDK |
| NRD RELAX SH | x86-64 Linux/Windows; Apple silicon macOS | Pinned source archives and dependencies |
| OMM CPU baker | x86-64 Linux/Windows; Intel/Apple silicon macOS | Shared libraries on Linux/Windows; pinned sources on macOS |
| SHARC 1.8.3 | Shader headers on all targets | Pinned upstream source archive |
Unsupported native targets use stub backends. See
[`SOURCE-SDKS.md`](https://github.com/attackgoat/nvidia/blob/main/crates/nvidia-sdk/SOURCE-SDKS.md)
for exact target rules, native toolchains, and source dependency requirements.
### SHARC Headers
SHARC is a shader-only SDK. It does not introduce a renderer abstraction or a
native backend.
The resolver returns the official SDK root. Headers are under `include/`, and
the license is `License.md`.
> [!TIP]
> Use `resolved.path.join("include")` as the shader include directory.
> Point `SHARC_SDK` at the SDK root, not at `include/`.
The [SHARC source notes](https://github.com/attackgoat/nvidia/blob/main/crates/nvidia-sdk/SOURCE-SDKS.md#sharc-183)
record the verified commit and archive pin. They also provide the exact layout
and prefetch commands. These inputs are acquired, not vendored here.
## Renderer Integrations
`nvidia-dlss`, `nvidia-nrd`, and `nvidia-streamline` enable `vk-graph` by default.
The feature is optional. Disable default features to use the underlying
`ash`/Vulkan APIs without a `vk-graph` dependency.
OMM and the SDK resolver are renderer-independent. Neither has a `vk-graph`
feature.
The default dependency graph requires **Rust 1.95 or newer**.
### Graph-Free Configuration
Use this crates.io configuration for graph-free Vulkan integration:
```toml
[dependencies]
nvidia-dlss = { version = "0.1.0", default-features = false, features = ["dlss-release-runtime"] }
nvidia-nrd = { version = "0.1.1", default-features = false, features = ["native"] }
nvidia-streamline = { version = "0.1.0", default-features = false }
```
Omit `default-features = false` to use the default `vk-graph` adapters.
For the CPU baker, use
`nvidia-omm = { version = "0.1.0", features = ["native"] }`.
For SDK acquisition alone, use `nvidia-sdk = "0.1.0"`.
### Raw Vulkan APIs
| DLSS | `VulkanInitInfo`, `Ngx::initialize_raw`, `Ngx::device_extensions_raw` |
| NRD | `Nrd::from_raw` |
| Streamline on Windows | `Streamline::create_proxy_ash_instance`, returning `ProxyInstanceOwner` |
The Streamline entry point creates an instance through its interposer. It does
not attach Streamline to arbitrary externally created devices.
> [!WARNING]
> Raw Vulkan APIs are unsafe. Callers must uphold the documented handle
> lifetimes and GPU-safe shutdown order.
>
> Graph adapters also require unsafe calls where ownership cannot prove device
> provenance, enabled extensions, queue configuration, or creation-pointer validity.
The default graph adapters retain their device and instance ownership behavior.
### Feature Selection
Renderer features do not control native SDK support or acquisition.
| NRD without default features | Enable `native` to retain the native backend. |
| DLSS without `dlss-release-runtime` | Uses the development runtime. |
| Unsupported native platform | Uses a stub regardless of renderer features. |
Contributions for additional renderer adapters are welcome. Keep adapters
optional and the core APIs independent of any particular renderer.
Additional graphics-API backends are also welcome as implemented and tested
changes. The current Vulkan bindings do not imply support for those APIs.
## SDK Resolution
Resolution uses the first available source:
1. The SDK-specific variable: `DLSS_SDK`, `NRD_SDK`, `OMM_SDK`, `SHARC_SDK`, or
`STREAMLINE_SDK`.
2. `NVIDIA_SDK_ROOT/<sdk>/<version>`.
3. The verified user cache.
4. A pinned official download.
| `NVIDIA_SDK_CACHE` | Overrides the cache directory. |
| `NVIDIA_SDK_OFFLINE=1` | Prohibits SDK downloads. |
| Cargo offline mode | Also prohibits SDK downloads. |
Explicitly configured SDK directories are never replaced or modified.
> [!IMPORTANT]
> Downloading or using an SDK may accept additional NVIDIA terms. Review the
> URL and license reported by the resolver before enabling native integrations.
## License
Project-authored Rust and native bridge code is dual-licensed. Choose either:
- [Apache License, Version 2.0](https://github.com/attackgoat/nvidia/blob/main/LICENSE-APACHE)
- [MIT License](https://github.com/attackgoat/nvidia/blob/main/LICENSE-MIT)
NVIDIA SDKs and other downloaded third-party components retain their own
licenses.