Based on: Ray Tracing In One Weekend
- Install cmake, a C++17 compiler, and the CUDA toolkit v12.1
- Build the project.
Or replace
cmake -DCMAKE_BUILD_TYPE=Debug -B out/build cmake --build out/build --config Debug
Debug
withRelease
if you want a release build - Run the project.
./out/build/raytrace
- Alternatively, if you're using VS Code, there's quite a good cmake extension you can use for bulding and running the project.
The CUDA SDK is tightly coupled system type and hardware specifications, meaning there is no guarantee of this project working on platforms which it hasn't been explicitly tested.
The project has been tested on Ubuntu 22 with an Intel CPU, and a Geforce 1660ti.
If the project is incompatible with your machine, or if you'd prefer not to download the CUDA sdk, this project also contains an implementation for running on the CPU, which should hopefully be more consistent across platforms.