How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm)

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. Sponsored
  3. Creating an Ubuntu 24.04 LTS Proxmox VE VM
  4. Passthrough an NVIDIA GPU to the Ubuntu 24.04 LTS Proxmox VE VM
  5. Disabling the Virtual GPU of the Ubuntu 24.04 LTS Proxmox VE VM
  6. Passthrough a USB Keyboard and Mouse to the Proxmox VE VM
  7. Starting the Ubuntu 24.04 LTS Proxmox VE VM
  8. Installing NVIDIA GPU Driver on the Ubuntu 24.04 LTS Proxmox VE VM
  9. 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.

See also  How to Install LibreNMS on Ubuntu

 

 

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.

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 1

 

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.

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 2

 

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

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 3

 

 

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.

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 4

Sponsored

 

 

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.

See also  Canonical Joins Eclipse Adoptium Working Group to Strengthen Commitment to Open Source Java Runtimes

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 5

 

 

 

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.

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 6

 

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.

How to passthrough an nvidia gpu on a proxmox ve ubuntu 24. 04 lts virtual machine (vm) 7

 

 

 

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.


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply