Announcement

Collapse
No announcement yet.

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

Collapse
X
Collapse
  •  

  • 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.





    More...
      Posting comments is disabled.

    Categories

    Collapse

    Article Tags

    Collapse

    There are no tags yet.

    Latest Articles

    Collapse

    • Fortifying Linux Web Applications: Mastering OWASP ZAP and ModSecurity for Optimal Security
      by Kasimba



      by George Whittaker


      Introduction

      In an increasingly interconnected digital world, web applications are the backbone of online services. With this ubiquity comes a significant risk: web applications are prime targets for cyberattacks. Ensuring their security is not just an option but a necessity. Linux, known for its robustness and adaptability, offers a perfect platform for deploying secure web applications....
      11-29-2024, 05:12 PM
    • Harnessing Quantum Potential: Quantum Computing and Qiskit on Ubuntu
      by Kasimba



      by George Whittaker


      Introduction

      Quantum computing, a revolutionary paradigm, promises to solve problems that are computationally infeasible for classical systems. By leveraging the peculiar principles of quantum mechanics—superposition, entanglement, and quantum interference—quantum computing has emerged as a transformative force across industries. From cryptography and drug discovery to optimization and...
      11-27-2024, 06:22 PM
    • Using MAXQDA for Qualitative Data Analysis on Linux
      by Kasimba



      by George Whittaker


      Introduction

      Qualitative data analysis (QDA) is a cornerstone of research across various fields, from social sciences to marketing. It involves uncovering patterns, themes, and meanings within non-numerical data such as interviews, focus groups, and textual narratives. In this era of digital tools, MAXQDA stands out as a premier software solution for QDA, empowering researchers to organize...
      11-21-2024, 11:31 PM
    • HAProxy on Ubuntu: Load Balancing and Failover for Resilient Infrastructure
      by Kasimba



      by german.suarez


      Introduction

      In today’s fast-paced digital landscape, ensuring the availability and performance of applications is paramount. Modern infrastructures require robust solutions to distribute traffic efficiently and maintain service availability even in the face of server failures. Enter HAProxy, the de facto standard for high-performance load balancing and failover.


      This article...
      11-21-2024, 03:00 PM
    • Providing a license for package sources
      by Kasimba
      Arch Linux hasn't had a license for any package sources (such as PKGBUILD files) in the past, which is potentially problematic. Providing a license will preempt that uncertainty.

      In RFC 40 we agreed to change all package sources to be licensed under the very liberal 0BSD license. This change will not limit what you can do with package sources. Check out the RFC for more on the rationale and prior discussion.

      Before we make this change, we will provide contributors with...
      11-19-2024, 09:21 AM
    • Linux Binary Analysis for Reverse Engineering and Vulnerability Discovery
      by Kasimba



      by George Whittaker


      Introduction

      In the world of cybersecurity and software development, binary analysis holds a unique place. It is the art of examining compiled programs to understand their functionality, identify vulnerabilities, or debug issues—without access to the original source code. For Linux, which dominates servers, embedded systems, and even personal computing, the skill of binary analysis is...
      11-18-2024, 07:10 PM
    Working...
    X