mapillary / inplace_abn

In-Place Activated BatchNorm for Memory-Optimized Training of DNNs
BSD 3-Clause "New" or "Revised" License
1.32k stars 187 forks source link

CUDA version (12.1) #232

Open sorrowyn opened 1 year ago

sorrowyn commented 1 year ago

RuntimeError: The detected CUDA version (12.1) mismatches the version that was used to compile PyTorch (11.6). Please make sure to use the same CUDA versions.

qumatouzhengdianshutiao commented 1 year ago

I wanna make sure if you have made it through, how do you solve this problem?

qumatouzhengdianshutiao commented 1 year ago

哥们教教怎么解决这个问题的

atharvanaik14 commented 1 year ago

You have to install cuda 11.6. If you are using conda, you can install it using

conda install -c "nvidia/label/cuda-11.6.2" cuda-toolkit
half-potato commented 1 year ago

Yeah that's doesn't work.

half-potato commented 1 year ago

Actual solution: make sure nvcc --version matches your pytorch nvidia version.

export CUDA_PATH=$(which nvcc)/../..

Chances are you using arch so also set

export CXX=/usr/bin/g++-11
export CC=/usr/bin/gcc-11
half-potato commented 1 year ago

Chances are you need the following as well.

conda install -c "nvidia/label/cuda-11.7.1" cuda-cudart
conda install ninja
mkdir /home/amai/.conda/envs/th2/lib64
sudo ln -s /home/amai/.conda/envs/th2/lib/libcudart.so.11.0 /home/amai/.conda/envs/th2/lib64
sudo ln -s /home/amai/.conda/envs/th2/lib/libcudart.so.11.7.99 /home/amai/.conda/envs/th2/lib64
sudo ln -s /home/amai/.conda/envs/th2/lib/libcudart.so /home/amai/.conda/envs/th2/lib64
geyang commented 1 year ago

Just do:

export PATH=/usr/local/cuda-11.8/bin:$PATH

after making sure that the path exists.

conda resets your PATH variable, so check nvcc --version.