Skip to content

Commit 03ef492

Browse files
committed
README: document --gpu access
Signed-off-by: Cong Wang <cwang@multikernel.io>
1 parent 521a2ba commit 03ef492

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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
112112
sandlock 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
115124
sandlock run --net-allow api.openai.com:443 -r /usr -r /lib -r /etc -- python3 agent.py
116125

0 commit comments

Comments
 (0)