Hello,
I just installed Qubes OS and don’t fully understand how it works so please correct me if I say something wrong.
I just made a template (from the debian-12 template) with the nvidia drivers installed so I can stream videos lag-free but I get severe screen tearing and videos are choppy no matter how low the quality is or how much ram/cores I give to the qube.
I am sure my GPU is used by whatever app I use to play my video (using “__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia”).
I tried with chromium and mpv with various settings/configurations (the performances are good, I can play 4k fine) but the issue persists (micro lags every 20 frames and tearing).
To fix this issue (after trying all the fixes online) I tried to set my GPU as the main device for the X server inside my cube by following NVIDIA Optimus - Debian Wiki .
This failed because this device:
00:03.0 VGA compatible controller: Device 1234:1111 (rev 02)
Subsystem: Red Hat, Inc. Device 1100
Kernel driver in use: bochs-drm
Kernel modules: bochs
always gets picked whatever I do instead of my nvidia gpu.
I tried everything, even deleting “nomodeset” from the default kernelopts and setting the qube kernel to “provided by qube” and then reinstalling the driver.
Is what I’m trying to do even achievable ?
If not, is there any other way I can get rid of the tearing inside my HVM cubes ?
Apologies for the delayed response. To completely eliminate screen tearing, you must connect an external monitor directly to the graphics card designated for passthrough. Here’s how I resolved the issue in my own configuration:
I set up a dedicated sys-gui-gpu VM. After configuring all necessary permissions and security policies, I installed the NVIDIA driver in dom0. I then passed through the NVIDIA GPU to sys-gui-gpu and hid the secondary AMD GPU so it could be allocated to other APPVMs. Notably, sys-gui-gpu operates using the open-source Nouveau driver, which eliminated the need for proprietary software.
I primarily use the AMD-equipped VM for running Steam, streaming 4K video, and executing local LLMs via llama.cpp. With 24 GB of VRAM, it comfortably runs Qwen3.6-27B at 50–60 tokens per second with a 200K context window (when MTP is enabled). Disabling MTP allows for MAX model token context, though inference speed drops to approximately 30-35 tokens per second. I’d be glad to draft a detailed step-by-step guide if you’d like, though other community guides already cover Ollama integration.
As highlighted there, you’ll need to hide the GPU from the host system using the rd.qubes.hide_pci kernel parameter. Please don’t hesitate to reach out if you encounter any issues or have additional questions—I’m happy to assist!