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.
Note
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:
Driver |
Description |
---|---|
Intel |
i965 and i915 drivers for Intel iGPU chipsets |
AMD |
AMDGPU, Radeon, and ATI drivers for AMD dedicated or APU chipsets |
NVIDIA |
nouveau2 drivers only, closed source NVIDIA drivers lack DRI3 support |
Note
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:
OS |
HomePage |
---|---|
AlmaLinux 8 |
|
AlmaLinux 9 |
|
Alpine 3.17 |
|
Alpine 3.18 |
|
Alpine 3.19 |
|
Debian Bullseye |
|
Debian Bookworm |
|
Fedora 37 |
|
Fedora 38 |
|
Fedora 39 |
|
Kali Linux Rolling |
|
openSUSE Leap 15 |
|
Oracle Linux 8 |
|
Oracle Linux 9 |
|
ParrotOS 5 |
|
Rocky Linux 8 |
|
Rocky Linux 9 |
|
Ubuntu Bionic |
|
Ubuntu Focal |
|
Ubuntu Jammy |
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 Environment |
Compositing Setting |
---|---|
XFCE |
Settings Manager > Window Manager Tweaks > Compositor > Enable display compositing |
KDE |
System Settings > Display and Monitor > Compositor > Enable on startup |
MATE |
System > Control Center > Windows > Enable software compositing window manager |
GNOME |
Disabling 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.