- Edited
I'm currently trying to run X11 applications that can cause eye strain on Linux not directly but via TCP. The idea is that when an application is run that way, as far as I understand it does not have access to the Direct Rendering Infrastructure (DRI). So it cannot draw to the screen directly anymore. It runs on the remote computer and sends draw instructions to the Xorg server. The CPU architecture can be different: I was able to use applications that run on a Raspberry Pi (ARM) on an AMD x64 machine.
I have noticed that GPU processes don't spawn that way. However, it is a little different when trying this on the same machine (localhost), which is what I want to do for better performance. Applications connecting to localhost can still spawn GPU processes for whatever reason. Some don't (glxgears), but some do (Firefox, Chromium, Visual Studio Code). Perhaps they are bypassing the bypass somehow? If you are interested in trying this out, please share your results. I think together we can work this out faster.
Instructions for Debian 12 "Bookworm":
Run X11 applications via TCP
If you are using Debian's default graphical login manager:
/etc/lightdm/lightdm.conf:
Change #xserver-allow-tcp=false
to xserver-allow-tcp=true
Not sure if the following is necessary for /etc/X11/xinit/xserverrc. If you are not using lightdm, it probably is:
Change exec /usr/bin/X -nolisten tcp "$@"
to exec /usr/bin/X -listen tcp "$@"
Reboot.
Then allow other computers in your network access (as a normal user) : xhost +name
where "name" is the other computer's hostname. To allow local access: xhost +localhost
. You can allow access to any computer with xhost +
. The effect is only lasting for the current login session.
Look at your DISPLAY variable by typing echo $DISPLAY
. The first number before the colon matters. On the remote machine open any terminal and start any graphical application like this, for example to start glxgears:
DISPLAY=192.168.178.15:0 glxgears
Replace "0" with the first number seen previously in your DISPLAY variable and the example IP address with your computer's IP address or hostname.
The application should appear on the monitor, and if the theory holds, it should not cause any eye strain. Not that glxgears ever did, it's just an example.
If you want to try a local connections instead, to help find out why those connections can still utilize the GPU directly and how we could prevent them from doing so:
DISPLAY=localhost:0 firefox
Alternative: use VNC to connect to localhost
sudo apt install tigervnc-standalone-server tigervnc-viewer
Manuals: man vncserver
and man vncviewer
You can start a single application that resizes along with the VNC viewer window. For quick testing, this one-liner example is not using a password:
tigervncserver -SecurityTypes none -localhost yes -xstartup i3 && xtigervncviewer localhost:1
To kill the server and everthing in it: tigervncserver -kill :1
I'm still searching for a very simple window manager that can simply run 1 app in full screen. Replace "i3" with a window manager of your choice (and let me know if you find one that's perfectly suited for this purpose).
During my first tests when launching an eye strain app (Visual Studio Code), some eye strain still seems to be coming through the VNC viewer. Really strange. If only we knew the root cause for the app-specific eye strain. But perhaps if enough people keep trying, we can make some progress.