问题描述
Ubuntu上安装了Nvidia Driver4.5+,同时安装有cuda,然后本地运行docker里的cuda程序,提示如下错误:
CUDA driver version is insufficient for CUDA runtime version
解决办法
安装nvidia-docker2
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
docker run command
# 注意--runtime=nvidia必须加上
docker run -ti --runtime=nvidia --net=host --ipc=host --device /dev/snd:/dev/snd \
--device=/dev/bus/usb --privileged --name=remote-drive -v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=unix$DISPLAY -v /mnt:/mnt -v /dev:/dev -v ~/.ssh:/root/.ssh -v \
/home/pengrui/workspace/:/home/projects 4388 bash