Installing the GPU Module
The GPU ray tracing module is still an experimental feature and is under active development. If you encounter any issues or have suggestions, please let us know on GitHub.
Requirements
The GPU ray tracing module is implemented using OptiX 8.0. To use it, ensure your system meets the following requirements:
- NVIDIA Driver: Version 535 or higher
- CUDA Toolkit: Version 12.0
- OptiX SDK: Version 8.0
CMake Configuration
To enable GPU support, follow these steps:
- Open the
CMakeLists.txt
file and enable theVIENNAPS_USE_GPU
option. - Specify the path to your OptiX installation by setting the CMake variable
OptiX_INSTALL_DIR
.- This should point to the directory where the
include
folder containing OptiX headers is located.
- This should point to the directory where the
- Install the CUDA toolkit system-wide so CMake can detect it automatically or provide
CUDA_PATH
CMake variable. - Run CMake configuration. If both CUDA and OptiX are found, the GPU extension will be enabled.
- (Optional) To build examples or tests, set:
VIENNAPS_BUILD_EXAMPLES=ON
VIENNAPS_BUILD_TESTS=ON
Python Build Instructions
For building the Python GPU module:
- Set the environment variable
OptiX_INSTALL_DIR
to the OptiX installation directory.- This variable will be used during the CMake setup.
- Run the following command to install the module locally:
pip install .
Ensure
VIENNAPS_USE_GPU
is enabled andOptiX_INSTALL_DIR
is set. - The GPU functions are available in the
GPU
submodule:import viennaps3d as vps context = vps.gpu.Context() context.create() gpuProcess = vps.gpu.Process(context)
Note: The GPU submodule is only available in the 3D bindings since GPU ray tracing is implemented for 3D only.
Example usage of the GPU module can be found in the examples.
Currently, only a limited number of models are available for GPU acceleration: SingleParticleProcess, MultiParticleProcess, and SF6O2Etching.