Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Last active March 23, 2024 14:12
Show Gist options
  • Save gilangvperdana/800154dedc01c678c10cd43225659790 to your computer and use it in GitHub Desktop.
Save gilangvperdana/800154dedc01c678c10cd43225659790 to your computer and use it in GitHub Desktop.
Virtualize your NVIDIA

General

If you have a server then you want to virtualize your GPU card, lets follow this workaround.

Tested on

  • Windows Server 2022
  • RHEL
  • Ubuntu

Driver on VMHost

  • Make sure you have installed driver on your VMHost, you can download on nvid.nvidia.com Untitled

Check on VMHost

After driver succesfully installed, you can run this command

nvidia-smi

image

Driver on VM

  • Make sure you have installed NVIDIA vGPU driver on your VM, you can download too on nvid.nvidia.com

Check on VM

After driver succesfully installed, you can run this command

## UNIX VM
nvidia-smi

## Windows
C:\Windows\System32\DriverStore\FileRepository\nvgridsw.*\nvidia-smi

for Windows you can permanent add path to System Variable on this :
System Properties > Advanced > Environment Variables > System Variables -> Path -> Edit > New > insert folder path with nvidia-smi

for /l %g in () do @(nvidia-smi & timeout /t 5)
  • Windows image

  • Unix image

Command for Installation

Have existing NVIDIA?

If you have an existing NVIDIA on your VMHost, makesure your NVIDIA version on your VM same with NVIDIA Cuda version on your VMHost.

You can search the right driver with type nvidia-smi then search the right version with comparing on this link

You can download the right driver on nvid.nvidia.com too.

Bench your GPU (tested on Wserver2022)

Monitoring your GPU

apt install nvtop
nvtop

image

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment