如何讓在 Airflow 上跑的任務使用 GPU 資源 Step 1. 在既有的 Airflow 下新增有 GPU 的 Pool 使用參數 --accelerator 指定 GPU 的規格 gcloud beta container node-pools create "gpu-pool" \ --cluster "mlworkflow-24aeef46-gke" \ --zone "us-east1-b" \ --machine-type "n1-standard-4" \ --accelerator "type=nvidia-tesla-p100,count=1" \ --image-type "COS_CONTAINERD" \ --num-nodes "3" Step 2. 測試 GPU 的功能是否正常 部署一個 Pod 來跑 nvidia-smi 指令 注意: GCP 在建立 GPU 的 Pool 時會自動加上 Taint 資訊如下 spec: taints: - effect: NoSchedule key: nvidia.com/gpu value: present Pod 的 deployment 要加上 Tolerations cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Pod metadata: labels: run: mig-none-example name: mig-none-example spec: tolerations: - key: "nvidia.com/gpu" operator: "Exists" effect: "NoSchedule" containers: - image: nvidia/cuda:11.0-base name: mig-none-example resou...