Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Can not build the cuda pytorch extension #1

Closed
ZhaoyangLyu opened this issue Jan 23, 2022 · 2 comments
Closed

Can not build the cuda pytorch extension #1

ZhaoyangLyu opened this issue Jan 23, 2022 · 2 comments

Comments

@ZhaoyangLyu
Copy link

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
Copy link

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
Copy link
Author

ZhaoyangLyu commented Jan 26, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants