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

CUDA version (12.1) #232

Open
sorrowyn opened this issue Mar 11, 2023 · 7 comments
Open

CUDA version (12.1) #232

sorrowyn opened this issue Mar 11, 2023 · 7 comments

Comments

@sorrowyn
Copy link

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

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

@qumatouzhengdianshutiao

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

@atharvanaik14
Copy link

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
Copy link

Yeah that's doesn't work.

@half-potato
Copy link

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
Copy link

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
Copy link

geyang commented Jul 7, 2023

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.

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

5 participants