跳转到文档内容
版本:下一个

按 UUID 将任务分配到指定 GPU

要让 Pod 只运行在指定 GPU 上,在 Pod 注解中设置 amd.com/use-gpu-uuid。UUID 可在节点注解 hami.io/node-amd-register 中查到。

apiVersion: v1
kind: Pod
metadata:
name: amd-gpu-uuid-to-use
annotations:
amd.com/use-gpu-uuid: "<GPU UUID>" # replace with comma-separated UUIDs from the node annotation hami.io/node-amd-register; run only on these GPUs
spec:
containers:
- name: rocm
image: rocm/dev-ubuntu-24.04:7.2.4
command: ["bash", "-c", "sleep infinity"]
securityContext:
# runs as the image's user (root) on purpose: GPU device access needs the node's video and render group ids, which differ per node. For non-root add runAsUser and supplementalGroups for those groups.
allowPrivilegeEscalation: false
resources:
limits:
amd.com/gpu: 1
amd.com/gpumem: 4096
CNCFHAMi 是 CNCF 孵化项目