Skip to content

Instantly share code, notes, and snippets.

@FlorianHeigl
Created February 22, 2026 18:10
Show Gist options
  • Select an option

  • Save FlorianHeigl/cc2c6afbe92996934782575276d59ac3 to your computer and use it in GitHub Desktop.

Select an option

Save FlorianHeigl/cc2c6afbe92996934782575276d59ac3 to your computer and use it in GitHub Desktop.
In a feature list in the git repo I found a bit, these are mentioned with regard to the streaming
Faster jpeg compression (via statically linked libjpeg-turbo)
Webp image compression for better bandwidth usage
Lossless QOI Image format for Local LAN
DRI3 GPU acceleration with open source drivers (AMDGPU,Intel,ATI,ARM)
the last line is interesting. open source drivers. no nvidia... and amdgpu is mentioned. isn't there some way to tell if it's being used... But noveaux2 is supported, so nvidia is fine.
will QOI also use it?
per codec/image type infos
there's a bit more in the wiki
WEBP is a modern image standard with higher compression and fidelity than JPEG. The client will report if the browser supports WEBP and the server will mix JPEG and WEBP based on compute availability. Because WEBP takes longer to encode, the server may not be able to use WEBP for all screen updates. The quality of WEBP can be better than JPEG and therefore they have separate settings. It seems WEBP usage of avx2 (SIMD) can be investigated from here: https://github.com/mono/SkiaSharp/issues/3464 - i saw a 'last month' two last month commits, so this is quite fresh. note that clock rates for AVX are in CPUs are usually lower than for easier stuff like normal floating point stuff (unless you have something like a 8360Y+ "AI Boost" which still can only use it at good speed on like 16 out of 36 cores. So, this is interesting since you get another relation between CPU load and offloading mechanism. You'd want a host running only a few stressful things, then webp offload (once implemented here on kasm) would fly. Other thing I found was w/re to SSE2, here: https://groups.google.com/a/webmproject.org/g/webp-discuss/c/1BRuUw_6Hs4 they say libwep can be compiled with SSE2 and that newer versions have no extra benefit.
LibJPEG Turbo (20210909) - This is a special build of KasmVNC that targets the latest version of libjpeg-turbo rather than using the older version available in the respective OS repos. The latest version has optimizations for AVX and SSE2 extensions. Our testing shows a 32% increase in speed of encoding jpeg. We do not publicly release this build, however, it is used within Kasm Workspaces docker images
QOI is the "The Quite OK Image Format", some cool info is at https://www.design-reuse.com/article/61341-an-800-mpixels-s-260-luts-implementation-of-the-qoi-lossless-image-compression-algorithm-and-its-improvement-through-hilbert-scanning/ . I think I found stuff for running it on FPGAs but no info more mainstream approaches ;-) it seems a really cool format, wish i could learn more about it some day
DRI3 must be enabled(!!!!), see here: https://kasmweb.com/kasmvnc/docs/master/gpu_acceleration.html#enabling-gpu-acceleration-in-kasmvnc
WM Composition must be disabled, i think this affects mostly full sessions
Gnome3 doesn't allow to do that and thus kills DRI3 (https://kasmweb.com/kasmvnc/docs/master/gpu_acceleration.html#enabling-gpu-acceleration-in-kasmvnc) they use a workaround in KASM to make it less bad but the tl;dr is to not use it
There's no explicit statement regarding the prebuilt chrome/ff workspaces, my best guess would be to go on the container host, use docker inspect & docker exec/cp to investigate the config and process arguments
they show a benchmark util but with the above note that it's not released it's not realistic to benchmark yourself. I couldn't find anything about QOI yet, or about what webp can or would benefit from.
as you can see above it dynamically adapts, so what kind of offloading _for each tiled segment of the screen_ is in effect _at any given moment_ could be dependent on the _CPU load at that time_.
(it's cool, but reminds me of like the "magic" windows docs stating multiple "swap devices are selected by an internal algorithm" in technet and internals boosk for decades)
tl;dr:
CPU offload is used for some cases (AVX and SSE2 needed), for others it's not documented.
GPU offload needs drivers that are OSS and support DRI3.
GPU offload will not be used by default
adjust your kasmvnc config by passing down the right settings. idk yet how, but keyword is hw3d: true
you might also need to disable some desktop manager features, if one is involved
kasm says the standard ubuntu are prepared well, for other scenarios, i.e. alpine/lxde there's no info
Please for the love of computers, correct me where I'm wrong. I don't even remember what half the things are, I just know how to read fast.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment