Adventures with Void Linux, Wayland and NVIDIA
I recently started a new remote job and with it came the obvious need to upgrade my setup. If I'm going to be spending more and more time on a computer, then it needs to be a comfortable experience. You know the drill.
I brought back my usual 24" monitor thinking I could make use of it. I was surprised to learn that NVIDIA's official drivers were not supported on musl-based Void Linux installations.
Denial
I scrambled to find a solution though all the advice hinted at running glibc instead. I refused to accept that.
I tried all the different combinations of WLR_*
environment variables there were but none seemed to work. I tried setting a few kernel flags but this part was sort of fuzzy. I didn't really know what I was doing.
I proceeded to back up my home directory and then I reinstalled Void Linux, with glibc this time. I went and installed the official NVIDIA drivers thinking my problem was about to be solved. They were the official, ordained drivers after all. I was dead wrong.
These drivers refused to work in any way with Sway, the only compositor I had been using since I made the move to Wayland a couple years ago, I refuse to use anything else.
Bargaining
I enabled mode setting for the card, tried a bunch of different WLR_*
combinations once again. This time the monitor worked! Hooray. Oh no, my laptop's display is all black... Long story short: Using a combination of flags either results in a working external monitor or a working laptop display, never both.
I removed the cursed drivers from my system and gave nouveau another chance. I made sure to enable mode setting this time, perhaps the only thing I should have done in my previous musl installation.
Surprise
I rebooted the system, and to my surprise, it was all working. Nouveau was able to piece everything together in a way the official drivers couldn't. I was relieved but also largely disappointed with NVIDIA. This is not a rant, so I'm not going to start pointing fingers. I just wanted to put this in writing to get the word out there.
If you have a card that is an NV160 or higher (like mine), you can absolutely have a great experience with your NVIDIA card on Linux with Wayland. It's all thanks to the talented people who have been able to reverse-engineer the drivers, it's pretty magical that they work this well in the first place.