pytorch / pytorch/vision

Compilation error with cuda

Open
#6,240 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🐛 Describe the bug

When compiling vision with cuda enabled I am getting following error
CMake Error at /usr/local/share/cmake-3.22/Modules/CMakeTestCUDACompiler.cmake:56 (message):
The CUDA compiler
"/usr/bin/nvcc"
is not able to compile a simple test program.

I was able to compile the library after adding following in CMakeLists.txt after if(WITH_CUDA)
set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.1/bin/nvcc").

Versions

PyTorch version: 1.8.2+cu111
Is debug build: False
CUDA used to build PyTorch: 11.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: 10.0.0-4ubuntu1
CMake version: version 3.22.5
Libc version: glibc-2.17

Python version: 3.6.13 |Anaconda, Inc.| (default, Jun 4 2021, 14:25:59) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.14.0-1044-oem-x86_64-with-debian-bullseye-sid
Is CUDA available: True
CUDA runtime version: 11.1.74
GPU models and configuration: GPU 0: NVIDIA T600 Laptop GPU
Nvidia driver version: 510.73.05
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.3.2
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.3.2
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.3.2
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.3.2
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.3.2
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.3.2
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.3.2
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn.so.8.1.1
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.1.1
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.1.1
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.1.1
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.1.1
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.1.1
/usr/local/cuda-11.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.1.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.19.5
[pip3] numpy-quaternion==2021.11.4.15.26.3
[pip3] numpy-ros==0.1.3
[pip3] torch==1.8.2+cu111
[pip3] torchaudio==0.8.2
[pip3] torchvision==0.9.2+cu111
[conda] blas 1.0 mkl conda-forge
[conda] cudatoolkit 10.1.243 h6bb024c_0 anaconda
[conda] libblas 3.8.0 14_mkl conda-forge
[conda] libcblas 3.8.0 14_mkl conda-forge
[conda] liblapack 3.8.0 14_mkl conda-forge
[conda] mkl 2019.4 243 anaconda
[conda] mkl-service 2.3.0 py36he904b0f_0 anaconda
[conda] mkl_fft 1.2.0 py36h23d657b_0 anaconda
[conda] mkl_random 1.1.0 py36hd6b4f25_0 anaconda
[conda] numpy 1.19.5 py36hfc0c790_2 conda-forge
[conda] numpy-quaternion 2021.11.4.15.26.3 pypi_0 pypi
[conda] numpy-ros 0.1.3 pypi_0 pypi
[conda] torch 1.8.2+cu111 pypi_0 pypi
[conda] torchaudio 0.8.2 pypi_0 pypi
[conda] torchvision 0.9.2+cu111 pypi_0 pypi

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in CMakeLists.txt around the if(WITH_CUDA) block and compare its CUDA compiler handling with CMakeTestCUDACompiler.cmake, which reports the failure. Reproduce the CUDA-enabled vision build using the reported Ubuntu, CMake, CUDA, and nvcc versions; done means the build succeeds without manually setting CMAKE_CUDA_COMPILER.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.