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 '/usr/local/cuda/bin/nvcc' failed with exit code 1 #117

Open
Abhayy-Kumar opened this issue May 29, 2024 · 3 comments
Open

Comments

@Abhayy-Kumar
Copy link

Hello everyone,
so i am trying to extract features from images for my project and getting this error again and again.

I have successfully installed detectron2 and getting this error when trying to build setup.py of bottom-up-attention.pytorch.

I am using google colab with T4 gpu support.

Pasting the whole output below.

running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/utils
copying utils/__init__.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/extractor.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/extract_features_faster.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/extract_utils.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/extract_features_multigpu.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/progress_bar.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/extract_d2features.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/utils.py -> build/lib.linux-x86_64-cpython-310/utils
copying utils/extract_features_singlegpu.py -> build/lib.linux-x86_64-cpython-310/utils
creating build/lib.linux-x86_64-cpython-310/evaluation
copying evaluation/__init__.py -> build/lib.linux-x86_64-cpython-310/evaluation
copying evaluation/vg_evaluation.py -> build/lib.linux-x86_64-cpython-310/evaluation
copying evaluation/vg_eval.py -> build/lib.linux-x86_64-cpython-310/evaluation
creating build/lib.linux-x86_64-cpython-310/bua
copying bua/__init__.py -> build/lib.linux-x86_64-cpython-310/bua
copying bua/visual_genome.py -> build/lib.linux-x86_64-cpython-310/bua
creating build/lib.linux-x86_64-cpython-310/bua/d2
copying bua/d2/__init__.py -> build/lib.linux-x86_64-cpython-310/bua/d2
copying bua/d2/config.py -> build/lib.linux-x86_64-cpython-310/bua/d2
creating build/lib.linux-x86_64-cpython-310/bua/caffe
copying bua/caffe/__init__.py -> build/lib.linux-x86_64-cpython-310/bua/caffe
copying bua/caffe/config.py -> build/lib.linux-x86_64-cpython-310/bua/caffe
copying bua/caffe/postprocessing.py -> build/lib.linux-x86_64-cpython-310/bua/caffe
creating build/lib.linux-x86_64-cpython-310/bua/d2/dataloader
copying bua/d2/dataloader/__init__.py -> build/lib.linux-x86_64-cpython-310/bua/d2/dataloader
copying bua/d2/dataloader/build_loader.py -> build/lib.linux-x86_64-cpython-310/bua/d2/dataloader
copying bua/d2/dataloader/dataset_mapper.py -> build/lib.linux-x86_64-cpython-310/bua/d2/dataloader
creating build/lib.linux-x86_64-cpython-310/bua/caffe/dataloader
copying bua/caffe/dataloader/__init__.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/dataloader
copying bua/caffe/dataloader/transform_gen.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/dataloader
copying bua/caffe/dataloader/detection_utils.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/dataloader
copying bua/caffe/dataloader/dataset_mapper.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/dataloader
creating build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/__init__.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/backbone.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/rpn.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/roi_heads.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/rpn_outputs.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/fast_rcnn.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/box_regression.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
copying bua/caffe/modeling/rcnn.py -> build/lib.linux-x86_64-cpython-310/bua/caffe/modeling
running build_ext
/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:499: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:418: UserWarning: The detected CUDA version (12.2) has a minor version mismatch with the version that was used to compile PyTorch (12.1). Most likely this shouldn't be a problem.
  warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:428: UserWarning: There are no x86_64-linux-gnu-g++ version bounds defined for CUDA version 12.2
  warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
building 'bua.caffe.modeling._C' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/content
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua/caffe
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua/caffe/modeling
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua/caffe/modeling/layers
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua/caffe/modeling/layers/csrc
creating build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua/caffe/modeling/layers/csrc/nms
/usr/local/lib/python3.10/dist-packages/torch/utils/cpp_extension.py:1967: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. 
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
  warnings.warn(
/usr/local/cuda/bin/nvcc -DWITH_CUDA -I/content/bottom-up-attention.pytorch/bua/caffe/modeling/layers/csrc -I/usr/local/lib/python3.10/dist-packages/torch/include -I/usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.10/dist-packages/torch/include/TH -I/usr/local/lib/python3.10/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.10 -c /content/bottom-up-attention.pytorch/bua/caffe/modeling/layers/csrc/nms/nms.cu -o build/temp.linux-x86_64-cpython-310/content/bottom-up-attention.pytorch/bua/caffe/modeling/layers/csrc/nms/nms.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++17
/content/bottom-up-attention.pytorch/bua/caffe/modeling/layers/csrc/nms/nms.cu:5:10: fatal error: THC/THC.h: No such file or directory
    5 | #include <THC/THC.h>
      |          ^~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1 
@BlessingDev
Copy link

I've solved the issue. I'm not sure you are still on the issue but I hope it helps you.
#119

@Abhayy-Kumar
Copy link
Author

Thanks, it worked, now I am not getting that error.
I got very long output, last lines are given below, do you think setup.py was built successfully?

"Installed /content/bottom-up-attention.pytorch
Processing dependencies for bottom-up-attention.pytorch==0.0.0
Finished processing dependencies for bottom-up-attention.pytorch==0.0.0"

@BlessingDev
Copy link

BlessingDev commented Oct 21, 2024

do you think setup.py was built successfully?

I'm not sure. I've also got the same message.
Probably, I should run the model once to ensure whether it is built sucessfully.

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

2 participants