Skip to content

Commit

Permalink
--gpu: Automated NVIDIA driver install: Allow new privileges #162
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed May 24, 2019
1 parent d043668 commit 191a3e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ Project website: https://github.com/mviereck/x11docker
Set `--wm=IMAGE` to run local image IMAGE as window manager.
[(#158)](https://github.com/mviereck/x11docker/issues/158)
### Fixed
- `--gpu` with automated NVIDIA drivr installation:
Don't set `--security-opt=no-new-privileges`.
[(#162)](https://github.com/mviereck/x11docker/issues/162)
- WSL: Add Windows System32 path to `PATH`. Can miss with `sudo`.
[(#153)](https://github.com/mviereck/x11docker/issues/153)
- `--update`, `--update-master`: Support more common `tar` beside `unzip`.
[(#115)](https://github.com/mviereck/x11docker/issues/115)
- `--vcxsrv`, `--xwin`: fix for free display number check.
Add `xwininfo` to dependency check of `--xwin`.
[(#155)](https://github.com/mviereck/x11docker/issues/155)
- `--pulseaudio` on Windows: Check multiple drives for cygwin64.
[(#145)](https://github.com/mviereck/x11docker/issues/145)
Share pulseaudio cookie.
[(#161)](https://github.com/mviereck/x11docker/issues/161)


## [5.6.0](https://github.com/mviereck/x11docker/releases/tag/v5.6.0) - 2019-05-02
Expand Down
10 changes: 5 additions & 5 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,6 @@ setup_gpu() { # option --gpu: share /dev/dri and check nvidia
verbose -d "Detected NVIDIA driver version $Nvidiaversion on host."
Nvidiadriver=$(find /usr/local/share/x11docker/NVIDIA*$Nvidiaversion*.run $Hostuserhome/.local/share/x11docker/NVIDIA*$Nvidiaversion*.run 2>/dev/null | head -n1 )
Nvidiadriver="$(myrealpath "$Nvidiadriver" 2>/dev/null)"

case "$Runtime" in
"nvidia")
verbose -d "NVIDIA runtime detected. Not installing driver."
Expand All @@ -1395,8 +1394,9 @@ setup_gpu() { # option --gpu: share /dev/dri and check nvidia
[ "$Capdropall" = "yes" ] && warning "To install proprietary closed source NVIDIA driver,
x11docker must give some capabilities to container that would be dropped
otherwise for security reasons. Container security is reduced now.
However, given capabilities are still within default Docker capabilities.
You would not have this issue with free nouveau driver on host."

:
} || {
Nvidiadriver=""
note "You are using proprietary closed source NVIDIA driver.
Expand Down Expand Up @@ -3698,7 +3698,7 @@ setup_capabilities() { # check linux capabilities needed by container
}
[ "$Switchcontainerusercaps" = "yes" ] && store_runoption cap "SETUID SETGID DAC_OVERRIDE AUDIT_WRITE"

[ "$Sharegpu" = "yes" ] && [ "$Nvidiadriver" ] && store_runoption cap "SETUID SETGID DAC_OVERRIDE CHOWN FOWNER"
[ "$Sharegpu" = "yes" ] && [ "$Nvidiadriver" ] && store_runoption cap "SETUID SETGID DAC_OVERRIDE CHOWN FOWNER" && Nonewprivileges="no"

# Issues with hidepid=2 seen on NixOS (issue #83)
{ [ "$Switchcontaineruser" = "yes" ] || [ "$Containeruser" != "$Hostuser" ] ; } && {
Expand Down Expand Up @@ -4243,8 +4243,8 @@ create_dockerrc() { # create dockerrc: This script runs as root (or

# --pulseaudio, cookie copy on Windows over tcp only yet.
echo " echo '[ -e $Cshare/pulsecookie ] && {'"
echo " echo mkdir -p \"\$Containeruserhome/.config/pulse\""
echo " echo cp \"$Cshare/pulsecookie\" \"\$Containeruserhome/.config/pulse/cookie\""
echo " echo 'mkdir -p \"\$Containeruserhome/.config/pulse\"'"
echo " echo 'cp \"$Cshare/pulsecookie\" \"\$Containeruserhome/.config/pulse/cookie\"'"
echo " echo '}'"

[ -n "$Newdisplay" ] && echo " echo '[ -e /tmp/.X11-unix/X$Newdisplaynumber ] || ln -s /X$Newdisplaynumber /tmp/.X11-unix'"
Expand Down

0 comments on commit 191a3e0

Please sign in to comment.