Announcement

Collapse
No announcement yet.

How to Enable VirtIO-GL/VirGL 3D Acceleration on Proxmox VE 8 Virtual Machines

Collapse
X
Collapse
  •  

  • How to Enable VirtIO-GL/VirGL 3D Acceleration on Proxmox VE 8 Virtual Machines


    VirtIO-GL/VirGL is a feature of the KVM/QEMU/libvirt hypervisor that is used to provide the KVM/QEMU/libvirt virtual machines with 3D acceleration capabilities. The 3D acceleration allows the virtual machines (with a graphical user interface installed) to use the GPU of the host to make the graphical user interface more responsive and capable of running the 3D productivity software or games.
    Proxmox VE uses the KVM/QEMU/libvirt technology for its virtual machines. Starting with Proxmox VE 8, you can use the VirtIO-GL/VirGL 3D acceleration on the Linux virtual machines for a better graphical user experience.

    In this article, we will show you how to enable the VirtIO-GL/VirGL 3D acceleration on Proxmox VE 8 virtual machines.

    Topic of Contents:

    1. Installing the GPU Drivers on Proxmox VE 8
    2. Installing the Required Libraries for VirtIO-GL/VirGL 3D Acceleration on Proxmox VE 8
    3. Enabling the VirtIO-GL/VirGL GPU 3D Acceleration on a Proxmox VE 8 Virtual Machine
    4. Testing If the VirtIO-GL/VirGL GPU 3D Acceleration Is Working on Proxmox VE Virtual Machine
    5. Conclusion

    Installing the GPU Drivers on Proxmox VE 8

    For the VirtIO-GL/VirGL 3D acceleration to work on Proxmox VE 8, you must have the following:
    • An installed GPU on your Proxmox VE 8 server
    • Installed GPU drivers on your Proxmox VE 8 server

    The Intel GPU drivers should be installed on your Proxmox VE 8 server by default if you have the Intel iGPU (integrated GPU) available. You don’t need any manual intervention.

    If you have an NVIDIA GPU on your Proxmox VE 8 server and you want to use it for VirtIO-GL/VirGL, you must download the NVIDIA GPU drivers manually and install them yourself on your Proxmox VE 8 server. If you need any assistance in installing the NVIDIA GPU drivers on your Proxmox VE 8 server, read this article.

    If you have an AMD GPU on your Proxmox VE 8 server, you may also need to install the required GPU drivers on your Proxmox VE 8 server. We don’t have an AMD GPU. So, we haven’t tested it. But if you’re using an AMD APU (AMD processor with integrated GPU), the GPU drivers should be installed by default as far as we know. We will update this article if we get a chance to test it.

    Installing the Required Libraries for VirtIO-GL/VirGL 3D Acceleration on Proxmox VE 8

    For the VirtIo-GL/VirGL 3D acceleration to work on Proxmox VE 8 virtual machines, you must have the LibEGL and libGL libraries installed on your Proxmox VE 8 server. The LibEGL and libGL libraries are available in the official package repositories of Proxmox VE 8. So, they are very easy to install.

    First, navigate to Datacenter > pve > Shell to access the Proxmox VE shell of your Proxmox VE 8 server and run the following command to update the Proxmox VE package database cache:

    $ apt update




    To install the LibEGL and LibGL libraries on Proxmox VE 8 server, run the following command:

    $ apt install -y libegl1 libgl1


    The LibEGL and LibGL libraries should be installed. In our case, they are already installed.



    Enabling the VirtIO-GL/VirGL GPU 3D Acceleration on a Proxmox VE 8 Virtual Machine

    To enable the VirtIO-GL/VirGL 3D acceleration on a Proxmox VE 8 virtual machine, navigate to the “Hardware” section of the virtual machine[1]. Double-click (LMB) on “Display”[2] and select “VirGL GPU” from the “Graphics card” dropdown menu[3].

    By default, VirGL GPU uses only 256 MB of memory/VRAM (at max) from the installed GPU on your Proxmox VE server when the virtual machine is running. This is enough for most cases. If you want to allocate more memory/VRAM to the virtual machine, type it in the “Memory (MiB)” section[4].

    Once you’re done, click on “OK”[5].



    VirtIO-GL/VirGL should be enabled for your desired Proxmox VE 8 virtual machine.



    Now, you can start the virtual machine as usual.



    If VirtIO-GL/VirGL is enabled on the Proxmox VE 8 virtual machine successfully, the virtual machine will start without any error and the screen of the virtual machine will be displayed on the Proxmox VE 8 web interface.



    Testing If the VirtIO-GL/VirGL GPU 3D Acceleration Is Working on Proxmox VE Virtual Machines

    You can navigate to Settings > About on the GNOME desktop environment to find the “Graphics” information of the virtual machine. As you can see, the virtual machine is using the NVIDIA RTX 4070 that we have on our Proxmox VE 8 server via VirIO-GL/VirGL. On other desktop environments, you will find a similar information on the “Settings” app.



    To test whether VirIO-GL/VirGL does any 3D improvements on Proxmox VE 8 virtual machines, we create two Ubuntu 22.04 LTS virtual machines on our Proxmox VE 8 server. We enable VirtIO-GL/VirGL on one of them and use the default display settings (3D acceleration disabled) on the other one. Then, we run the “glmark2” test and compare the results.

    If you want to perform the same tests, you can install “glmark2” on your Ubuntu 22.04 LTS virtual machine with the following commands:

    $ sudo apt update



    $ sudo apt install glmark2 -y


    While the “glmark2” benchmark is running, the Proxmox VE 8 virtual machine that has the VirtIO-GL/VirGL 3D acceleration enabled consumes less CPU resources (Figure 1) compared to the one which has the VirtIO-GL/VirGL 3D acceleration disabled (Figure 2). The VirtIO-GL/VirGL 3D acceleration that disables the Proxmox VE 8 virtual machines CPU usage is almost 100% as you can see in the following screenshot (figure 2). High CPU usage means that 3D is simulated via CPU instead of being accelerated via GPU. So, the VirtIO-GL/VirGL 3D acceleration improves the 3D performance of Proxmox VE 8 virtual machines and makes the user interface of the Linux graphical desktop environment more responsive.



    Figure 1: CPU usage while running the “glmark2” benchmark on the VirtIO-GL/VirGL 3D acceleration that is enabled on Proxmox VE 8 virtual machine



    Figure 2: CPU usage while running the “glmark2” benchmark on the VirtIO-GL/VirGL 3D acceleration that is disabled on Proxmox VE 8 virtual machine

    The “glmark2” score proves that the VirIO-GL/VirGL 3D acceleration really improves the overall graphical user experience of the Proxmox VE 8 virtual machines. On the Proxmox VE 8 virtual machine with the VirtIO-GL/VirGL 3D acceleration enabled, the “glmark2” score is 2167 (figure 3) and only 163 on the one with the disabled VirtIO-GL/VirGL 3D acceleration (figure 4). That’s a huge difference.



    Figure 3: The “glmark2” score of the VirtIO-GL/VirGL 3D acceleration enabled on Promox VE 8 virtual machine when NVIDIA RTX 4070 GPU and AMD Ryzen 3900X CPU (4 cores allocated to the virtual machine) are used on the Promox VE 8 server



    Figure 4: The “glmark2” score of the VirtIO-GL/VirGL 3D acceleration disabled on Promox VE 8 virtual machine when AMD Ryzen 3900X CPU (4 cores allocated to the virtual machine) is used on the Promox VE 8 server

    You can also verify that the Proxmox VE 8 virtual machine is using the GPU from your Proxmox VE 8 server for 3D acceleration via VirIO-GL/VirGL if you’re using an NVIDIA GPU on the Proxmox VE 8 server.

    To find the programs that are using the NVIDIA GPU of your Proxmox VE 8 server, open the Proxmox VE shell and run the “nvidia-smi” command. As you can see, one of the Proxmox VE 8 virtual machine consumes about 194 MiB of VRAM from the NVIDIA RTX 4070 GPU of our Proxmox VE 8 server for 3D acceleration.



    Conclusion

    In this article, we showed you how to install the required libraries on your Proxmox VE 8 server to get the VirtIO-GL/VirGL 3D acceleration working. We also showed you how to configure/enable the VirtIO-GL/VirGL 3D acceleration on a Proxmox VE 8 virtual machine. We showed you how to verify whether the VirtIO-GL/VirGL 3D acceleration is working on Proxmox VE 8 virtual machines as well. Finally, we benchmarked the VirtIO-GL/VirGL GPU of a Proxmox VE 8 virtual machine using “glmark2” to show you how it performs compared to a Proxmox VE 8 virtual machine with the VirtIO-GL/VirGL 3D acceleration disabled.





    More...
      Posting comments is disabled.

    Categories

    Collapse

    Article Tags

    Collapse

    There are no tags yet.

    Latest Articles

    Collapse

    • 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
    • Ubuntu vs Debian: Linux Distributions Compared Deep Dive
      by Kasimba
      Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide you on the key differences between them from perspective of both corporate enterprise and personal productivity or pleasure usage. After reading this blog post you should be in a better position to decide to select Ubuntu or Debian.
      Stewardship, Licensing, Community and Cost

      Where as Debian is 100% fully committed to free software as defined by the Debian Free Software Guidelines, Ubuntu is created...
      11-17-2024, 08:30 PM
    • Debian Backup and Recovery Solutions: Safeguard Your Data with Confidence
      by Kasimba



      by George Whittaker


      Introduction

      In the digital age, data loss is a critical concern, and effective backup and recovery systems are vital for any Debian system administrator or user. Debian, known for its stability and suitability in enterprise, server, and personal computing environments, offers a multitude of tools for creating robust backup and recovery solutions. This guide will explore these solutions,...
      11-13-2024, 05:30 PM
    Working...
    X