# Manage vGPU

#### Prepare the system

* **OS:** Ubuntu24.04
* **GPU:** Nvidia RTX Pro 6000 blackwell Ada(96 GB)
* **Nvidia Driver**: 590.48.01
* **Cuda** **Toolkit:** 13.1
* **Docker**

#### VM Setting

1. ตรวจสอบว่า VM เห็น **GPU**

```
lspci | grep -i nvidia
```

> ต้องเห็น NVIDIA Corporation Device 2bb5 (RTX PRO 6000 Blackwell)

2. ตรวจสอบว่า **Nvidia driver** ทำงานได้

```
nvidia-smi
```

<figure><img src="/files/U05UsmeAigDo5qMS3gF5" alt=""><figcaption></figcaption></figure>

3. เปิด **MIG mode**

```
# เปิด persistence mode
nvidia-smi -i 0 -pm 1
# เปิด MIG mode
nvidia-smi -i 0 -mig 1
reboot
```

4. สร้าง **MIG Instance**

```
# สร้าง 4 instances x 1g.24gb (23GB VRAM ต่อตัว)
nvidia-smi mig -i 0 -cgi 1g.24gb,1g.24gb,1g.24gb,1g.24gb -C
# ตรวจสอบ
nvidia-smi mig -lgi
nvidia-smi -L
```

<figure><img src="/files/7qrKEAZHT7ttPkK9dO0x" alt=""><figcaption></figcaption></figure>

5. ตั้งค่า **MIG** ให้ **auto-start** หลัง reboot

```
cat > /etc/systemd/system/nvidia-mig-enable.service << 'EOF'
[Unit]
Description=Enable NVIDIA MIG mode
After=systemd-modules-load.service
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/nvidia-smi -i 0 -pm 1
ExecStart=/usr/bin/nvidia-smi -i 0 -mig 1
ExecStart=/usr/bin/nvidia-smi mig -i 0 -cgi 1g.24gb,1g.24gb,1g.24gb,1g.24gb -C
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
EOF
```

```
systemctl daemon-reload
systemctl enable nvidia-mig-enable.service
```


---

# 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://readyidc.gitbook.io/readyidc-docs/gpu-as-a-service/manage-vgpu.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.
