Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error #7

Closed
Salingo opened this issue Dec 9, 2019 · 5 comments
Closed

Compile error #7

Salingo opened this issue Dec 9, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Salingo
Copy link

Salingo commented Dec 9, 2019

Hi, when I tried to run the unit_test, it returned an error shows below. Have you ever met this problem?
I am using CUDA 10.1, PyTorch 1.3.1
Thank you!

Traceback (most recent call last):
  File "/home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1030, in _build_extension_module
    check=True)
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "unit_test.py", line 1, in <module>
    import torch, chamfer3D.dist_chamfer_3D, fscore
  File "/home/zihao/Nutstore/4DCompletion/code/complete_pc/ChamferDistancePytorch/chamfer3D/dist_chamfer_3D.py", line 13, in <module>
    "/".join(os.path.abspath(__file__).split('/')[:-1] + ["chamfer3D.cu"]),
  File "/home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 661, in load
    is_python_module)
  File "/home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 830, in _jit_compile
    with_cuda=with_cuda)
  File "/home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 883, in _write_ninja_file_and_build
    _build_extension_module(name, build_directory, verbose)
  File "/home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1043, in _build_extension_module
    raise RuntimeError(message)
RuntimeError: Error building extension 'chamfer_3D': [1/3] :/usr/local/cuda-10.1:/usr/local/cuda-10.1/bin/nvcc -DTORCH_EXTENSION_NAME=chamfer_3D -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/TH -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.1:/usr/local/cuda-10.1/include -isystem /home/zihao/Nutstore/4DCompletion/venv/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_61,code=sm_61 --compiler-options '-fPIC' -std=c++11 -c /home/zihao/Nutstore/4DCompletion/code/complete_pc/ChamferDistancePytorch/chamfer3D/chamfer3D.cu -o chamfer3D.cuda.o
FAILED: chamfer3D.cuda.o
:/usr/local/cuda-10.1:/usr/local/cuda-10.1/bin/nvcc -DTORCH_EXTENSION_NAME=chamfer_3D -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/TH -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.1:/usr/local/cuda-10.1/include -isystem /home/zihao/Nutstore/4DCompletion/venv/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_61,code=sm_61 --compiler-options '-fPIC' -std=c++11 -c /home/zihao/Nutstore/4DCompletion/code/complete_pc/ChamferDistancePytorch/chamfer3D/chamfer3D.cu -o chamfer3D.cuda.o
/bin/sh: 1: :/usr/local/cuda-10.1:/usr/local/cuda-10.1/bin/nvcc: not found
[2/3] c++ -MMD -MF chamfer_cuda.o.d -DTORCH_EXTENSION_NAME=chamfer_3D -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/TH -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.1:/usr/local/cuda-10.1/include -isystem /home/zihao/Nutstore/4DCompletion/venv/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/zihao/Nutstore/4DCompletion/code/complete_pc/ChamferDistancePytorch/chamfer3D/chamfer_cuda.cpp -o chamfer_cuda.o
FAILED: chamfer_cuda.o
c++ -MMD -MF chamfer_cuda.o.d -DTORCH_EXTENSION_NAME=chamfer_3D -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/TH -isystem /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/THC -isystem :/usr/local/cuda-10.1:/usr/local/cuda-10.1/include -isystem /home/zihao/Nutstore/4DCompletion/venv/include/python3.6m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++11 -c /home/zihao/Nutstore/4DCompletion/code/complete_pc/ChamferDistancePytorch/chamfer3D/chamfer_cuda.cpp -o chamfer_cuda.o
In file included from /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/Device.h:3:0,
                 from /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/python.h:8,
                 from /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/extension.h:6,
                 from /home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:6,
                 from /home/zihao/Nutstore/4DCompletion/code/complete_pc/ChamferDistancePytorch/chamfer3D/chamfer_cuda.cpp:1:
/home/zihao/Nutstore/4DCompletion/venv/lib/python3.6/site-packages/torch/include/torch/csrc/python_headers.h:9:20: fatal error: Python.h: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
@Salingo
Copy link
Author

Salingo commented Dec 9, 2019

Maybe it's because I'm using a virtual environment, so some files are missing?

@ThibaultGROUEIX
Copy link
Owner

Dear @Salingo
Thanks for reaching out,
I never had this.
They are a few interesting threads :
mapillary/inplace_abn#104
mapillary/inplace_abn#106 (comment)
zhanghang1989/PyTorch-Encoding#162
It looks like a path problem.
This line is especially suspicious
/bin/sh: 1: :/usr/local/cuda-10.1:/usr/local/cuda-10.1/bin/nvcc: not found
Are you sure cuda 10.1 is correctly installed? (you can check in /usr/local/cuda-10.1)

Best regards,
Thibault

@ThibaultGROUEIX ThibaultGROUEIX added the bug Something isn't working label Dec 12, 2019
@ThibaultGROUEIX ThibaultGROUEIX self-assigned this Dec 12, 2019
@Salingo
Copy link
Author

Salingo commented Dec 21, 2019

Hi, thanks for your reply, I have fixed the issue, indeed it is the problem with my path setting.
Thanks again!

@Salingo Salingo closed this as completed Dec 21, 2019
@marsarCV
Copy link

Hi, thanks for your reply, I have fixed the issue, indeed it is the problem with my path setting.
Thanks again!

Hey! how did you set the paths, I am facing a similar problem

@zhang-0515
Copy link

请问您解决这个问题了吗?我也遇到了这种情况

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants