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

Error: command 'gcc' failed with exit status 1 #8

Closed
munib94 opened this issue Jul 24, 2020 · 6 comments
Closed

Error: command 'gcc' failed with exit status 1 #8

munib94 opened this issue Jul 24, 2020 · 6 comments

Comments

@munib94
Copy link

munib94 commented Jul 24, 2020

Hi,

I tried running python setup.py install but I experienced the following error:

`
src/ball_query.cpp:10:23: error: ‘AT_CHECK’ was not declared in this scope; did you mean ‘DCHECK’?
10 | #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
| ^~~~~~~~
src/ball_query.cpp:10:23: note: in definition of macro ‘CHECK_CUDA’
10 | #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
| ^~~~~~~~
src/ball_query.cpp:16:5: note: in expansion of macro ‘CHECK_INPUT’
16 | CHECK_INPUT(new_xyz_tensor);
| ^~~~~~~~~~~
src/ball_query.cpp:10:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
10 | #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ")
| ^
src/ball_query.cpp:12:24: note: in expansion of macro ‘CHECK_CUDA’
12 | #define CHECK_INPUT(x) CHECK_CUDA(x);CHECK_CONTIGUOUS(x)
| ^~~~~~~~~~
src/ball_query.cpp:17:5: note: in expansion of macro ‘CHECK_INPUT’
17 | CHECK_INPUT(xyz_tensor);
| ^~~~~~~~~~~
^
.
.
.
from src/ball_query.cpp:1:
/home/munib/.pyenv/versions/miniconda3-latest/envs/flownet3d_pytorch/lib/python3.5/site-packages/torch/include/ATen/core/TensorBody.h:341:7: note: declared here
341 | T * data() const {
| ^~~~
src/ball_query.cpp:22:27: error: ‘THCState_getCurrentStream’ was not declared in this scope
22 | cudaStream_t stream = THCState_getCurrentStream(state);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1

`
I can't find any solutions. Do you know how to fix this issue?

System:
OS: Ubuntu 20.04 LTS
Python version: 3.5
PyTorch version: 1.5.1
Torchvision version: 0.6.1
CUDA/cuDNN version: 10.1/7.6.4
GPU: Nvidia Titan RTX

@munib94
Copy link
Author

munib94 commented Jul 24, 2020

After further investigation, I came upon this: pytorch/pytorch#14500

It seems like it is an issue with PyTorch 1.5. I replaced THCState_getCurrentStream with
at::cuda::getCurrentCUDAStream() in src/ball_query.cpp and it fixed that issue. Can you confirm this is an issue with PyTorch 1.5?

I re-ran python setup.py install but I still ran into an error. Do you know what the issue could be? I attached the full output on the terminal here:
setup_install_output.txt

@hyangwinter
Copy link
Owner

Your problem is more like this: https://stackoverflow.com/questions/61559479/cannot-compile-nms-cuda-in-mmdetection-using-colaboratory
open-mmlab/mmdetection#2513

Maybe you should replace AT_CHECK with TORCH_CHECK to support pytorch 1.5 or downgrade your pytorch version to 1.4 .

@munib94
Copy link
Author

munib94 commented Jul 26, 2020

I replaced all mentions of AT_CHECK and THCState_getCurrentStream(state) with TORCH_CHECK and at::cuda::getCurrentCUDAStream(), respectively. I was then able to install setup.py without errors. Thank you for your help!

@QLuanWilliamed
Copy link

I replaced all mentions of AT_CHECK and THCState_getCurrentStream(state) with TORCH_CHECK and at::cuda::getCurrentCUDAStream(), respectively. I was then able to install setup.py without errors. Thank you for your help!

Hi, could you share your revised code here? because I am not familiar with C++ languages. Thanks!

@sunyanzeng
Copy link

Why did I replace these two functions with the latest one, and still have an error

@ChidanandKumarKS
Copy link

worked well in my case by replacing THCState_getCurrentStream with at::cuda::getCurrentCUDAStream()

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

5 participants