Fail build torchvision from source for cuda support
See original GitHub issueI tried build torchvision from source with cuda support , but appear error like below:
[ 71%] Building CUDA object CMakeFiles/torchvision.dir/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu.o
/usr/local/cuda/include/cusparse.h(6314): error: expected a "}"
Segmentation fault (core dumped)
CMakeFiles/torchvision.dir/build.make:593: recipe for target 'CMakeFiles/torchvision.dir/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu.o' failed
make[2]: *** [CMakeFiles/torchvision.dir/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu.o] Error 139
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/torchvision.dir/all' failed
make[1]: *** [CMakeFiles/torchvision.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
Error appears at the first cuda build package. I tried searching for a fix, but the error never seems to show up before: My environment:
Ubuntu 18.04
CUDA 11.1
CuDNN 8.2.0
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
build from source error · Issue #6157 · pytorch/vision - GitHub
I figured out a solution, upgrade cuda to 11.3, then install the latest version of pytorch (cudatoolkit=11.3), and then compile torchvision.
Read more >Issue Building Torchvision from Source - PyTorch Forums
I'm building torch and torchvision from source since my system is fixed to CUDA 10.0 unfortunately and I need torch 1.6+. I am...
Read more >Speed Up PyTorch by Building from Source on Ubuntu 18.04
As of writing, PyTorch officially supports CUDA up to 10.0 unless PyTorch adds MAGMA support for ... First, let's build the torchvision library...
Read more >PyTorch and torchvision versions are incompatible
This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source.
Read more >Can't connect to GPU when building PyTorch projects
remove any Conda environments in Ubuntu. · clean the pip list and Conda list until none of any PyTorch, torchvision, Cuda etc works....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@prabhat00155 @fmassa Thanks for your supports Have some error when cmake did not found CUDA compiler and I don’t know why I fixed issues by adding path nvcc
set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.1/bin/nvcc")
toCMakeLists.txt
I was able to build torchvision from source without any error(both with libtorch 1.9.0 and latest nightly). This is what I did:
Could you please try with the latest torch nightly(libtorch 1.10.0.dev20210825+cu111)? You can either use the aforementioned wget or go to pytorch homepage page and select preview(nightly). Also, could you paste the output of the following: