geopavlakos / hamer

HaMeR: Reconstructing Hands in 3D with Transformers
https://geopavlakos.github.io/hamer/
MIT License
326 stars 28 forks source link

Detectron2 installation issues #12

Closed mnauf closed 6 months ago

mnauf commented 7 months ago

I can't seem to install detectron2. The error is "The detected CUDA version (10.1) mismatches the version that was used to compile PyTorch (11.7). Please make sure to use the same CUDA versions"

mnauf commented 7 months ago
File "/home/hello_world/anaconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 499, in build_extensions
  _check_cuda_version(compiler_name, compiler_version)
File "/home/hello_world/anaconda3/envs/hamer/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 387, in _check_cuda_version
  raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
RuntimeError:
The detected CUDA version (10.1) mismatches the version that was used to compile
PyTorch (11.7). Please make sure to use the same CUDA versions.
geopavlakos commented 6 months ago

This is probably happening because we have hardcoded the CUDA version to be 11.7 when installing pytorch in the installation instructions. You should edit that to be compatible with the CUDA version you have in your machine. With that being said, we haven't tested the code with CUDA 10.1, so I cannot confirm that it will work under this setting.

Kafka157 commented 3 weeks ago

I got the same issue with you and successfully solved it. I first checked the Linux x86_64 Driver Version, and upgrade it to fit the CUDA Toolkit 11.7. (link:https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html) Then I download CUDA Toolkit 11.7 (following the reference). And we should ensure the path of cuda is right, 1.input in termial:

nano ~/.bashrc

2.Then, input the following instruction at the end of the 'nano':

export PATH=/usr/local/cuda-11.7/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-11.7/lib64:$LD_LIBRARY_PATH

3.press 'ctrl + X' and ' Y' to save it, and press ' enter' to leave.

4.activate your env again

5.input nvcc -V to check the running cuda version my output is: Cuda compilation tools, release 11.7, V11.7.64 Build cuda_11.7.r11.7/compiler.31294372_0

Hoping this comment can help you ~