4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00
nerfstudio/setup.py
Ethan Weber 676beebb14
Setting near and far with scene bounds collider. Also LR schedules. (#74)
* some initial cuda code as I learn. using git to save progress.

* first cuda kernel for ray sampling that mostly works

* cleaning up code. working on lr. structs for scene bounds aabb

* added scene bounds collider code

* updated setup

* setup

* setup

* black

* including some files

* exporting env variable

* new file

* git workflows

* github actions

* github actions

* github actions

* removing env var
2022-05-16 14:03:19 -07:00

40 lines
1.0 KiB
Python

import os
from setuptools import setup
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
USE_CUDA = False
ext_modules = []
cmdclass = {}
setup_requires = []
if USE_CUDA:
try:
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
ext_modules = [
CUDAExtension(
name="mattport_cuda",
sources=[
"mattport/cuda/mattport_cuda.cpp",
"mattport/cuda/mattport_cuda_kernel.cu",
],
include_dirs=[os.path.join("mattport", "cuda", "include")],
extra_compile_args={
"cxx": [],
"nvcc": [],
},
verbose=True,
),
]
cmdclass = {"build_ext": BuildExtension}
setup_requires = ["pybind11>=2.5.0"]
except:
print("Failed to build the CUDA extension.")
if __name__ == "__main__":
setup(
ext_modules=ext_modules,
cmdclass=cmdclass,
setup_requires=setup_requires,
)