diff --git a/x11docker b/x11docker index 23ae1140..8c291e6f 100755 --- a/x11docker +++ b/x11docker @@ -1372,15 +1372,15 @@ setup_gpu() { # option --gpu: share /dev/dri and check nvidia done < <(find /dev/dri /dev/nvidia* /dev/vga_arbiter -maxdepth 0 2>/dev/null ||:) # check for closed source nvidia driver on host, provide automated installation, warn about disadvantages + #Hostnvidia=yes [ "$Hostnvidia" = "yes" ] && { Nvidiaversion=$(head -n1 /dev/null | grep $Nvidiaversion ) + Nvidiadriver=$(find /usr/local/share/x11docker/NVIDIA*$Nvidiaversion*.run $Hostuserhome/.local/share/x11docker/NVIDIA*$Nvidiaversion*.run 2>/dev/null | head -n1 ) Nvidiadriver="$(realpath "$Nvidiadriver")" [ -e "$Nvidiadriver" ] && { - store_runoption volume $Nvidiadriver:ro $Cshare/NVIDIA-$Nvidiaversion.run - verbose -d "Found proprietary closed source nvidia driver installer $Nvidiadriver" @@ -3874,6 +3874,10 @@ create_dockercommand() { # create command to run docker --device $(convertpath --volume "$Line") \\ --volume $(convertpath --volume "$Line")" done < <(store_runoption dump device) + + # --gpu: share NVIDIDA driver installer + [ -e "$Nvidiadriver" ] && Dockercommand="$Dockercommand \\ + --volume $(convertpath --volume "$Nvidiadriver:ro" "$Cshare/NVIDIA-$Nvidiaversion.run")" # X socket will be softlinked to /tmp/.X11-unix in container.CMD.sh [ "$Newxsocket" ] && Dockercommand="$Dockercommand \\