Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file

WSL2 Ubuntu conda pytorch虚拟环境中报错:

Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file

原因:
执行sudo ldconfig,报错:
/usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link
修复软连接问题:

cd /usr/lib/wsl/lib/

#backup
sudo mv libcuda.so.1 libcuda.so.1.bak
sudo mv libcuda.so libcuda.so.bak

#symbolic link
sudo ln -s libcuda.so.1.1 libcuda.so.1
sudo ln -s libcuda.so.1.1 libcuda.so
sudo ldconfig

你可能感兴趣的:(深度学习,ubuntu,python,pytorch)