Skip to content

Build and run on AMD RDNA4 / RADV (Linux, -DUSE_DLSS=OFF) - #33

Open
ZJLi2013 wants to merge 3 commits into
nvpro-samples:mainfrom
ZJLi2013:rdna4_support
Open

Build and run on AMD RDNA4 / RADV (Linux, -DUSE_DLSS=OFF)#33
ZJLi2013 wants to merge 3 commits into
nvpro-samples:mainfrom
ZJLi2013:rdna4_support

Conversation

@ZJLi2013

@ZJLi2013 ZJLi2013 commented Jul 9, 2026

Copy link
Copy Markdown

Summary

I tried vk_gaussian_splatting on AMD hardware (Radeon AI PRO R9700, RDNA4/gfx1201, RADV / Mesa 25.2.8, no NVIDIA runtime) and hit three small, unrelated issues that blocked a clean build and headless run on Linux without DLSS. This PR fixes all three; with them the raster, hardware ray tracing, and hybrid pipelines all build and render on RADV (vkCreateRayTracingPipelinesKHR succeeds). The changes are platform-agnostic and do not alter behavior when USE_DLSS is enabled.

The work is split into three focused commits so they can be reviewed (or cherry-picked) independently.

Tested on: base dfb3c79 (nvpro_core2 eb7c2f2), LunarG Vulkan SDK 1.4.350.1, Ubuntu, headless, -DUSE_DLSS=OFF -DDISABLE_DEFAULT_SCENE=ON.

Changes

1. Build with -DUSE_DLSS=OFF (no NVIDIA NGX SDK)

Two things break the build without the NGX SDK even with DLSS disabled:

  • file(GLOB SOURCE_FILES src/*.*) unconditionally picks up src/dlss_*.cpp (which include NGX headers). These files are already added explicitly in the if(USE_DLSS) block, so the glob only ever double-adds them — excluding them from the glob is safe:

    file(GLOB SOURCE_FILES src/*.*)
    list(FILTER SOURCE_FILES EXCLUDE REGEX "/dlss_")
  • m_dlss is declared only under #if defined(USE_DLSS), but gaussian_splatting_ui.cpp reads m_dlss.isEnabled() at four sites outside the guards → compile error. Added a small isDlssEnabled() helper that returns false when compiled without DLSS, and used it at those sites:

    inline bool isDlssEnabled() const
    {
    #if defined(USE_DLSS)
      return m_dlss.isEnabled();
    #else
      return false;
    #endif
    }

2. Portable asset paths in .vkgs projects

Sample projects store asset paths with Windows backslashes (e.g. data\teleportour\Winter-Garden-view2.ply). On POSIX, std::filesystem treats \ as a normal filename character, so assets fail to resolve and the scene loads empty (blank render, no error). Normalizing separators to / in the single choke point makeAbsolutePath() fixes it and stays valid on Windows too:

std::string normalized = relativePath;
std::replace(normalized.begin(), normalized.end(), '\\', '/');
return std::filesystem::absolute(base / normalized);

3. Headless --saveImage before the first frame

Passing --saveImage <file> as a bare command-line argument (outside a benchmark SEQUENCE) crashes with SIGSEGV: the save runs at parse time, before any frame is rendered, and the G-buffers are created lazily on the first onResize(), so getAllDumpableBuffers() dereferences not-yet-created color images. Returning an empty list when the G-buffer is still 0x0 makes it fail gracefully (the SEQUENCE-based path is unchanged):

const VkExtent2D gBufSize = m_gBuffers.getSize();
if(gBufSize.width == 0 || gBufSize.height == 0)
  return buffers;  // not rendered yet

If you'd prefer this to defer the save until after the first frame rather than no-op, I'm happy to adjust — that felt like a larger behavior change than this minimal guard.

Testing

  • Builds cleanly (315/315 targets) with -DUSE_DLSS=OFF -DDISABLE_DEFAULT_SCENE=ON on RADV/Mesa 25.2.8 (RDNA4), LunarG SDK 1.4.350.1.
  • Headless benchmark SEQUENCE: raster / RT / hybrid pipelines all produce images.
  • The .vkgs sample project (15.3M-gaussian splat + OBJ meshes) loads and renders after the path fix.
  • No NVIDIA hardware on hand to regression-test the DLSS-on path, but none of these changes affect it: the helper returns the same value under USE_DLSS, the glob filter is a no-op (those sources are added explicitly), and the path / saveImage fixes are platform-agnostic.

ZJLi2013 and others added 3 commits July 9, 2026 14:05
The src/*.* glob unconditionally pulled in src/dlss_*.cpp, which require the
NGX headers, so USE_DLSS=OFF still failed to build on platforms without the
NVIDIA NGX SDK (e.g. AMD/RADV). Exclude the DLSS sources from the glob (they
are already added explicitly in the USE_DLSS CMake block).

Also, gaussian_splatting_ui.cpp read m_dlss.isEnabled() at 4 sites outside the
USE_DLSS guards, but m_dlss only exists under USE_DLSS -> compile error. Add a
small isDlssEnabled() helper that returns false when DLSS is compiled out and
use it at those sites.

Co-authored-by: Cursor <cursoragent@cursor.com>
Projects authored on Windows store asset paths with backslash separators
(e.g. "data\scene\cloud.ply"). On POSIX, std::filesystem treats '\' as a
regular filename character, so the asset fails to resolve and the scene loads
empty (blank render) with no error. Normalize separators to '/' in
makeAbsolutePath(); '/' is also accepted on Windows, keeping projects portable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Passing --saveImage as a bare command-line argument (outside a benchmark
SEQUENCE) runs the save at parse time, before any frame is rendered. The
G-buffers are created lazily on the first onResize(), so getAllDumpableBuffers()
dereferenced not-yet-created color images and crashed with a SIGSEGV. Return an
empty buffer list when the G-buffer size is still 0x0 so callers no-op instead
of crashing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@marviej

marviej commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

hello @ZJLi2013 ,
thank you very much for the work. could you signoff the three commits of the PR so i can process you PR.
See https://github.com/nvpro-samples/vk_gaussian_splatting/pull/33/checks?check_run_id=86054702117
thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants