Skip to content

Commit 0e1759c

Browse files
panpan0000bigPYJ1151hmellor
authored
[docs] add SYS_NICE cap & security-opt for docker/k8s (#24017)
Signed-off-by: Peter Pan <[email protected]> Signed-off-by: Peter Pan <[email protected]> Co-authored-by: Li, Jiang <[email protected]> Co-authored-by: Harry Mellor <[email protected]>
1 parent e66ed3e commit 0e1759c

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

docs/getting_started/installation/cpu.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,35 @@ vLLM CPU supports data parallel (DP), tensor parallel (TP) and pipeline parallel
194194
- Both of them require `amx` CPU flag.
195195
- `VLLM_CPU_MOE_PREPACK` can provides better performance for MoE models
196196
- `VLLM_CPU_SGL_KERNEL` can provides better performance for MoE models and small-batch scenarios.
197+
198+
### Why do I see `get_mempolicy: Operation not permitted` when running in Docker?
199+
200+
In some container environments (like Docker), NUMA-related syscalls used by vLLM (e.g., `get_mempolicy`, `migrate_pages`) are blocked/denied in the runtime's default seccomp/capabilities settings. This may lead to warnings like `get_mempolicy: Operation not permitted`. Functionality is not affected, but NUMA memory binding/migration optimizations may not take effect and performance can be suboptimal.
201+
202+
To enable these optimizations inside Docker with the least privilege, you can follow below tips:
203+
204+
```bash
205+
docker run ... --cap-add SYS_NICE --security-opt seccomp=unconfined ...
206+
207+
# 1) `--cap-add SYS_NICE` is to address `get_mempolicy` EPERM issue.
208+
209+
# 2) `--security-opt seccomp=unconfined` is to enable `migrate_pages` for `numa_migrate_pages()`.
210+
# Actually, `seccomp=unconfined` bypasses the seccomp for container,
211+
# if it's unacceptable, you can customize your own seccomp profile,
212+
# based on docker/runtime default.json and add `migrate_pages` to `SCMP_ACT_ALLOW` list.
213+
214+
# reference : https://docs.docker.com/engine/security/seccomp/
215+
```
216+
217+
Alternatively, running with `--privileged=true` also works but is broader and not generally recommended.
218+
219+
In K8S, the following configuration can be added to workload yaml to achieve the same effect as above:
220+
221+
```yaml
222+
securityContext:
223+
seccompProfile:
224+
type: Unconfined
225+
capabilities:
226+
add:
227+
- SYS_NICE
228+
```

docs/getting_started/installation/cpu/arm.inc.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ docker run --rm \
4848
--dtype=bfloat16 \
4949
other vLLM OpenAI server arguments
5050
```
51+
52+
!!! tip
53+
An alternative of `--privileged=true` is `--cap-add SYS_NICE --security-opt seccomp=unconfined`.
54+
5155
# --8<-- [end:build-image-from-source]
5256
# --8<-- [start:extra-information]
5357
# --8<-- [end:extra-information]

docs/getting_started/installation/cpu/s390x.inc.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ docker run --rm \
8989
other vLLM OpenAI server arguments
9090
```
9191

92+
!!! tip
93+
An alternative of `--privileged true` is `--cap-add SYS_NICE --security-opt seccomp=unconfined`.
94+
9295
# --8<-- [end:build-image-from-source]
9396
# --8<-- [start:extra-information]
9497
# --8<-- [end:extra-information]

docs/getting_started/installation/cpu/x86.inc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ docker build -f docker/Dockerfile.cpu \
4444
# Launching OpenAI server
4545
docker run --rm \
4646
--security-opt seccomp=unconfined \
47+
--cap-add SYS_NICE \
4748
--shm-size=4g \
4849
-p 8000:8000 \
4950
-e VLLM_CPU_KVCACHE_SPACE=<KV cache space> \

0 commit comments

Comments
 (0)