JamesPerlman / TurboNeRF

A render engine for NeRFs!
MIT License
312 stars 16 forks source link

Support CUDA 11 + linux fixes #23

Closed paulmelis closed 1 year ago

paulmelis commented 1 year ago

This adds support for CUDA 11, but still checks for CUDA 12 in the main cmake config. The few places in the CUDA code where CUDA12-specific features are used are behind #include guards.

The patches in the patches/ dir need to be applied to the recursively checked out repository, as we need to patches to the glad, tiny-cuda-nn and pybind11 source repos in include/.

~~The first is needed as a shared library (and so the Python module) on Linux requires the code in the tiny-cuda-nn library to be built as position-independent code (-fPIC). I did not see the required options to enable this in the upstream code, hence the patches like this. ~~

The patch to pybind11 is needed when building against CUDA12 to work around https://github.com/pybind/pybind11/issues/4606

Finally, I had an error related to the use of #pragma once, which I worked around using include guards.

paulmelis commented 1 year ago

Yep, all done!

paulmelis commented 1 year ago

Found a small error in the pybind11 patch while trying to apply it on a different workstation. Fixed now.