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

ninja: build stopped: subcommand failed. #126

Closed
MollyHoo opened this issue Apr 25, 2022 · 5 comments
Closed

ninja: build stopped: subcommand failed. #126

MollyHoo opened this issue Apr 25, 2022 · 5 comments

Comments

@MollyHoo
Copy link

RuntimeError: Error building extension 'standard_rasterize_cuda': [1/3] :/usr/local/cuda-11.2/bin/nvcc -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/TH -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-11.2/include -isystem /usr/include/python3.7m -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++14 -ccbin=$(which gcc-7) -c /home/seemmo/DECA/decalib/utils/rasterizer/standard_rasterize_cuda_kernel.cu -o standard_rasterize_cuda_kernel.cuda.o
FAILED: standard_rasterize_cuda_kernel.cuda.o
:/usr/local/cuda-11.2/bin/nvcc -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/TH -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-11.2/include -isystem /usr/include/python3.7m -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++14 -ccbin=$(which gcc-7) -c /home/seemmo/DECA/decalib/utils/rasterizer/standard_rasterize_cuda_kernel.cu -o standard_rasterize_cuda_kernel.cuda.o
/bin/sh: 1: :/usr/local/cuda-11.2/bin/nvcc: not found
[2/3] c++ -MMD -MF standard_rasterize_cuda.o.d -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/TH -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-11.2/include -isystem /usr/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /home/seemmo/DECA/decalib/utils/rasterizer/standard_rasterize_cuda.cpp -o standard_rasterize_cuda.o
FAILED: standard_rasterize_cuda.o
c++ -MMD -MF standard_rasterize_cuda.o.d -DTORCH_EXTENSION_NAME=standard_rasterize_cuda -DTORCH_API_INCLUDE_EXTENSION_H -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/TH -isystem /home/seemmo/.local/lib/python3.7/site-packages/torch/include/THC -isystem :/usr/local/cuda-11.2/include -isystem /usr/include/python3.7m -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -std=c++14 -c /home/seemmo/DECA/decalib/utils/rasterizer/standard_rasterize_cuda.cpp -o standard_rasterize_cuda.o
In file included from /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/Device.h:3:0,
from /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/python.h:8,
from /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/extension.h:6,
from /home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:6,
from /home/seemmo/DECA/decalib/utils/rasterizer/standard_rasterize_cuda.cpp:1:
/home/seemmo/.local/lib/python3.7/site-packages/torch/include/torch/csrc/python_headers.h:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.

could you help me. i have tried for cuda10.1+cudnn7.6.5+torch1.6.0+torchvision0.7.0+ubuntu16.04
always this error.

@biophase
Copy link

biophase commented May 5, 2022

I'm also getting the same error on Ubuntu 20.04. Were you able to find any solutions?

@JonathanLehner
Copy link

did you find any?

@YunliYin
Copy link

Did you find any solutions to this error? I met the same error.

@chenerg
Copy link

chenerg commented Jul 18, 2022

Just use --rasterizer_type=pytorch3d to bypass the self-implemented rasterlization version.

@Fightzzw
Copy link

Fightzzw commented Jun 1, 2023

Solution1:

use --rasterizer_type=pytorch3d to bypass the self-implemented rasterlization version which will generate standard_rasterize_cuda.o at the beginning of the program.

Solution2:

change the gcc version to gcc-7, you can use following command:

sudo apt install gcc-7
sudo unlink /usr/bin/gcc 
sudo ln -s /usr/bin/x86_64-linux-gnu-gcc-7 /usr/bin/gcc

You also can look up this blog for the details: 【ubuntu】gcc/g++傻傻分不清?如何实现ubuntu多版本gcc/g++切换

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

No branches or pull requests

6 participants