So I ended up installing X through debian directly, and everything else with Nix. I think this isn’t going to work either though. Additional details: Optimus (?) laptop with intel/nvidia graphics, installed bumblebee-nvidia since bbswitch with nouveau simply didn’t work (high temperatures, fan constantly on while doing nothing).
So anyways, I installed picom, glxinfo, alacritty, etc with Nix and nothing that uses GLX will work.
Video card drivers loaded correctly:
$ dmesg
...
[ 2.123823] fb: switching to inteldrmfb from EFI VGA
[ 2.138516] fbcon: inteldrmfb (fb0) is primary device
[ 3.262031] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
...
[ 17.072904] nvidia: loading out-of-tree module taints kernel.
[ 17.072909] nvidia: module license 'NVIDIA' taints kernel.
[ 17.081844] nvidia: module verification failed: signature and/or required key missing - tainting kernel
[ 17.087777] nvidia-nvlink: Nvlink Core is being initialized, major device number 240
[ 17.087951] nvidia 0000:01:00.0: enabling device (0006 -> 0007)
[ 17.088030] nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[ 17.128817] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 418.74 Wed May 1 11:49:41 CDT 2019
...
~$ cat /var/log/Xorg.0.log | grep 'gl\|GL'
[ 18.662] (II) LoadModule: "glx"
[ 18.663] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 18.673] (II) Module glx: vendor="X.Org Foundation"
[ 18.681] (II) Loading sub module "glamoregl"
[ 18.681] (II) LoadModule: "glamoregl"
[ 18.681] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[ 18.686] (II) Module glamoregl: vendor="X.Org Foundation"
[ 18.730] (II) modeset(0): glamor X acceleration enabled on Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2)
[ 18.730] (II) modeset(0): glamor initialized
[ 18.754] (II) Initializing extension GLX
[ 18.758] (II) AIGLX: Loaded and initialized i965
[ 18.758] (II) GLX: Initialized DRI2 GL provider for screen 0
Visual reported correctly with xdpyinfo:
$ xdpyinfo | grep 'GL\|DRI'
DRI2
DRI3
GLX
~$ systemctl status bumblebeed.service
● bumblebeed.service - Bumblebee C Daemon
Loaded: loaded (/lib/systemd/system/bumblebeed.service; disabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/bumblebeed.service.d
└─override.conf
Active: active (running) since Sat 2020-03-28 15:03:00 JST; 40min ago
Process: 1259 ExecStartPre=/bin/sleep 5 (code=exited, status=0/SUCCESS)
Main PID: 1260 (bumblebeed)
Tasks: 1 (limit: 4915)
Memory: 27.4M
CGroup: /system.slice/bumblebeed.service
└─1260 /usr/sbin/bumblebeed
(override just adds a sleep before starting…)
However:
$ glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig
$ glxgears
Error: couldn't get an RGB, Double-buffered visual
$ picom
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.804 glx_has_extension ERROR ] Failed get GLX extension list.
[ 03/28/20 15:45:00.826 paint_bind_tex ERROR ] Failed to find appropriate FBConfig for X pixmap
[ 03/28/20 15:45:00.826 paint_one ERROR ] Failed to bind texture for window 0x00800084.
Segmentation fault
These should work - the intel video also supports glx and there are no reported problems.
Since optimus feels like a massive hack I wasn’t expecting this to run, but:
~$ optirun glxgears
glxgears: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
I thought the issues with non-optirun might be related to libglx.so + related libraries which aren’t managed traditionally with optimus. Like, maybe it’s using a different libglx.so file for a driver that isn’t loaded on my system, whereas xdpyinfo which was installed with apt-get was.
I installed mesa-utils (for glxgears) with apt-get this time, and ran:
~$ /usr/bin/glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
1205 frames in 5.0 seconds = 240.932 FPS
So that appears to be the case.
Also, not directly X related but it seems chromium won’t work when installed with Nix on a foreign distro? It complains of a sandbox directory issue.
It’s going to be way too confusing managing some software with apt-get and some with Nix here, so I’m afraid I’m going to have to drop Nix at this point.