# 5. GPU 워크플로 검증

간단한 `nvidia-smi` 워크플로를 실행하여 전체 파이프라인이 정상 동작하는지 확인합니다. 이 테스트가 성공하면:

* OSMO CLI → OSMO Service → Backend Operator → Pod 생성 경로가 정상
* Kai Scheduler가 GPU 리소스를 올바르게 할당
* RuntimeClass nvidia가 GPU 드라이버를 컨테이너에 주입
* ctrl sidecar가 워크플로 상태를 정상 보고

***

### 5.1 GPU 노드 스케일업

GPU 노드그룹은 비용 절감을 위해 0대로 설정되어 있습니다. 워크플로 실행 전에 수동으로 1대를 켭니다.

```bash
aws eks update-nodegroup-config \
  --cluster-name osmo-eks \
  --nodegroup-name gpu-train \
  --scaling-config minSize=0,maxSize=4,desiredSize=1 \
  --region us-west-2
```

노드가 Ready될 때까지 약 2\~3분 기다립니다:

```bash
# -w 옵션으로 실시간 상태 변화를 관찰합니다
kubectl get nodes -l node-role=gpu-train -w
```

`STATUS`가 `Ready`로 바뀌면 Ctrl+C로 종료합니다.

***

### 5.2 GPU 테스트 워크플로 제출

OSMO 워크플로는 YAML 파일로 정의합니다. 가장 간단한 형태의 GPU 워크플로를 실행해봅니다.

```bash
cat > /tmp/gpu-test.yaml <<'EOF'
workflow:
  name: gpu-test
  resources:
    default:
      cpu: 4
      gpu: 1
      memory: 8Gi
      storage: 10Gi
      platform: gpu-train
  tasks:
  - name: gpu-check
    image: nvidia/cuda:12.8.0-base-ubuntu22.04
    command: ["nvidia-smi"]
EOF

osmo workflow submit /tmp/gpu-test.yaml
```

{% hint style="info" %}
`platform: gpu-train`은 Step 4.4에서 정의한 GPU 플랫폼을 지정합니다.
{% endhint %}

***

### 5.3 결과 확인

```bash
# 워크플로 상태 확인 (COMPLETED가 될 때까지 반복)
osmo workflow query gpu-test-1

# 로그 확인 — nvidia-smi 출력이 보여야 합니다
osmo workflow logs gpu-test-1
```

**예상 출력:**

```
Workflow ID : gpu-test-1
Status      : COMPLETED

Task Name    Start Time               Status
=============================================
gpu-check    ...                      COMPLETED
```

로그에서 GPU 정보 확인:

```
NVIDIA L40S | Driver: 570.x | CUDA: 12.8 | 46068MiB
```

{% hint style="warning" %}
**문제 해결:** `SCHEDULING` 상태에서 멈춰 있다면 GPU 노드가 아직 Ready되지 않은 것입니다. `kubectl get nodes -l node-role=gpu-train`으로 확인하세요.
{% endhint %}

***

### Troubleshooting

| 증상                     | 원인             | 해결                                                                                                        |
| ---------------------- | -------------- | --------------------------------------------------------------------------------------------------------- |
| Pod가 `SCHEDULING`에서 멈춤 | GPU 노드가 0대     | 5.1로 스케일업                                                                                                 |
| `QueueDoesNotExist`    | Kai Queue 미생성  | [4. OSMO 구성](/physical-ai-on-aws/physical-ai-on-aws-guide/nvidia-osmo-on-aws/4.-osmo-config.md) Step 4.5  |
| 이미지 풀 실패               | NGC secret 미생성 | [3. OSMO 설치](/physical-ai-on-aws/physical-ai-on-aws-guide/nvidia-osmo-on-aws/3.-osmo-install.md) Step 3.5 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hi-space.gitbook.io/physical-ai-on-aws/physical-ai-on-aws-guide/nvidia-osmo-on-aws/5.-gpu-verification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
