NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.16k forks source link

Kitty does not start more #80936

Open shyim opened 4 years ago

shyim commented 4 years ago

Describe the bug Kitty does not start more

To Reproduce Steps to reproduce the behavior:

  1. Run nixos-unstable
  2. Start Kitty
  3. Does not start

Expected behavior Its working

Screenshots

[055 09:05:46.416468] [glfw error 65542]: GLX: No GLXFBConfigs returned
[055 09:05:46.416497] [glfw error 65545]: GLX: Failed to find a suitable GLXFBConfig
[055 09:05:46.416512] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.3 drivers.

Additional context Add any other context about the problem here.

Metadata

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: kitty
# a list of nixos modules affected by the problem
module:
rnhmjoj commented 4 years ago

What does nix run nixpkgs.glxinfo -c glxinfo | grep OpenGL says?

shyim commented 4 years ago
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2) 
OpenGL core profile version string: 4.6 (Core Profile) Mesa 19.3.3
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 19.3.3
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 19.3.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
rnhmjoj commented 4 years ago

Try running kitty with env MESA_GL_VERSION_OVERRIDE=3.3 kitty

shyim commented 4 years ago

Still don't running

❯ env MESA_GL_VERSION_OVERRIDE=3.3 kitty
[055 16:02:21.181352] [glfw error 65542]: GLX: No GLXFBConfigs returned
[055 16:02:21.181372] [glfw error 65545]: GLX: Failed to find a suitable GLXFBConfig
[055 16:02:21.181380] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.3 drivers.
rnhmjoj commented 4 years ago

Are you using wayland/sway? Did a previous version of kitty work?

There are a couple issues upstream with this same error. One is about sway, which should have already been fixed in unstable. The other is simply saying that you really need OpenGL 3.3. If it used to work I guess the lowest requried version has been raised in a recent release.

shyim commented 4 years ago

I am using I3. I guess it happend with Kernel update I will downgrade to test that :thinking:

shyim commented 4 years ago

Same with 5.4 kernel 🙈

vcunat commented 4 years ago

Could this be the same as https://github.com/NixOS/nixpkgs/issues/75868 ?

rnhmjoj commented 4 years ago

It may be but I can't reproduce it on the same machine where I tested #75868.

vcunat commented 4 years ago

I think it's worth trying LIBGL_DEBUG=verbose in any case (for those who can reproduce the issue).

shyim commented 4 years ago
❯ LIBGL_DEBUG=verbose kitty
[056 11:43:24.816491] [glfw error 65542]: GLX: No GLXFBConfigs returned
[056 11:43:24.816512] [glfw error 65545]: GLX: Failed to find a suitable GLXFBConfig
[056 11:43:24.816535] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.3 drivers.

Similar issue happends also with alacritty. I guess it's a general problem

fionera commented 4 years ago

I have the same issue after an upgrade. The whole gl context is missing and glxinfo also screams name of display: :1 Error: couldn't find RGB GLX visual or fbconfig

This doesnt happen on the 19.09 channel

rht commented 4 years ago

Bump. I have accidentally spotted this issue, I also use kitty and have been hesitant in updating my unstable channel until this is resolved.

shyim commented 4 years ago

It's not only kitty. The whole gl context is broken in 20.03 / unstable.

timokau commented 4 years ago

I tried to bisect the problem, but for some reason it just vanished. Now I cannot reproduce it anymore on the same machine with the same configuration and the same pinned nixpkgs. Very weird.

nixos-discourse commented 4 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-bisect-bisect-nix-builds/5584/10

fionera commented 4 years ago

@timokau I just upgraded to master again but the issue is still there. I am trying your bisect package now

rnhmjoj commented 4 years ago

If it's hard to reproduce and seems to appear/disappear randomly maybe it has to do with the /run/opengl-driver impurity of the system and not much with nixpkgs itself.

vcunat commented 4 years ago

Right, I would not expect these issues to happen if you have this path matching (i.e. booted NixOS version) with the package version you are using. I suspect the culprit is glibc update done during the 20.03 cycle.

timokau commented 4 years ago

Right, I would not expect these issues to happen if you have this path matching (i.e. booted NixOS version) with the package version you are using. I suspect the culprit is glibc update done during the 20.03 cycle.

In an effort to test this, I wanted to go back to a revision before this error occurred (8130f3c1c2bb0e533b5e150c39911d6e61dcecc2), reboot into that and then switch back to a more recent one to see if the problem re-appears.

It turns out that the problem now actually occurs after rebooting into 8130f3c1c2bb0e533b5e150c39911d6e61dcecc2. That revision was definitely good before, and I did reboot. So that confirms that there is some impurity going on (that goes both directions), but rebooting does not fix it. Not sure what does, but apparently at some point some switch was flipped for me.

fatpat commented 4 years ago

I have the same issue here with kitty (but with others packages like glxinfo, compton, ...)

the solution was to remove the package and to reinstall it ... don't ask me why

Fresheyeball commented 4 years ago

@fatpat that worked for me as a work around. I removed kitty from my configuration.nix, and instead installed it with nix-env now it works. Go figure.

shyim commented 4 years ago

Same for me :)

Fresheyeball commented 4 years ago

@shyim please don't close this. We still need to be able to install it without nix-env. A workaround is not a bug fix!

maxkrieger commented 4 years ago

FWIW my kitty actually was failing in my ~/.config/nixpkgs/config.nix (installed with nix-env) but worked when I installed it in my user packages (/etc/nixos/configuration.nix).

dustinlacewell commented 4 years ago

On unstable, no matter how I install it, I get

fast_data_types.FreeTypeError: Failed to load face, with error: cannot open resource
[251 06:40:21.964670] Failed to convert descriptor to face for symbol_map font
vcunat commented 4 years ago

That error seems very different; best put that in a separate issue.

omidmnz commented 4 years ago

I have the same problem, but not with just Kitty. Picom, among others is problematic too. The output of nix run nixpkgs.glxinfo -c glxinfo | grep OpenGL has only one change between the working and broken configurations:

-OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.1.7
+OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.1.9
kenranunderscore commented 4 years ago

I have the same problem, but not with just Kitty. Picom, among others is problematic too. The output of nix run nixpkgs.glxinfo -c glxinfo | grep OpenGL has only one change between the working and broken configurations:

-OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.1.7
+OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.1.9

I am experiencing the same issues, and it's also just this diff. It's preventing me from upgrading my system at the moment. I might try installing it with nix-env instead of with home-manager, maybe that helps. But it's generally undesirable.

tbenst commented 4 years ago

I'm experiencing this with Julia / Makie.jl as well.

using ModernGL, GLFW
window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)

Edit: to be precise, I get GLFWError (API_UNAVAILABLE): GLX: No GLXFBConfigs returned

tbenst commented 3 years ago

After updating to latest release-20.09 (fd2044d846b590328b8995fd490258bfea3bf468), the error has now changed for me. I now get:

❯ glxinfo
name of display: localhost:10.0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  41
  Current serial number in output stream:  42

The Julia code similarly gives:

julia> using GLFW
julia> window = GLFW.CreateWindow(640, 480, "GLFW.jl")
ERROR: GLFWError (VERSION_UNAVAILABLE): GLX: Failed to create context: BadValue

Edit: happy to report that this succeeds when in front of the desktop! There appear to be two problems:

  1. I get the BadValue error when attempting to run OpenGL over X11 forwarding. This may be NVIDIA specific.

  2. When using a nix-shell, I get the No GLXFBConfigs error. This is easily addressible by adding following line to shell.nix: LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib";";

drbeefsupreme commented 3 years ago

I have this same error installing kitty with home-manager running Debian Testing. Installing via nix-env gives the same error.

rnhmjoj commented 3 years ago

@syzygyzer AFAIK, on non-NixOS distros, openGL applications won't work by default because they can't find the driver. You can try using https://github.com/guibou/nixGL to workaround this issue.

jsravn commented 3 years ago

This has started failing for me again after updating my 20.09 channel. Any ideas?

kitty
[029 12:35:41.007051] [glfw error 65542]: GLX: No GLXFBConfigs returned
[029 12:35:41.007061] [glfw error 65545]: GLX: Failed to find a suitable GLXFBConfig
[029 12:35:41.007067] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.3 drivers
nix run nixpkgs.glxinfo -c glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce RTX 3080/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 455.38
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 455.38
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 455.38
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

ttuegel commented 3 years ago

Not stale, still an issue.

dmayle commented 2 years ago

For those of you who experience this issue on an OS other than NixOS (like @drbeefsupreme using debian, like me), the solution is to install nixGL ( https://github.com/guibou/nixGL ) and use the wrapper to launch kitty

alexfmpe commented 2 years ago

I ran into this with nix-env and nix-shell, with 20.05 channel.

$ kitty
[323 01:22:47.635093] [glfw error 65542]: GLX: No GLXFBConfigs returned
[323 01:22:47.635109] [glfw error 65545]: GLX: Failed to find a suitable GLXFBConfig
[323 01:22:47.635116] Failed to create GLFW temp window! This usually happens because of old/broken OpenGL drivers. kitty requires working OpenGL 3.3 drivers.

However, it worked via environment.systemPackages, most likely because my system nixpkgs is significantly newer, pinned to a weeks old nixos-unstable: b67e752c29f18a0ca5534a07661366d6a2c2e649

The same contrast happened with glxinfo:

$ glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig

vs

$ glxinfo | grep OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: Radeon RX 570 Series (POLARIS10, DRM 3.42.0, 5.15.0, LLVM 12.0.1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.2.5
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.2.5
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

So maybe this is fixed now?

maradotwebp commented 2 years ago

I had the same error, glxinfo gave me

$ glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig

and upgrading my system from my initial version of 21.05 to 21.11 or unstable did nothing for me either.

What worked was adding an option:

# "nvidia"/"nouveau" for nvidia gpu's
+ services.xserver.videoDrivers = [ "amdgpu" ];

NixOS 21.11 created some breaking changes here:

services.xserver.videoDrivers no longer uses the deprecated cirrus and vesa device dependent X drivers by default. It also enables both amdgpu and nouveau drivers by default now.

I have no idea why this causes an issue in the first place, and why this occurred for me in 21.05. Software is fickle and for every bug I try to understand two more are created elsewhere.

RobinRamael commented 2 years ago

I encountered this issue when upgrading to NixOS 21.11. The cause for me was kitty (and others, like picom) being installed from home-manager. I had updated nixos, but not home-manager, causing kitty to look for the wrong driver (?). Went through all kinds of attempts to fix, but in the end simply rebuilding my home-manager config with the 21.11 channel did it. Maybe someone can learn from my mistakes if they find this :)

j-steinbach commented 2 years ago

I just upgraded my flakes and also encountered this: kitty, alacritty. wezterm or glxinfo all fail in some way or another. No home-manager, just regular NixOS.

Any places to look at or commands to run to try and narrow this down?

E: This happened 21.05. I also have services.xserver.videoDrivers = [ "nvidia"] set.

E2: Changed to services.xserver.videoDrivers = [ "nouveau"] and now it works. The problem probably stems from kernel + nvidia update.

E3: I fixed this for me for nvidia by using both the latest kernel and the drivers from unstable. Before I used the latest kernel from the stable channel.

lapp0 commented 2 years ago

@j-steinbach Could you please specify your exact kernel version (5.16 was released since your comment) and the package name for your nvidia drivers?

j-steinbach commented 2 years ago

@lapp0 For the kernel I simply use the latest one: boot.kernelPackages = pkgs.linuxPackages_latest; I don't know how this option exactly works, but uname results in Linux 5.16.3 #1-NixOS SMP PREEMPT x86_64 GNU/Linux.

For the nvidia drivers package name I don't understand what you want to know. All I have set is the services.xserver.videoDrivers = [ "nvidia"], as mentioned above. This results in nvidia-smi: NVIDIA-SMI 495.46 Driver Version: 495.46 CUDA Version: 11.5

To be sure, I also rg'ed both "kernel" and "nvidia", and those are the only lines I could find.

Mabe the flake inputs are also interesting. Here I specify inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

lapp0 commented 2 years ago

The Error

$ glxgears
Error: couldn't get an RGB, Double-buffered visual
$ glxinfo
name of display: localhost:10.0
Error: couldn't find RGB GLX visual or fbconfig

(Note: I am forwarding X11. I have tried with ssh -X, ssh -Y, ssh -XY, and vglconnect, all resulting in the above error)

Upgrading to Unstable doesn't work

Along with unstable with the details above, my previous configuration of stable with Linux 5.15 and CUDA Version: 11.4 also resulted in "The Error"

A variety of changes to my configuration didn't work

For consistency with @j-steinbach's configuration, I changed services.xserver.videoDrivers = [ "intel" "nvidia" ]; to services.xserver.videoDrivers = [ "nvidia" ];

Which also resulted in "The Error"

Here are some relevant bits of my configuration:

services.xserver.videoDrivers = [ "intel" "nvidia" ]; # also fails with [ "nvidia" ]
boot.kernelModules = [ "nvidia-uvm" ]; # also fails with when unset
services.openssh.forwardX11 = true;  # also fails with false

# custom zfsUnstable with zfs-head-master and linux 5_16
hardware.nvidia.package = pkgs.zfsUnstable.latestCompatibleLinuxPackages.nvidia_x11_beta;  # also fails when unset
boot.kernelPackages = pkgs.zfsUnstable.latestCompatibleLinuxPackages
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "isci" "usbhid" "usb_storage" "sd_mod" ];

Any thoughts on other settings I might be missing? Anything involving hardware.opengl? Mesa?

NixGL doesn't make it work

nixGLNvidia-510.39.01 glxgears
Error: couldn't get an RGB, Double-buffered visual

X forwarding when libGL ISN'T involved DOES work

xmessage -center hello! creates a window on my machine, however I still need to forward 3D graphics so this isn't a solution.

nouveau drivers work fine

Worth mentioning nouveau drivers work fine and don't give "The Error". However I need CUDA so I must use nvidia drivers, therefore this isn't a solution.

Debug Details

$ ldd $(which glxinfo)
    linux-vdso.so.1 (0x00007ffe5cfa6000)
    libGLEW.so.2.2 => /nix/store/h9bkqvrlvziwli0k7axiybxf0arln01i-glew-2.2.0/lib/libGLEW.so.2.2 (0x00007fc289c82000)
    libGLU.so.1 => /nix/store/04yj0nllw5bqzzlay5m6zzbmyw7csgnk-glu-9.0.2/lib/libGLU.so.1 (0x00007fc289c0e000)
    libGL.so.1 => /nix/store/5lzlfgrc37wqj400b4qgpaa6kc9d2wr1-libglvnd-1.4.0/lib/libGL.so.1 (0x00007fc289b80000)
    libm.so.6 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libm.so.6 (0x00007fc289a3f000)
    libX11.so.6 => /nix/store/6pdb0rz2w2hsfsy66kwrbz67jd424wv7-libX11-1.7.2/lib/libX11.so.6 (0x00007fc2898fa000)
    libXext.so.6 => /nix/store/a3yw11i2iskvr1zx2za4mwrj9sawq7hz-libXext-1.3.4/lib/libXext.so.6 (0x00007fc2898e3000)
    libpthread.so.0 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libpthread.so.0 (0x00007fc2898c3000)
    libc.so.6 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libc.so.6 (0x00007fc2896ed000)
    libSM.so.6 => /nix/store/f30jdkd21p3bayd6s2z3is7xfm4a43h9-libSM-1.2.3/lib/libSM.so.6 (0x00007fc2896e2000)
    libICE.so.6 => /nix/store/lmn5ybv6w9zsdk18sl37adlbvf9cm8c6-libICE-1.0.10/lib/libICE.so.6 (0x00007fc2896c4000)
    libstdc++.so.6 => /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib/lib/../lib64/libstdc++.so.6 (0x00007fc2894ed000)
    libgcc_s.so.1 => /nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib/lib/../lib64/libgcc_s.so.1 (0x00007fc2894d3000)
    libGLX.so.0 => /nix/store/5lzlfgrc37wqj400b4qgpaa6kc9d2wr1-libglvnd-1.4.0/lib/libGLX.so.0 (0x00007fc28949e000)
    libGLdispatch.so.0 => /nix/store/5lzlfgrc37wqj400b4qgpaa6kc9d2wr1-libglvnd-1.4.0/lib/libGLdispatch.so.0 (0x00007fc2893e5000)
    libdl.so.2 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libdl.so.2 (0x00007fc2893e0000)
    /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/ld-linux-x86-64.so.2 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib64/ld-linux-x86-64.so.2 (0x00007fc289d3f000)
    libxcb.so.1 => /nix/store/n1h6395818hn30bi5dk31smjwvhwawax-libxcb-1.14/lib/libxcb.so.1 (0x00007fc2893b2000)
    libuuid.so.1 => /nix/store/kx41yd3yyr9bwrsk85fhhx6qhavfwql6-util-linux-2.37.3-lib/lib/libuuid.so.1 (0x00007fc2893a9000)
    libXau.so.6 => /nix/store/x14h74lzrxk7j05pgqmba8yicb2bms6f-libXau-1.0.9/lib/libXau.so.6 (0x00007fc2893a4000)
    libXdmcp.so.6 => /nix/store/3ijd7iqmnwqvfyv4k8l5a8qw33agi1br-libXdmcp-1.1.3/lib/libXdmcp.so.6 (0x00007fc28939a000)
$ nix-store --query --references $(which glxinfo)
/nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108
/nix/store/6pdb0rz2w2hsfsy66kwrbz67jd424wv7-libX11-1.7.2
/nix/store/pi2h6nky70gww75w05zq1ch9fmycrvvy-libGL-1.4.0
$ nix-store --query --references $(which nvidia-smi)
/nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108
/nix/store/2mr45n3xcfsbvj6f9fl2s4v48chbhwy4-libdrm-2.4.109
/nix/store/n1h6395818hn30bi5dk31smjwvhwawax-libxcb-1.14
/nix/store/6pdb0rz2w2hsfsy66kwrbz67jd424wv7-libX11-1.7.2
/nix/store/a3yw11i2iskvr1zx2za4mwrj9sawq7hz-libXext-1.3.4
/nix/store/33gyg5fwgi7d76ybw5sdrcgs5jdhl4yk-libXrandr-1.5.2
/nix/store/4k40gdgf7ckimb3hlwywx76dj5435ack-libXv-1.0.11
/nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib
/nix/store/pz2wx67gskw438ysws82nwk84whwd63d-wayland-1.20.0
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5
/nix/store/bqjh8dc6m5plswxrmmn9x4cpxrrw94lv-zlib-1.2.11
/nix/store/pi2h6nky70gww75w05zq1ch9fmycrvvy-libGL-1.4.0
/nix/store/1m06jadmgmzkqy0ry6sx9q0pkcbbkipv-nvidia-x11-510.47.03-5.10.99
$ ldd $(which nvidia-smi) 
    linux-vdso.so.1 (0x00007f1d13b33000)
    libpthread.so.0 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libpthread.so.0 (0x00007f1d13b0d000)
    libm.so.6 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libm.so.6 (0x00007f1d139cc000)
    libdl.so.2 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libdl.so.2 (0x00007f1d139c7000)
    libc.so.6 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/libc.so.6 (0x00007f1d137ef000)
    librt.so.1 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/librt.so.1 (0x00007f1d137e4000)
    /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib/ld-linux-x86-64.so.2 => /nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108/lib64/ld-linux-x86-64.so.2 (0x00007f1d13b35000)
$ sudo lshw -c display
  *-display                 
       physical id: 3
       bus info: pci@0000:09:03.0
       version: 0a
       width: 32 bits
       clock: 33MHz
       capabilities: pm bus_master cap_list rom
       configuration: driver=mgag200 latency=64 maxlatency=32 mingnt=16
       resources: irq:16 memory:dd000000-ddffffff memory:df800000-df803fff memory:df000000-df7fffff memory:c0000-dffff
  *-display
       physical id: 0
       bus info: pci@0000:83:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:69 memory:fa000000-faffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:d000(size=128) memory:fb000000-fb07ffff
$ modinfo nvidia
filename:       /run/booted-system/kernel-modules/lib/modules/5.16.8/misc/nvidia.ko
firmware:       nvidia/510.39.01/gsp.bin
alias:          char-major-195-*
version:        510.39.01
supported:      external
license:        NVIDIA
srcversion:     70CDF5F4E6A9B189699C5B8
alias:          pci:v000010DEd*sv*sd*bc06sc80i00*
alias:          pci:v000010DEd*sv*sd*bc03sc02i00*
alias:          pci:v000010DEd*sv*sd*bc03sc00i00*
depends:        i2c-core,drm
retpoline:      Y
name:           nvidia
vermagic:       5.16.8 SMP preempt mod_unload 
parm:           NvSwitchRegDwords:NvSwitch regkey (charp)
parm:           NvSwitchBlacklist:NvSwitchBlacklist=uuid[,uuid...] (charp)
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_InitializeSystemMemoryAllocations:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_RegisterForACPIEvents:int
parm:           NVreg_EnablePCIeGen3:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_TCEBypassMode:int
parm:           NVreg_EnableStreamMemOPs:int
parm:           NVreg_RestrictProfilingToAdminUsers:int
parm:           NVreg_PreserveVideoMemoryAllocations:int
parm:           NVreg_EnableS0ixPowerManagement:int
parm:           NVreg_S0ixPowerManagementVideoMemoryThreshold:int
parm:           NVreg_DynamicPowerManagement:int
parm:           NVreg_DynamicPowerManagementVideoMemoryThreshold:int
parm:           NVreg_EnableGpuFirmware:int
parm:           NVreg_EnableUserNUMAManagement:int
parm:           NVreg_MemoryPoolSize:int
parm:           NVreg_KMallocHeapMaxSize:int
parm:           NVreg_VMallocHeapMaxSize:int
parm:           NVreg_IgnoreMMIOCheck:int
parm:           NVreg_NvLinkDisable:int
parm:           NVreg_EnablePCIERelaxedOrderingMode:int
parm:           NVreg_RegisterPCIDriver:int
parm:           NVreg_EnableDbgBreakpoint:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_RegistryDwordsPerDevice:charp
parm:           NVreg_RmMsg:charp
parm:           NVreg_GpuBlacklist:charp
parm:           NVreg_TemporaryFilePath:charp
parm:           NVreg_ExcludedGpus:charp
parm:           rm_firmware_active:charp
j-steinbach commented 2 years ago

@lapp0 I have good and bad news :)

The good news is: you are still sane, this indeed doesn't work again!

The bad news: it now is also broken for me :)

I wanted to share my config with you, updated my flake and... the rest is known.

My guess is that we need to identify the correct mix of kernel and nvidia packages. And then withhold from updating if they don't match. How to do that? No idea.


 ↳ glxgears
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  28
  Current serial number in output stream:  29
 ↳ nvidia-smi
Failed to initialize NVML: Driver/library version mismatch
lapp0 commented 2 years ago

Hmm, I don't have the same error. This post suggests rebooting works https://stackoverflow.com/a/43023000

If rebooting works, could you let me know if anything stands out when comparing your output to my debug info section?

j-steinbach commented 2 years ago

Definitely. In the meantime you can already take a look at them here. I hope its readable. Still WIP.

lapp0 commented 2 years ago

I also found this interesting X log bit

[  6082.686] (II) AIGLX: Screen 0 is not DRI2 capable
[  6082.716] (EE) AIGLX error: dlopen of /run/opengl-driver/lib/dri/swrast_dri.so failed (/run/opengl-driver/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
[  6082.716] (EE) AIGLX error: unable to load driver swrast
[  6082.716] (EE) GLX: could not load software renderer
[  6082.716] (II) GLX: no usable GL providers found for screen 0
j-steinbach commented 2 years ago

Updating made it work again. Thanks for the tip.

I've noticed that we use a different architecture:

You probably did this, but have you tried it with a stripped-to-the-bones minimal config?


I tried running a few of your commands so that we maybe can see some differences:

 ↳ modinfo nvidia
filename:       /run/booted-system/kernel-modules/lib/modules/5.16.7/misc/nvidia.ko
firmware:       nvidia/510.47.03/gsp.bin
alias:          char-major-195-*
version:        510.47.03
 ↳ sudo lshw -c display
  *-display
       physical id: 0
       bus info: pci@0000:1c:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:57 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:f000(size=128) memory:c0000-dffff

E: I have the following in my docs:

kernelModules = [ "kvm-amd" ]; is very important, as the OS will miss OpenGL otherwise. Don't ask me how I know this..

E2: https://gist.github.com/CMCDragonkai/810f78ee29c8fce916d072875f7e1751

lapp0 commented 2 years ago

I have boot.kernelModules = [ "kvm-intel" ];

I will try a barebones config.