Skip to content

Instantly share code, notes, and snippets.

@knwng
Created March 17, 2023 07:00
Show Gist options
  • Save knwng/8313ef87bfc9c39ff9b24df798cfe106 to your computer and use it in GitHub Desktop.
Save knwng/8313ef87bfc9c39ff9b24df798cfe106 to your computer and use it in GitHub Desktop.
Run Docker with GPU loaded and necessary permissions for debug
#!/bin/bash
set -euxo pipefail
IMAGE=''
NAME=''
docker run -dt \
--shm-size=32gb \
--gpus=all \
--privileged \
--restart=always \
--hostname="${NAME}" \
--cap-add=SYS_ADMIN \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--name "${NAME}" \
"${IMAGE}" \
/bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment