0. 宿主机执行
xhost +
1.nvidia-docker run 起容器时加参数
-e DISPLAY=unix$DISPLAY
2.容器内
export PATH=$PATH:/usr/lib/nvidia-${driver_v}/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia-${driver_v}:/usr/lib32/nvidia-${driver_v} 3. 如果还不行执行 export DISPLAY=:0