Installation
Install RayD 0.8.0 from PyPI, check the GPU, driver, and Python requirements, and verify the Dr.Jit or PyTorch backend.
RayD is published on PyPI as prebuilt CUDA wheels. You do not need the CUDA toolkit or the OptiX SDK to install it; both are only needed to build from source.
Requirements#
| Item | Requirement |
|---|---|
| Operating system | Windows x86-64, or Linux x86-64 with glibc 2.28 or newer (manylinux_2_28) |
| Python | CPython 3.10, 3.11, 3.12, 3.13, or 3.14 |
| GPU | NVIDIA GPU, compute capability 7.0 (Volta) or newer |
| Driver | An NVIDIA driver that supports CUDA 12.8 (R570 branch or newer) |
| Dr.Jit backend | drjit==1.3.1, installed automatically |
| PyTorch backend | PyTorch 2.10 with CUDA (torch>=2.10,<2.11) |
The wheels contain native code for sm_70, sm_75, sm_80, sm_86, sm_87, sm_89, sm_90, sm_100, sm_101, and sm_120, plus compute_120 PTX for newer GPUs. They are built with CUDA 12.8 and the OptiX 8.1 API.
OptiX itself ships inside the NVIDIA driver. If the driver cannot create an OptiX context, a scene created with the default trace_backend="auto" uses RayD's pure-CUDA BVH instead, so every query still runs. macOS and CPU-only machines are not supported.
Install#
There are three distributions, all at version 0.8.0:
| Distribution | Contents |
|---|---|
rayd | Meta-package that installs both backends at the same version |
rayd-drjit | The Dr.Jit backend, rayd.drjit |
rayd-torch | The PyTorch backend, rayd.torch |
pip install rayd-drjit==0.8.0This also installs drjit==1.3.1.
Pick the backend explicitly
Since 0.6.0 the parent rayd package is a namespace only. import rayd as rd no longer gives you a backend. Use import rayd.drjit as rd or import rayd.torch as rt.
Verify the installation#
Run this for the Dr.Jit backend:
python -c "import rayd.drjit as rd; print(rd.optix_available(), rd.device_count()); print(rd.Scene().capabilities()['trace_backend'])"Expected output on a machine with a working OptiX driver:
True 1
optixcuda in the last line means OptiX is not available and RayD uses its CUDA fallback. Dr.Jit may print jitc_llvm_init(): LLVM API initialization failed on import. That message is about Dr.Jit's CPU backend, which RayD does not use, and you can ignore it.
Run this for the PyTorch backend:
python -c "import rayd.torch as rt; print(rt.backend_capabilities()['backend'], rt.backend_capabilities()['torch_compile'])"torch TrueThen run the quickstart, which checks a real intersection and its gradient.
Environment variables#
| Variable | Effect |
|---|---|
RAYD_DISABLE_OPTIX=1 | Makes RayD report OptiX as unavailable, so "auto" backends resolve to the CUDA fallback. Useful to test the OptiX-free path on an OptiX machine. |
OPTIX_CACHE_PATH | Standard OptiX module cache location. Give each process its own path when you launch several RayD processes at once. |
Build from source#
You need a source build only to change RayD itself or to link it into a native CMake project. The requirements are Python 3.10 to 3.14, CMake 3.22 or newer (3.26 for the Torch backend), a C++17 compiler (Visual Studio 2022 with Desktop C++ tools on Windows), the CUDA toolkit, and the OptiX SDK headers.
git clone https://github.com/Asixa/RayD.git
cd RayD
python -m pip install cmake ninja scikit-build-core
python -m pip install "drjit==1.3.1" "nanobind==2.11.0"
python -m pip install --no-build-isolation -ve drjitFor the Torch backend, install torch==2.10.0 from the cu128 index and run python -m pip install --no-build-isolation -ve torch. On Windows, scripts\build_local.cmd -Backend drjit (or -Backend torch) builds only the architecture of the GPU it detects, which is much faster than the release matrix.
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
ModuleNotFoundError: No module named 'rayd.drjit' | Only rayd-torch is installed. Install rayd-drjit, or use rayd.torch. |
pip cannot find a matching wheel | Your Python is outside 3.10 to 3.14, or the platform is not Windows or Linux x86-64. |
rayd-torch refuses your PyTorch | The wheel is bound to PyTorch 2.10. Install torch==2.10.*. |
optix_available() is False | The driver is too old or does not expose OptiX (for example in some containers). RayD falls back to CUDA; update the driver to use OptiX. |