RepoNVIDIANVIDIApublished Oct 15, 2025seen 1d

NVIDIA/OWL

C++

Open original ↗

Captured source

source ↗
published Oct 15, 2025seen 1dcaptured 9hhttp 200method plain

NVIDIA/OWL

Description: The OptiX Wrappers Library

Language: C++

License: Apache-2.0

Stars: 34

Forks: 7

Open issues: 3

Created: 2025-10-15T01:48:04Z

Pushed: 2026-06-09T23:33:36Z

Default branch: main

Fork: no

Archived: no

README:

OWL: A Productivity Library for OptiX

Build Status: ![Windows](https://github.com/NVIDIA/owl/actions/workflows/Windows.yml) ![Ubuntu](https://github.com/NVIDIA/owl/actions/workflows/Ubuntu.yml)

Common Issues

If you're new to OWL, please skip this section and continue reading at "What is OWL?".

For those that are already using OWL, here's a brief list of some issues that some users ran/run into:

CUDA_ERROR_UNSUPPORTED_PTX_VERSION

Problem: OWL program builds all right, but when the resulting binary is started it throws an error like unknown CUDA error when building module for bounds program kernel CUDA_ERROR_UNSUPPORTED_PTX_VERSION log: ptxas application ptx input, line 9; fatal : Unsupported .version 9.3; current version is '9.2' (or, of course, similar PTX version strings).

What this means is that you are using a CDUA version that's newer than what your driver expects. Your driver was built with a certain CUDA version in mind, and it will not be able to ruintime-compile PTX code that's newer than that. To check which version of CUDA your driver can handle, you can also call the nvidia-smi utility; in the top right it will tell you which CUDA version it was built with.

To fix: either update to a newer driver (that understands your newer CDUA version), or use an older version of CUDA (that your driver understands).

On Windows:

What is OWL?

OWL is a convenience/productivity-oriented library on top of OptiX (version 7 and newer), and aims at making it easier to write OptiX programs by taking some of the more arcane parts of that job (like knowing what a Shader Binding Table is, and how to actually build it), and allowing the user to do that in a much, much simpler way. For example, assuming the node graph (ie, the programs, geometries, and acceleration structures) have already been built, the shader binding table (SBT) can be built and properly populated by a single call owlBuildSBT(context).

In addition, OWL also allows for somewhat higher-level abstractions than native OptiX+CUDA for operations such as creating device buffers, uploading data, building shader programs and pipelines, building acceleration structures, etc.

Who is OWL designed/intended for?

OWL is particularly targetted at two groups of users: First, those that do want to use GPU Ray Tracing and RTX hardware acceleration, and that are comfortable with typical GPU concepts such as GPU memory vs device memory, ray tracing pipeline, shader programs, and some CUDA programming - but that are *not* "Ninja" OptiX/Vulkan/DirectX users, and might not be 100% sure about the most nitty-bitty grits of details on SBT data layout and order, or on just how exactly to do the BVH compaction, how exactly to deal with async launches or refitting, etc.

Second, it targets those that *do* know all these concepts, but would rather spent their time on the actual shader programs and functionality of the program, rather than on doing and all the low-level steps themselves; ie, those that are willing to trade a bit of low-level control (and *maybe* some tiny amount of performance) for higher developing productivity.

A Simple OWL Example

As an example of how easy it is to use OWL to build OptiX data strucutres, the following example code snippet takes a host-based triangle mesh and:

  • uploads the index and vertex buffer to the active GPU(s)
  • creates a triangle mesh geometry with a sample 'color' SBT entry
  • puts this mesh into a triangle bottom-level accel structure (BLAS)
  • builds that acceleration structure, including BVH compaction
  • creates an instance with an instance transform, and finally
  • builds and returns an instance acceleration structure over that.

Note how this little example will do these step: including data upload, set-up of build inputs, BVH construction, BVH compaction, and everything else that's required for this. Though still a relatively benign example, doing the same in low-level CUDA and OptiX code would result in significantly more code that the user would have to write, debug, and maintain.

/* simple sample of setting up a full geometry, BLAS and IAS for a simple single-triangle mesh model */ OWLGroup buildBlasAndIas(mat3x4f &instXfm, std::vector &vtx, std::vector &idx, float3 color) { /* upload the buffers */ OWLBuffer vtxBuffer = owlDeviceBufferCreate(ctx,OWL_FLOAT3, vtx.size(),vtx.data()); OWLBuffer idxBuffer = owlDeviceBufferCreate(ctx,OWL_INT3, idx.size(),idx.data());

/* create triangle mesh geometry */ OWLGeom mesh = owlGeomCreate(ctx,myMeshGT); owlTrianglesSetVertices(mesh,vtxBuffer,vtx.size(), /*stride+ofs*/sizeof(vtx[0],0); owlTrianglesSetIndices(mesh,vtxBuffer,vtx.size(), /*stride+ofs*/sizeof(idx[0]),0);

/* create and build triangle BLAS */ OWLGroup blas = owlTrianglesGroupCreate(ctx,1,&mesh); owlGroupBuildAccel(blas);

/* create and build instance accel struct (IAS) */ OWLGroup ias = owlInstanceGroupCreate(ctx,1, /* instantiated BLASes */&blas, /* instance IDs: */nullptr, /* instance transforms */&instXfm); owlGroupBuildAccel(ias); return blas; // that's it! }

Of course, even with OWL there's still much more that needs to be done for a full renderer: For example, in this code we assumed that a context (ctx) and a geometry type for this mesh (myMeshGT) have already been created; the user also still has to set up the programs, create frame buffer and launch data, build the programs (owlBuildPrograms()), the pipline (owlBuildPipeline()), and the SBT (owlBuildSBT(ctx)), etc.

OWL Features

As stated above, OWL explicitly aims for helping entry-level or casual RTX users get started, and get working productively with OptiX and RTX without having to first become an OptiX "Ninja".

However, that is not to mean that it is *only* useful for beginners. In fact, OWL currently supports lots of rather advanced features as well, including, for example:

  • multi-level instancing
  • accel structure refitting (compaction is always on)
  • multiple raygen programs and multiple ray types
  • motion blur, including instance motion blur
  • multi-GPU support, including proper handling of…

Excerpt shown — open the source for the full document.