网站首页 文章专栏 06GPU调度.md
06GPU调度.md
创建于:2021-07-04 07:51:43 更新于:2024-11-21 12:50:16 羽瀚尘 392

隔离调用

kind: Pod
metadata:
  name: gpu-pod
spec:
  containers:
    - name: cuda-container
      image: nvidia/cuda:9.0-devel
      resources:
        limits:
          nvidia.com/gpu: 1 # requesting 1 GPU
    - name: digits-container
      image: nvidia/digits:6.0
      resources:
        limits:
          nvidia.com/gpu: 1 # requesting 1 GPU
  • GPUs 只能通过 limits 选项指定
  • GPUs 是严格隔离的,不同容器之间不能共享
  • 每个容器可以请求一个或多个 GPUs
  • GPUs 只能正整数级请求

共享调用

实测发现,只要将resources字段去掉即可

kind: Pod
metadata:
  name: gpu-pod
spec:
  containers:
    - name: cuda-container
      image: nvidia/cuda:9.0-devel
    - name: digits-container
      image: nvidia/digits:6.0

参考: