Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# Changelog
# nvidia-sdk Changelog

## nvidia-nrd 0.1.1 (2026-09-10)
This changelog covers SDK acquisition and staging. Integration release notes:

- Fix repeated native compilation in downstream projects by watching SDK source
files individually instead of recursively watching the entire SDK directory.
- [nvidia-dlss](https://github.com/attackgoat/nvidia/blob/main/crates/nvidia-dlss/CHANGELOG.md)
- [nvidia-nrd](https://github.com/attackgoat/nvidia/blob/main/crates/nvidia-nrd/CHANGELOG.md)
- [nvidia-omm](https://github.com/attackgoat/nvidia/blob/main/crates/nvidia-omm/CHANGELOG.md)
- [nvidia-streamline](https://github.com/attackgoat/nvidia/blob/main/crates/nvidia-streamline/CHANGELOG.md)

## 0.1.0 (2026-09-05)

Published `nvidia-sdk` to crates.io.

Initial extraction of the NVIDIA integrations from private codebase.

- `nvidia-sdk`: pinned, SHA-256-verified SDK acquisition, cache/offline support,
- Pinned, SHA-256-verified SDK acquisition, cache/offline support,
explicit SDK overrides, source dependency assembly, and runtime staging.
- `nvidia-dlss`: Vulkan NGX DLSS Ray Reconstruction on x86-64 GNU Linux.
- `nvidia-streamline`: Vulkan interposer and DLSS Ray Reconstruction on
x86-64 MSVC Windows.
- `nvidia-nrd`: NRD RELAX SH on x86-64 Linux/Windows and Apple silicon macOS.
- `nvidia-omm`: native CPU baking on x86-64 Linux/Windows and Intel/Apple
silicon macOS.
- SHARC 1.8.3 shader-header acquisition on all targets through `nvidia-sdk`.
- Default-enabled optional `vk-graph` adapters and graph-independent Vulkan APIs.
- SDK-free documentation builds; no NVIDIA SDK payloads vendored in these crates.
- SHARC 1.8.3 shader-header acquisition on all targets.
- SDK-free documentation builds; no NVIDIA SDK payloads vendored in the crate.

The declared minimum Rust version is 1.95, including default-feature dependencies.
Native SDK components retain their upstream licenses separately from these
MIT OR Apache-2.0 bindings.
Native SDK components retain their upstream licenses separately from this
MIT OR Apache-2.0 crate.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ serde_json = "1"
sha2 = "0.10"
toml = "0.9"
ureq = { version = "2.12", default-features = false, features = ["tls"] }
vk-graph = "0.14.7"
vk-graph = { version = "0.15", git = "https://github.com/attackgoat/vk-graph", branch = "performance" }
zip = { version = "4.6.1", default-features = false, features = ["deflate"] }

[workspace.lints.rust]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Rust integrations for selected NVIDIA graphics SDKs.
| OMM CPU baker | [![nvidia-omm](https://img.shields.io/crates/v/nvidia-omm.svg)](https://crates.io/crates/nvidia-omm) | [![docs.rs](https://docs.rs/nvidia-omm/badge.svg)](https://docs.rs/nvidia-omm) |
| Streamline | [![nvidia-streamline](https://img.shields.io/crates/v/nvidia-streamline.svg)](https://crates.io/crates/nvidia-streamline) | [![docs.rs](https://docs.rs/nvidia-streamline/badge.svg)](https://docs.rs/nvidia-streamline) |

See the [changelog](https://github.com/attackgoat/nvidia/blob/main/CHANGELOG.md)
See the [SDK changelog and integration changelog links](https://github.com/attackgoat/nvidia/blob/main/CHANGELOG.md)
and [release checklist](https://github.com/attackgoat/nvidia/blob/main/RELEASE.md).

> [!NOTE]
Expand Down
20 changes: 20 additions & 0 deletions crates/nvidia-dlss/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# nvidia-dlss Changelog

## 0.2.0 (Unreleased)

- **Breaking:** Update the optional `vk-graph` adapter from 0.14.7 to 0.15.

Publication is pending the crates.io release of `vk-graph` 0.15 and completion
of the release gates.

## 0.1.0 (2026-09-05)

Published `nvidia-dlss` to crates.io. Initial extraction from private codebase.

- Vulkan NGX DLSS Ray Reconstruction on x86-64 GNU Linux.
- Default-enabled optional `vk-graph` 0.14.7 adapter and graph-independent Vulkan APIs.
- SDK-free documentation builds; no NVIDIA SDK payloads vendored in the crate.

The declared minimum Rust version is 1.95, including default-feature dependencies.
Native SDK components retain their upstream licenses separately from these
MIT OR Apache-2.0 bindings.
2 changes: 1 addition & 1 deletion crates/nvidia-dlss/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nvidia-dlss"
version.workspace = true
version = "0.2.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down
16 changes: 15 additions & 1 deletion crates/nvidia-dlss/native/ngx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ constexpr uint32_t kSpecularHitDistance = 1;
constexpr uint32_t kDlssRrQualityBalanced = 0;
constexpr uint32_t kDlssRrQualityQuality = 1;
constexpr uint32_t kDlssRrQualityDlaa = 2;
constexpr uint32_t kDlssRrQualityPerformance = 3;
constexpr uint32_t kDlssRrQualityUltraPerformance = 4;

struct NgxIdentity
{
Expand Down Expand Up @@ -273,7 +275,7 @@ bool validReflectionGuide(const NgxDlssRrResources& resources)

bool validDlssRrQuality(uint32_t quality)
{
return quality <= kDlssRrQualityDlaa;
return quality <= kDlssRrQualityUltraPerformance;
}

NVSDK_NGX_PerfQuality_Value dlssRrQuality(uint32_t quality)
Expand All @@ -284,6 +286,10 @@ NVSDK_NGX_PerfQuality_Value dlssRrQuality(uint32_t quality)
return NVSDK_NGX_PerfQuality_Value_MaxQuality;
case kDlssRrQualityDlaa:
return NVSDK_NGX_PerfQuality_Value_DLAA;
case kDlssRrQualityPerformance:
return NVSDK_NGX_PerfQuality_Value_MaxPerf;
case kDlssRrQualityUltraPerformance:
return NVSDK_NGX_PerfQuality_Value_UltraPerformance;
default:
return NVSDK_NGX_PerfQuality_Value_Balanced;
}
Expand Down Expand Up @@ -351,6 +357,14 @@ NVSDK_NGX_Result ensureFeature(
NVSDK_NGX_RayReconstruction_Hint_Render_Preset_E);

NVSDK_NGX_DLSSD_Create_Params create{};
NVSDK_NGX_Parameter_SetUI(
context->parameters,
NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_Performance,
NVSDK_NGX_RayReconstruction_Hint_Render_Preset_E);
NVSDK_NGX_Parameter_SetUI(
context->parameters,
NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_UltraPerformance,
NVSDK_NGX_RayReconstruction_Hint_Render_Preset_E);
create.InDenoiseMode = NVSDK_NGX_DLSS_Denoise_Mode_DLUnified;
create.InRoughnessMode = NVSDK_NGX_DLSS_Roughness_Mode_Packed;
create.InUseHWDepth = context->config.depth == 2
Expand Down
11 changes: 9 additions & 2 deletions crates/nvidia-dlss/native/ngx_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static float expectedScale[2];
static int expectedFlags;
static unsigned expectedDepth;
static unsigned expectedGuide;
static int expectedQuality;
static unsigned evaluations;
static unsigned creations;

Expand All @@ -57,6 +58,7 @@ static NVSDK_NGX_Result captureCreation(
assert(parameter<unsigned>(params, NVSDK_NGX_Parameter_Height) == 32);
assert(parameter<unsigned>(params, NVSDK_NGX_Parameter_OutWidth) == 128);
assert(parameter<unsigned>(params, NVSDK_NGX_Parameter_OutHeight) == 64);
assert(parameter<int>(params, NVSDK_NGX_Parameter_PerfQualityValue) == expectedQuality);
*handle = reinterpret_cast<NVSDK_NGX_Handle*>(2);
++creations;
return NVSDK_NGX_Result_Success;
Expand Down Expand Up @@ -121,7 +123,12 @@ int main()
for (unsigned color : {0, 1})
for (unsigned motion : {0, 1})
for (unsigned depth : {0, 1, 2})
for (const auto mode : {
std::pair{kDlssRrQualityBalanced, NVSDK_NGX_PerfQuality_Value_Balanced},
std::pair{kDlssRrQualityPerformance, NVSDK_NGX_PerfQuality_Value_MaxPerf},
std::pair{kDlssRrQualityUltraPerformance, NVSDK_NGX_PerfQuality_Value_UltraPerformance}})
{
expectedQuality = mode.second;
Parameters params;
NgxContext context(L"", L"", nullptr);
context.parameters = &params;
Expand All @@ -145,7 +152,7 @@ int main()
NgxFrameConstants frame{};
auto evaluate = [&]() {
return nvidia_dlss_ngx_evaluate(&context, reinterpret_cast<VkCommandBuffer>(3),
kDlssRrQualityBalanced, &frame, &resources);
mode.first, &frame, &resources);
};
for (const auto scale : {std::pair{1.0f, 1.0f}, std::pair{64.0f, -32.0f},
std::pair{0.5f, 0.0f}, std::pair{0.0f, -0.5f}, std::pair{0.0f, -0.0f}})
Expand Down Expand Up @@ -188,7 +195,7 @@ int main()
}
assert(evaluations == before && creations == created);
}
assert(creations == 12 && evaluations == 120);
assert(creations == 36 && evaluations == 360);
assert(!validConfig({2, 0, 0}));
assert(!validConfig({0, 2, 0}));
assert(!validConfig({0, 0, 3}));
Expand Down
4 changes: 4 additions & 0 deletions crates/nvidia-dlss/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ pub enum DlssRrQuality {
Quality = 1,
/// Native-resolution anti-aliasing; render and output dimensions must be equal.
Dlaa = 2,
Performance = 3,
UltraPerformance = 4,
}

/// Images for NGX evaluation. All inputs, including depth and the reflection guide,
Expand Down Expand Up @@ -567,6 +569,8 @@ mod tests {
assert_eq!(DlssRrQuality::Balanced as u32, 0);
assert_eq!(DlssRrQuality::Quality as u32, 1);
assert_eq!(DlssRrQuality::Dlaa as u32, 2);
assert_eq!(DlssRrQuality::Performance as u32, 3);
assert_eq!(DlssRrQuality::UltraPerformance as u32, 4);

assert_eq!(size_of::<VulkanImage>(), 64);
assert_eq!(align_of::<VulkanImage>(), 8);
Expand Down
25 changes: 25 additions & 0 deletions crates/nvidia-nrd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# nvidia-nrd Changelog

## 0.2.0 (Unreleased)

- **Breaking:** Update the optional `vk-graph` adapter from 0.14.7 to 0.15.

Publication is pending the crates.io release of `vk-graph` 0.15 and completion
of the release gates.

## 0.1.1 (2026-09-10)

- Fix repeated native compilation in downstream projects by watching SDK source
files individually instead of recursively watching the entire SDK directory.

## 0.1.0 (2026-09-05)

Published `nvidia-nrd` to crates.io. Initial extraction from private codebase.

- NRD RELAX SH on x86-64 Linux/Windows and Apple silicon macOS.
- Default-enabled optional `vk-graph` 0.14.7 adapter and graph-independent Vulkan APIs.
- SDK-free documentation builds; no NVIDIA SDK payloads vendored in the crate.

The declared minimum Rust version is 1.95, including default-feature dependencies.
Native SDK components retain their upstream licenses separately from these
MIT OR Apache-2.0 bindings.
2 changes: 1 addition & 1 deletion crates/nvidia-nrd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nvidia-nrd"
version = "0.1.1"
version = "0.2.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down
22 changes: 16 additions & 6 deletions crates/nvidia-nrd/native/nrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ struct NrdFrame {
float denoising_range;
uint32_t width;
uint32_t height;
uint32_t resource_width;
uint32_t resource_height;
uint32_t previous_width;
uint32_t previous_height;
uint32_t frame_index;
uint32_t reset;
struct {
Expand All @@ -75,7 +79,7 @@ struct NrdFrame {

static_assert(sizeof(NrdImage) == 16);
static_assert(sizeof(NrdResources) == 176);
static_assert(sizeof(NrdFrame) == 344);
static_assert(sizeof(NrdFrame) == 360);

struct Context {
nrd::Integration integration;
Expand Down Expand Up @@ -189,7 +193,13 @@ extern "C" int32_t nvidia_nrd_evaluate(

try {
Context& context = *static_cast<Context*>(opaque);
int32_t result = recreate(context, frame->width, frame->height);
if (frame->width == 0 || frame->height == 0
|| frame->previous_width == 0 || frame->previous_height == 0
|| frame->width > frame->resource_width || frame->height > frame->resource_height
|| frame->previous_width > frame->resource_width || frame->previous_height > frame->resource_height)
return -2;

int32_t result = recreate(context, frame->resource_width, frame->resource_height);
if (result != 0)
return result;

Expand All @@ -205,10 +215,10 @@ extern "C" int32_t nvidia_nrd_evaluate(
common.resourceSize[1] = context.height;
common.resourceSizePrev[0] = context.width;
common.resourceSizePrev[1] = context.height;
common.rectSize[0] = context.width;
common.rectSize[1] = context.height;
common.rectSizePrev[0] = context.width;
common.rectSizePrev[1] = context.height;
common.rectSize[0] = static_cast<uint16_t>(frame->width);
common.rectSize[1] = static_cast<uint16_t>(frame->height);
common.rectSizePrev[0] = static_cast<uint16_t>(frame->previous_width);
common.rectSizePrev[1] = static_cast<uint16_t>(frame->previous_height);
common.denoisingRange = frame->denoising_range;
common.frameIndex = frame->frame_index;
common.accumulationMode = frame->reset ? nrd::AccumulationMode::RESTART : nrd::AccumulationMode::CONTINUE;
Expand Down
46 changes: 45 additions & 1 deletion crates/nvidia-nrd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ pub const SDK_VERSION: &str = "4.17.3";
#[cfg(any(nvidia_nrd_native, test))]
const VULKAN_1_4: u32 = vk::make_api_version(0, 1, 4, 0);

#[cfg(any(nvidia_nrd_native, test))]
fn validate_rectangles(
resource: [u32; 2],
current: [u32; 2],
previous: [u32; 2],
) -> anyhow::Result<()> {
anyhow::ensure!(
(0..2).all(|axis| resource[axis] > 0
&& resource[axis] <= u32::from(u16::MAX)
&& current[axis] > 0
&& current[axis] <= resource[axis]
&& previous[axis] > 0
&& previous[axis] <= resource[axis]),
"nrd active rectangles must fit nonzero u16 resource dimensions"
);
Ok(())
}

#[derive(Clone, Copy, Debug)]
#[repr(C)]
pub struct Frame {
Expand All @@ -50,6 +68,12 @@ pub struct Frame {
pub denoising_range: f32,
pub width: u32,
pub height: u32,
/// Fixed allocation dimensions shared by every input and output image.
pub resource_width: u32,
pub resource_height: u32,
/// Previous frame's active rectangle, for dynamic-resolution reprojection.
pub previous_width: u32,
pub previous_height: u32,
pub frame_index: u32,
pub reset: u32,
pub settings: RelaxSettings,
Expand Down Expand Up @@ -184,6 +208,26 @@ impl Resources {
mod tests {
use super::*;

#[test]
fn dynamic_rectangles_must_fit_the_fixed_allocation() {
for (current, previous) in [
([960, 540], [427, 240]),
([427, 240], [960, 540]),
([693, 390], [691, 389]),
] {
assert!(validate_rectangles([960, 540], current, previous).is_ok());
}
for (resource, current, previous) in [
([960, 540], [0, 240], [960, 540]),
([960, 540], [961, 540], [960, 540]),
([960, 540], [427, 240], [960, 541]),
([0, 540], [1, 240], [1, 240]),
([65536, 540], [427, 240], [427, 240]),
] {
assert!(validate_rectangles(resource, current, previous).is_err());
}
}

#[test]
fn rejects_unsupported_api_versions_without_ffi() {
for version in [
Expand Down Expand Up @@ -277,7 +321,7 @@ mod tests {
assert_eq!(size_of::<Image>(), 16);
assert_eq!(size_of::<Resources>(), 176);
assert_eq!(size_of::<RelaxSettings>(), 40);
assert_eq!(size_of::<Frame>(), 344);
assert_eq!(size_of::<Frame>(), 360);
}

#[test]
Expand Down
13 changes: 9 additions & 4 deletions crates/nvidia-nrd/src/native.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#[cfg(feature = "vk-graph")]
use vk_graph::driver::device::Device;

use {
crate::{Frame, Resources},
crate::{Frame, Resources, validate_rectangles},
anyhow::Context as _,
ash::vk::{self, Handle as _},
std::{ffi::c_void, ptr::NonNull, sync::Mutex},
};

#[cfg(feature = "vk-graph")]
use vk_graph::driver::device::Device;

static API_LOCK: Mutex<()> = Mutex::new(());

unsafe extern "C" {
Expand Down Expand Up @@ -165,6 +165,11 @@ impl Nrd {
resources: &Resources,
) -> anyhow::Result<()> {
resources.validate_layouts()?;
validate_rectangles(
[frame.resource_width, frame.resource_height],
[frame.width, frame.height],
[frame.previous_width, frame.previous_height],
)?;

let context = self.context.context("nrd has been shut down")?;
let _guard = API_LOCK
Expand Down
12 changes: 12 additions & 0 deletions crates/nvidia-omm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# nvidia-omm Changelog

## 0.1.0 (2026-09-05)

Published `nvidia-omm` to crates.io. Initial extraction from private codebase.

- Native CPU baking on x86-64 Linux/Windows and Intel/Apple silicon macOS.
- SDK-free documentation builds; no NVIDIA SDK payloads vendored in the crate.

The declared minimum Rust version is 1.95, including default-feature dependencies.
Native SDK components retain their upstream licenses separately from these
MIT OR Apache-2.0 bindings.
1 change: 1 addition & 0 deletions crates/nvidia-sdk/CHANGELOG.md
Loading