Skip to content

feat(rtx): support OptiX 9.1, sharing identical MDL modules - #381

Merged
jeffamstutz merged 2 commits into
NVIDIA:next_releasefrom
tarcila:optix-9-1
Oct 27, 2026
Merged

jeffamstutz merged 2 commits into
NVIDIA:next_releasefrom
tarcila:optix-9-1

Conversation

@tarcila

@tarcila tarcila commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Two materials that VisRTX registers under distinct UUIDs can compile to byte-identical PTX whose callable symbols embed the MDL-side compiled-material hash rather than our UUID (e.g.
mdlBsdf_sample_0x99986513d54491bd). From there, building them into separate OptiX modules puts the same symbol in the pipeline twice. This is tolerated by OptiX ≤ 9.0, rejected by 9.1 as defined multiple times.

Always deduplicate.

Offer 9.1 in the OPTIX_FETCH_VERSION cache STRINGS too, so cmake-gui and
ccache-style pickers list it rather than only accepting it when typed.

Make the Neural Graphics Primitives gate version-ordered. It compared
STREQUAL "9.0", so VISRTX_ENABLE_NEURAL hard-failed configure on 9.1
despite its own message saying "OptiX 9.0+"; VERSION_LESS keeps 7.7/8.0/8.1
rejected while accepting 9.0 and every later release.
@tarcila
tarcila marked this pull request as draft October 26, 2026 22:11
@tarcila
tarcila marked this pull request as ready for review October 26, 2026 22:24
@tarcila
tarcila requested a review from jeffamstutz October 26, 2026 22:24
@tarcila tarcila changed the title feat(rtx): support OptiX 9.1, sharing identical MDL modules where its linker requires it feat(rtx): support OptiX 9.1, sharing identical MDL modules Oct 26, 2026

@jeffamstutz jeffamstutz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there was an accidental inclusion of OptiX headers that caused us to have to validate them, I'd rather make it so that's not possible instead of making that a supported path.

Comment thread devices/rtx/cmake/FindOptiX.cmake Outdated
# Read it from the headers actually being compiled against rather than from
# OPTIX_FETCH_VERSION, which says nothing about an out-of-tree OptiX supplied
# via CMAKE_PREFIX_PATH.
if (OptiX_ROOT_DIR AND NOT DEFINED OptiX_VERSION_NUMERIC)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a case where out-of-tree OptiX was actually needed? The right fix is to add OptiX 9.1 to the options. I'd rather not add this complexity (and also have to make sure it works) unless we have a concrete user.

To be clear, I think we should avoid external OptiX headers being injected and always assume using the ones supplied through optix-dev.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually a workflow I use locally and that's how I came to encounter this OptiX 9.1 issue.
But this specific change is actually not used by this branch anymore, so I'll drop it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Avoid duplicate-symbol pipeline link failures with OptiX 9.1 while
preserving material metadata and callable offsets.

Gate the sharing on OPTIX_VERSION >= 90100. OptiX 9.0 links byte-identical
PTX from separate modules without complaint -- verified by running the new
test against both 9.0 and 9.1 headers with the sharing pass disabled: only
9.1 reports "Symbol 'mdl..._0x<uuid>' was defined multiple times". Below
9.1 each material keeps its own module, so per-material compile isolation
is unchanged where the linker does not require sharing. The representatives
table is built inside the if constexpr and left empty otherwise, so the
disabled path allocates nothing.

Have FindOptiX parse OPTIX_VERSION from optix.h, exposing OptiX_VERSION
(now reported by find_package) and OptiX_VERSION_NUMERIC, so the test
asserts sharing only on the versions where the device performs it. Read
from the headers rather than OPTIX_FETCH_VERSION, which says nothing about
an out-of-tree OptiX supplied via CMAKE_PREFIX_PATH.

Cover byte-identical PTX from distinct UUIDs, independent tints, both
release orders, slot reuse, pipeline rebuilds, and shared-module teardown.
@jeffamstutz
jeffamstutz merged commit 23392ab into NVIDIA:next_release Oct 27, 2026
8 checks passed
@tarcila
tarcila deleted the optix-9-1 branch October 27, 2026 00:48
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