facebookresearch / mvp

Training and Evaluation Code for "Mixture of Volumetric Primitives for Efficient Neural Rendering"
Other
191 stars 16 forks source link

Can not build the cuda pytorch extension #1

Closed ZhaoyangLyu closed 2 years ago

ZhaoyangLyu commented 2 years ago

May I know what pytorch version and cuda version are used to build the two CUDA PyTorch extensions? I was using pytorch 1.7.1, cuda 10.1 and gcc 5.5.0, but I got the error "torch/utils/cpp_extension.py", line 445, in unix_wrap_ninja_compile post_cflags = extra_postargs['cxx'] KeyError: 'cxx' when I tried to build the two CUDA PyTorch extensions. Any suggestions on how to solve the problem?

stephenlombardi commented 2 years ago

I'm building with: Python 3.8.10, PyTorch version 1.10.0a0+git179b3ab, CUDA V11.0.221, gcc version 8.3.1

I can't reproduce that error on my end but you can try editing setup.py and change these lines:

                extra_compile_args={
                    "nvcc": [
                        "-use_fast_math",
                        "-arch=sm_70",
                        "-std=c++17",
                        "-lineinfo",
                    ]
                }

to

                extra_compile_args={
                    "nvcc": [
                        "-use_fast_math",
                        "-arch=sm_70",
                        "-std=c++17",
                        "-lineinfo",
                    ],
                    "cxx": []
                }

and see if that resolves it?

ZhaoyangLyu commented 2 years ago

Thanks for your reply! I have switched to cuda 11.1, pytorch 1.10.1 and gcc 8.4.0. Now it works well for me.