SHARE
TWEET

Untitled

a guest Aug 17th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2.  
  3. XSOCK=/tmp/.X11-unix
  4. XAUTH=/tmp/.docker.xauth
  5. touch $XAUTH
  6. xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
  7.  
  8. ARG1=${1:-0}
  9. ARG2=${2:-9999}
  10. NV_GPU=$ARG1
  11.  
  12. nvidia-docker run \
  13. --shm-size 8G \
  14. -p $ARG2:$ARG2 \
  15. --env="DISPLAY" \
  16. --env="XAUTHORITY=${XAUTH}" \
  17. --env="QT_X11_NO_MITSHM=1" \
  18. --volume=$XSOCK:$XSOCK:rw \
  19. --volume=$XAUTH:$XAUTH:rw \
  20. --device=/dev/video0:/dev/video0 \
  21. -it --rm \
  22. --name <container_name> \
  23. $(whoami)/<project_name>:<env> bash
  24.  
  25. #--mount type=bind,source="$PWD",target=/app \
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top