Skip to content

Optixir fixes - #25

Merged
iwald-nvidia merged 1 commit into
NVIDIA:mainfrom
lewisfish:main
Jul 15, 2026
Merged

iwald-nvidia merged 1 commit into
NVIDIA:mainfrom
lewisfish:main

Conversation

@lewisfish

Copy link
Copy Markdown

Hi,
I was trying to transition from PTX to optixir in my OWL application and ran into some issues getting optixir to work.

This patch fixes those issues by broadly copying what embed_ptx does, but applying it to embed_optixir.
Mainly changing the file extension of the generated file, and harmonising the add_library call and adding the set_target_properties calls.

I'm not too familiar with all this PTX/OPTIXIR stuff and not great with cmake, so I've probably gone wrong somewhere.
It does now work on my machine...

Lewis

@iwald-nvidia

Copy link
Copy Markdown
Collaborator

Hey, Lewis,
changes look small enough that I'll just merge them once the CI runs through. Pretty much all the users I know use PTX (as do I), so this just hasn't come up yet - thanks for not just reporting but also providing a fix right away.

Only two comments from eyeballing the diff:

  • the "extern C" on the "const uint ... size" shouldn't make a difference AFAIU; extern C should only affect the name mangling of functions, I don't think variable names get mangled. But not 100% sure, nor would it affect it negatively, so fine as is.
  • I've seen you changed the dummy library from 'OBJECT" to "STATIC" - are you sure that's what you want? Is there a specific reason to do so? Reason I'm asking is that this can really make a difference in the output, and while I can see reasons that somebody would want to have OBJECT instead of static I can not easily see a reason the other way around, so wondering if this was intentional or not. (I'm fine merging anyway, just wondering)

@iwald-nvidia
iwald-nvidia merged commit df7390b into NVIDIA:main Jul 15, 2026
6 checks passed
@lewisfish

Copy link
Copy Markdown
Author

Hi Ingo,

Thanks for merging this!

My code won't compile without the "extern C", and complains about undefined references to the *_optixir_length variables.
With regards to the "STATIC", I used a "monkey see, monkey do" approach and copied what embed_ptx.cmake does. So it is intentional, but in an uninformed way.

Lewis

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