Blog

How to Passthrough an NVIDIA GPU on a Proxmox VE Ubuntu 24.04 LTS Virtual Machine (VM)

If you passthrough an NVIDIA GPU to an Ubuntu 24.04 LTS Proxmox VE virtual machine (VM), you get many benefits, such as:

  • Stream the display of the VM directly on the monitor connected to the NVIDIA GPU.

  • Add a USB keyboard and a mouse to the VM and use the VM like a real desktop computer.

  • Get near-native 3D performance on the VM.

 

In this article, I will show you how to passthrough an NVIDIA GPU to an Ubuntu 24.04 LTS Proxmox VE VM and use the VM just like a real desktop computer.

 

 

 

Table of Contents

  1. Configuring Proxmox VE for NVIDIA GPU Passthrough
  2. Creating an Ubuntu 24.04 LTS Proxmox VE VM
  3. Passthrough an NVIDIA GPU to the Ubuntu 24.04 LTS Proxmox VE VM
  4. Disabling the Virtual GPU of the Ubuntu 24.04 LTS Proxmox VE VM
  5. Passthrough a USB Keyboard and Mouse to the Proxmox VE VM
  6. Starting the Ubuntu 24.04 LTS Proxmox VE VM
  7. Installing NVIDIA GPU Driver on the Ubuntu 24.04 LTS Proxmox VE VM
  8. Conclusion

 

 

Configuring Proxmox VE for NVIDIA GPU Passthrough

Before you can passthrough an NVIDIA GPU to your Proxmox VE VM, you must configure Proxmox VE for GPU and PCI/PCIE passthrough.

I have written a detailed guide on configuring Proxmox VE for GPU and PCI/PCIE passthrough. You can read it here.

 

 

Creating an Ubuntu 24.04 LTS Proxmox VE VM

Once you’ve set up your Proxmox VE server for NVIDIA GPU passthrough, create a new Ubuntu 24.04 LTS VM if you don’t have one already.

 

 

Passthrough an NVIDIA GPU to the Ubuntu 24.04 LTS Proxmox VE VM

To passthrough an NVIDIA GPU to your Proxmox VE Ubuntu 24.04 LTS VM:

  1. Open the VM in the Proxmox VE web management interface

  2. Navigate to the Hardware section of the VM

  3. Click on Add > PCI Device.

 

From the Add: PCI Device window:

  1. Select Raw Device.

  2. Select your NVIDIA GPU from the Device dropdown menu. I am selecting the NVIDIA GeForce RTX 4070 GPU for the passthrough.

  3. Check All Functions.

  4. Check ROM-Bar.

  5. Check PCI-Express.

  6. CheckPrimary GPU.

  7. Click on Add to save the changes.

 

The NVIDIA GPU should be added to the Ubuntu 24.04 LTS Proxmox VE VM.

 

 

Disabling the Virtual GPU of the Ubuntu 24.04 LTS Proxmox VE VM

For NVIDIA GPU passthrough to work on Ubuntu 24.04 LTS Proxmox VE VM, you must disable the virtual GPU of the VM. Once the virtual GPU is removed, you won’t see the display of the VM on the Proxmox VE console, instead the display of the VM will be streamed on the monitor connected to the GPU that you’ve passed to the VM.

To disable the virtual GPU of the Proxmox VE Ubuntu 24.04 LTS VM:

  1. Navigate to the Hardware section of the VM.

  2. Select the Display hardware and click on Edit.

  3. Set Graphic card to none.

  4. Click on OK to save the changes.

 

 

Passthrough a USB Keyboard and Mouse to the Proxmox VE VM

You should also passthrough a USB keyboard and mouse to the Ubuntu 24.04 LTS VM so that you can use the VM like a real computer once everything is configured.

You can passthrough a USB keyboard and mouse to the Ubuntu VM in the following ways:

  • Passthrough a wireless USB keyboard and mouse combo. In that case, passing a single USB device to the VM is enough.

  • Passthrough USB wired/wireless keyboard and mouse separately. In that case, you have to pass the USB keyboard and mouse devices separately on the VM.

 

 

To add a USB device to the Ubuntu 24.04 LTS Proxmox VE VM:

  1. Navigate to the Hardware section of the VM.

  2. Click on Add > USB Device. A new window should be displayed.

  3. Select Use USB Vendor/Device ID.

  4. Select your USB device from the Choose Device dropdown menu.

  • Wired/Wireless USB keyboard.

  • Wired/Wireless USB mouse.

  • Wireless keyboard and mouse combo USB dongle.

  1. Click on Add to save the changes.

NOTE: I have added the USB dongle of my Rapoo wireless keyboard and mouse combo to the Ubuntu 24.04 LTS VM. If you have separate wired/wireless USB keyboard and mouse, you will need to follow the procedures twice: once for adding the USB keyboard and once for the USB mouse.

 

 

 

Starting the Ubuntu 24.04 LTS Proxmox VE VM

Once you’ve passed the NVIDIA GPU and a USB keyboard and mouse to Ubuntu 24.04 LTS Promox VE VM, click on Start to start the VM.

 

The Ubuntu 24.04 LTS VM’s display should be streamed on the monitor connected to the NVIDIA GPU that you’ve passed to the VM. It verifies that the NVIDIA GPU passthrough on the Ubuntu 24.04 LTS Proxmox VE VM is successful.

 

 

 

Installing NVIDIA GPU Driver on the Ubuntu 24.04 LTS Proxmox VE VM

Now that the NVIDIA GPU passthrough is working on the Ubuntu 24.04 LTS Proxmox VE VM, you should install the NVIDIA GPU driver on the Ubuntu 24.04 LTS VM.

I have written a detailed article on installing the NVIDIA GPU driver on Ubuntu 24.04 LTS. I recommend you read it.

 

 

 

Conclusion

In this article, I have covered the following topics:

  • (Linked) Configuring Proxmox VE for PCI/PCI-E and NVIDIA GPU passthrough.

  • (Linked) Creating an Ubuntu 24.04 LTS VM on Proxmox VE.

  • Adding the NVIDIA GPU on the Proxmox VE Ubuntu 24.04 LTS VM.

  • Disabling the virtual GPU of the Ubuntu VM.

  • Adding USB keyboard and mouse to the Ubuntu VM.

  • Starting the Ubuntu VM and check if NVIDIA GPU passthrough is successful.

  • (Linked) Installing the official NVIDIA GPU driver on the Ubuntu 24.04 LTS VM for the best GPU performance.


Source link

Related Articles

Back to top button
close