I started this as a little learner project in order to teach myself some skills that pushed a little bit past what was available in the beginner tutorials:
- Programming using CUDA/C++.
- Configure a CMake Project to create both libraries and executables.
- Create Python bindings for an existing library.
In order to build this library yourself, you will have to download and unzip libtorch
from https://pytorch.org/get-started/locally/.
Once unzipped, move the libtorch/
directory to a new folder called external
, which should be at the top level of this repo. From
there you should be ready to go using CMake
mkdir build
cd build
cmake ..
cmake --build . --config <Debug or Release>
Simply search the generated build/test/<Debug or Release>/
and run cuda_test.exe
from the command line.
For this you will need to have the python torch
library installed in your environment in addition to libtorch
mentioned in the last
section Building C++
- Go to
cuda_raycast/python/setup.py
and edit the directories underinclude_dirs
andlibrary_dirs
to match your installation oftorch
. - On the command line, navigate to
cuda_raycast/python
- Run
python setup.py install
.
On the commandline run python cuda_raycast/python/ray.py
.