-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
70 lines (59 loc) · 2.23 KB
/
Copy pathsetup.py
File metadata and controls
70 lines (59 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#
# Copyright (C) 2023, Inria
# GRAPHDECO research group, https://team.inria.fr/graphdeco
# All rights reserved.
#
# This software is free for non-commercial, research and evaluation use
# under the terms of the LICENSE.md file.
#
# For inquiries contact george.drettakis@inria.fr
#
# --------------------------------------------------------------------
# Modifications Copyright (C) 2025, Zhicong Sun.
# - Cross-platform compile flags (Linux vs Windows).
# - Default `TORCH_CUDA_ARCH_LIST` covers 7.0/7.5/8.0/8.6/8.9/9.0 so
# V100 / T4 / A100 / A6000 / RTX 30/40 series / H100 all build out
# of the box; can still be overridden with the env var.
# --------------------------------------------------------------------
import os
import platform
from setuptools import setup
from torch.utils.cpp_extension import CUDAExtension, BuildExtension
HERE = os.path.dirname(os.path.abspath(__file__))
GLM_INCLUDE = os.path.join(HERE, "third_party", "glm")
# Default to a wide arch list so the binary works on most data-center and
# consumer GPUs. Users can still override via `TORCH_CUDA_ARCH_LIST`.
os.environ.setdefault(
"TORCH_CUDA_ARCH_LIST",
"7.0 7.5 8.0 8.6 8.9 9.0",
)
nvcc_args = [f"-I{GLM_INCLUDE}"]
cxx_args = []
# `-fno-gnu-unique` is a GCC-only flag; it was needed in the original 3DGS
# release to work around symbol-deduplication on some Linux toolchains.
# Skip it on macOS / MSVC where it does not exist.
if platform.system() == "Linux":
nvcc_args = ["-Xcompiler", "-fno-gnu-unique"] + nvcc_args
setup(
name="diff_gaussian_rasterization",
version="0.1.0",
description=(
"Differentiable 4D Gaussian rasterizer with MonoGS-style "
"camera pose gradient (used in D4DGS-SLAM, IROS 2025)."
),
packages=["diff_gaussian_rasterization"],
ext_modules=[
CUDAExtension(
name="diff_gaussian_rasterization._C",
sources=[
"cuda_rasterizer/rasterizer_impl.cu",
"cuda_rasterizer/forward.cu",
"cuda_rasterizer/backward.cu",
"rasterize_points.cu",
"ext.cpp",
],
extra_compile_args={"nvcc": nvcc_args, "cxx": cxx_args},
),
],
cmdclass={"build_ext": BuildExtension},
)