For the complete documentation index, see llms.txt. This page is also available as Markdown.

Use Multi-Instance GPU (MIG)

This guide walks you through configuring and using Multi-Instance GPU (MIG) directly on a bare-metal vServer with NVIDIA H100 — partitioning a single physical GPU into multiple isolated MIG instances, each with dedicated VRAM and Streaming Multiprocessors. Docker containers are assigned to individual MIG instances for complete workload isolation.

MIG architecture on bare-metal vServer — GPU 0 partitioned into 2 MIG instances, GPU 1 remains full GPU
MIG architecture on vServer: Docker + NVIDIA Container Toolkit manages both MIG GPU (2x 3g.40gb) and non-MIG GPU (full 80 GB) on the same machine

Prerequisites

  • A bare-metal vServer with an NVIDIA H100 GPU (or Ampere/Hopper or newer — MIG requires Ampere architecture or later).

  • NVIDIA Driver ≥ 525 installed on the server. Verify with nvidia-smi.

  • NVIDIA Container Toolkit installed (required to run Docker containers with GPU access).

  • Docker installed and running.

  • sudo access on the server.


MIG Profiles Reference (H100 80GB)

Choose the profile that fits your workload before creating MIG instances. The H100 80GB supports 7 profiles:

Profile
VRAM
Streaming Multiprocessors (SM)
Max per GPU
DEC

1g.10gb

9.75 GB

16

7

1

1g.10gb+me

9.75 GB

16

1

1

1g.20gb

19.62 GB

26

4

1

2g.20gb

19.62 GB

32

3

2

3g.40gb

39.50 GB

60

2

3

4g.40gb

39.50 GB

64

1

4

7g.80gb

79.25 GB

132

1

7

MIG profiles available on H100 80GB
All 7 MIG profiles available on H100 80GB HBM3 — inspect with nvidia-smi mig -lgip

The 3g.40gb profile is well-suited for running AI models in the 7B–30B range (BF16). Measured performance: 16.27 req/s and 18,739 tokens/s with Qwen2.5-7B-Instruct on a single 3g.40gb instance.


Step 1: Enable MIG on the GPU

Enable MIG mode on GPU 0 (replace -i 0 with your target GPU index):

Verify MIG is enabled:

Expected output:

Terminal output confirming MIG is enabled
MIG successfully enabled on GPU 0 — mig.mode.current = Enabled

Step 2: List Available MIG Profiles

This command displays all 7 profiles along with VRAM, SM count, and the maximum number of instances that can be created per GPU.

MIG profile list from nvidia-smi mig -lgip
nvidia-smi mig -lgip lists all available profiles and the maximum instance count for each

Step 3: Create MIG Instances

Create 2 MIG instances using the 3g.40gb profile on GPU 0:

Expected output:

Verify the newly created MIG instances:

Each instance has 40,448 MiB VRAM and 60 SM, with a unique UUID:

MIG Device
GI ID
CI ID
UUID
VRAM
SM

Device 0

1

0

MIG-db487433-...

40,448 MiB

60

Device 1

2

0

MIG-1ee682bf-...

40,448 MiB

60

2 MIG instances created with distinct UUIDs
2 MIG instances of type 3g.40gb created successfully — each with its own UUID and VRAM allocation

Step 4: Run a Docker Container on a Single MIG Instance

Assign a container to a specific MIG instance using the device=<GPU_index>:<MIG_instance_index> notation:

Each container sees only the single MIG device it was assigned — complete isolation confirmed:

Each container sees only one MIG device
Containers on device=0:0 and device=0:1 see different MIG UUIDs — isolation confirmed

Step 5: Run 2 Containers in Parallel

Test that 2 containers run simultaneously on 2 MIG instances without conflict:

Expected output — 2 MIG devices running in parallel with independent memory:

2 containers running in parallel on 2 MIG instances
2 containers running simultaneously on 2 MIG instances — no conflict, fully independent memory

(Advanced) Step 6: Run vLLM on a MIG Instance

The 3g.40gb MIG instance (40 GB VRAM) is capable of running AI models in the 7B–30B range. Example with Qwen2.5-7B-Instruct via vLLM:

Start the vLLM server:

Wait for the server to be ready, then test:

Measured results on MIG 3g.40gb:

Metric
Value

vLLM version

0.23.0

Attention backend

FlashAttention v3

VRAM used

34,432 MiB / 40,448 MiB (85%)

KV cache

329,168 tokens

Throughput

16.27 req/s

Total tokens/s

18,739 tokens/s

API response

HTTP 200 ✅

vLLM running on MIG instance 0:0 with Qwen2.5-7B-Instruct
vLLM serving Qwen2.5-7B-Instruct on MIG 3g.40gb — 34 GB VRAM in use, API responding normally

Run throughput benchmark:

vLLM throughput benchmark on MIG 3g.40gb
Benchmark results: 16.27 req/s, 18,739 tokens/s on MIG 3g.40gb with Qwen2.5-7B-Instruct

Starting from vLLM 0.23.0, the benchmark command has changed. Use: python3 -m vllm.entrypoints.cli.main bench throughput

Do not use the old command: python -m vllm.entrypoints.benchmark_throughput (deprecated).


Cleanup

Remove MIG instances and disable MIG mode when done:

Expected output after cleanup:


Result

After completing these steps, you can partition an H100 80GB GPU into multiple MIG instances and assign each Docker container to a dedicated instance:

Example configuration
Docker device
VRAM
SM

2x MIG 3g.40gb

device=0:0, device=0:1

40 GB / instance

60

GPU 1 non-MIG

device=1

80 GB

132

Key notes:

  • MIG mode is not persistent after reboot — re-enable after each server restart.

  • Each idle MIG instance uses only ~44 MiB overhead.

  • GPU 1 operates completely independently from GPU 0 throughout.

I want to...
Go to

View available GPU flavors on vServer

Use MIG on VKS (Kubernetes)

Last updated