File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,15 @@ sandlock run -i -r /usr -r /lib -r /lib64 -r /bin -r /etc -w /tmp -- /bin/sh
111111# Resource limits + timeout
112112sandlock run -m 512M -P 20 -t 30 -- ./compute.sh
113113
114+ # GPU access (NVIDIA): `--gpu all` for every GPU, or indices like `0,2`.
115+ # Selection is a hard Landlock boundary — only the chosen /dev/nvidiaN nodes
116+ # are openable, so a sandbox given `--gpu 0` cannot touch other GPUs. The
117+ # NVIDIA userspace also needs the driver libraries readable and writes thread
118+ # names under /proc/self/task.
119+ sandlock run --gpu 0 \
120+ -r /usr -r /lib -r /lib64 -r /etc -r /sys -r /proc -w /proc/self/task \
121+ -- python3 train.py
122+
114123# Outbound allowlist — restrict to one host on one port
115124sandlock run --net-allow api.openai.com:443 -r /usr -r /lib -r /etc -- python3 agent.py
116125
You can’t perform that action at this time.
0 commit comments