WSL2: libcuda.so and libcuda.so.1 should be symlink

The /usr/lib/wsl/lib/libcuda.so* in WSL2 (Ubuntu) is generated by NVIDIA Windows GPU Driver, but the library fails to load, so please configure it with a symbolic link.

How to reproduce

  • python program
from ctypes import cdll

cdll.LoadLibrary('libcuda.so.1') # ok
cdll.LoadLibrary('libcuda.so') # ng
pip install git+https://github.com/openai/whisper.git 
sudo apt install ffmpeg
whisper audio.mp3 --model medium

How to fix

cd /usr/lib/wsl/lib
sudo rm libcuda.so libcuda.so.1
sudo ln -s libcuda.so.1.1 libcuda.so.1
sudo ln -s libcuda.so.1 libcuda.so
sudo ldconfig

Referenses