If you use nvidia driver for your GPU, you probably wonder why in some config, you can't hotplug your second monitor. You need to reboot to be able to use it. I found out recently with the help of chatgpt that I have been using old feature of nvidia driver all this time. The key settings are in /etc/environment.
My previous settings:
__NV_PRIME_RENDER_OFFLOAD=1
__GLX_VENDOR_LIBRARY_NAME=nvidia
LIBVA_DRIVER_NAME=nvidia
GTK_USE_PORTAL=1
KWIN_DRM_USE_EGL_STREAMS=1
If you can see above, I am using KWIN_DRM_USE_EGL_STREAMS=1 which means KDE is using NVIDIA’s old EGLStreams backend, which is notoriously bad at detecting new monitors in Wayland sessions. I should remove it and replace it with GBM_BACKEND=nvidia-drm which is the modern buffer management backend for NVIDIA + Wayland that supports hotplugging of monitors.
So i replaced it with this settings:
__NV_PRIME_RENDER_OFFLOAD=1
__GLX_VENDOR_LIBRARY_NAME=nvidia
LIBVA_DRIVER_NAME=nvidia
GTK_USE_PORTAL=1
GBM_BACKEND=nvidia-drm
I need to reboot once and testing it by unplugging and plugging it back. It works!
That's all there is to it. Have fun!
No comments:
Post a Comment