Skip to main content
Version: 1.2.0

GPU Acceleration

KasmVNC utilizes its own Xorg server with a virtual frame buffer running in Linux userspace. This means a KasmVNC session is not identical to a standard desktop X session and also that KasmVNC can be run on a headless Linux server. In order to leverage a GPU for OpenGL and 3D applications, specific flags need to be set in the KasmVNC Configuration YAML or using command line flags.

Applications that use a GPU for compute like transcoding or Deep Learning do not require any additional configuration, these will run normally without any of these flags being passed and are not limited by the compatibilty notes below.

Compatibility and DRI3​

Driver Support​

As a general rule of thumb DRI3 support is limited to fully open source drivers on x86_64 platforms. This includes:

DriverDescription
Inteli965 and i915 drivers for Intel iGPU chipsets
AMDAMDGPU, Radeon, and ATI drivers for AMD dedicated or APU chipsets
NVIDIAnouveau2 drivers only, closed source NVIDIA drivers lack DRI3 support
Most AArch64 based GPUs should also work given they have DRI3 compatibilty and the driver is installed.

Tested Operating Systems​

The following operating systems have been confirmed functional using open source GPU drivers with DRI3 and releases from KasmVNC Releases:

OSHomePage
AlmaLinux 8https://almalinux.org/
AlmaLinux 9https://almalinux.org/
Alpine 3.17https://www.alpinelinux.org/
Alpine 3.18https://www.alpinelinux.org/
Debian Bullseyehttps://www.debian.org/
Debian Bookwormhttps://www.debian.org/
Fedora 37https://getfedora.org/
Fedora 38https://getfedora.org/
Kali Linux Rollinghttps://www.kali.org/
openSUSE Leap 15https://www.opensuse.org/
Oracle Linux 8https://www.oracle.com/linux/
Oracle Linux 9https://www.oracle.com/linux/
ParrotOS 5https://www.parrotsec.org/
Rocky Linux 8https://rockylinux.org/
Rocky Linux 9https://rockylinux.org/
Ubuntu Bionichttps://ubuntu.com/
Ubuntu Focalhttps://ubuntu.com/
Ubuntu Jammyhttps://ubuntu.com/

Desktop Compositing​

Currently Desktop compositing is not supported using DRI3, in general we recommend disabling desktop compositing when using KasmVNC. Most Desktops have an option to disable this in their window manager settings with the exception of GNOME meaning GNOME is forced to consume more CPU leveraging LLVMpipe for rendering.

Desktop EnvironmentCompositing Setting
XFCESettings Manager > Window Manager Tweaks > Compositor > Enable display compositing
KDESystem Settings > Display and Monitor > Compositor > Enable on startup
MATESystem > Control Center > Windows > Enable software compositing window manager
GNOMEDisabling not supported

Enabling GPU Acceleration in KasmVNC​

When starting KasmVNC the cli flag -hw3d will enable DRI3 support and use the GPU /dev/dri/renderD128 by default. For most users this should be sufficiant. If the system has multiple GPUs you may need to manually select a GPU using the -drinode option. IE:

vncserver -hw3d -drinode /dev/dri/renderD128

This can also be configured in /etc/kasmvnc/kasmvnc.yaml using:

desktop:
gpu:
hw3d: true
drinode: /dev/dri/renderD128

For more information on configuration please check HERE

Determining which video device to use​

On multi GPU systems you will need to determine which card to pass to the -drinode configuration parameter. This can be achieved using different tools the easiest being to follow file linking if you only need to determine which card is using what driver:

ls -l /sys/class/drm/renderD*/device/driver | awk '{print $9,$11}'
/sys/class/drm/renderD128/device/driver ../../../bus/pci/drivers/i915
/sys/class/drm/renderD129/device/driver ../../../../bus/pci/drivers/nvidia
/sys/class/drm/renderD130/device/driver ../../../../bus/pci/drivers/amdgpu

This is useful for systems that have an integrated GPU and a discrete card.

If you have multiple GPUs of the same manufacturer or driver you will need to manually parse through to determine which is which:

ls -l /dev/dri/by-path/*-render | awk '{print $9,$11}'
/dev/dri/by-path/pci-0000:04:00.0-render ../renderD128

Use the resulting pci id: (in this case 04:00.0)

sudo lspci |grep 04:00.0
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt (rev c7)

There is no bulletproof way to identify cards that are identical, but in general PCI Express IDs will go from lowest to highest being closest to farthest from the CPU on the motherboard of your system.