NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.13k stars 14.17k 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:
j-steinbach commented 2 years ago

I've also just discovered that we can choose different nvidia packages. Besides that I think I'm out of things to try.

lapp0 commented 2 years ago

I tried a mostly plain configuration as well as nvidia_x11 and nvidia_x11_beta. Thanks for trying, I'm going to ask on discourse.

lapp0 commented 2 years ago

https://discourse.nixos.org/t/forwarding-x11-to-nvidia-server-couldnt-find-rgb-glx-visual-or-fbconfig/17730

lapp0 commented 2 years ago

Issues with the same problem (at least I'm not alone) https://github.com/NixOS/nixpkgs/issues/85866 https://github.com/NixOS/nixpkgs/issues/66755 https://github.com/NixOS/nixpkgs/issues/132045 https://github.com/NixOS/nixpkgs/issues/82959 https://github.com/NixOS/nixpkgs/issues/94958 https://github.com/NixOS/nixpkgs/issues/101202 https://github.com/NixOS/nixpkgs/issues/55191 https://github.com/NixOS/nixpkgs/issues/84692

Hopefully they can see your solution to the issue from the linkback if anything. It might work for some people even if it doesn't work on my end.

Is there any way to escalate this?

@jonringer (nvidia-x11) @primeos @vcunat (mesa) any thoughts on how this might be resolved?

vcunat commented 2 years ago

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

X11 forwarding with OpenGL? I don't expect that's even meant to work.

jonringer commented 2 years ago

The nvidia package doesn't contain a lib/dri/swrast_dri.so failed, the only way I can think of handling this would be to add mesa to hardware.opengl.extraPackages, so that you inherit some of the missing directories like /lib/dri

lapp0 commented 2 years ago

Thanks for responding.

@vcunat virtualgl (via vglconnect and vglrun) is supposed to handle 3D rendering on the server, and then the 2D stuff is rendered on the clients forwarded X server.

@jonringer I did that, but I still have the same error. (hardware.opengl.extraPackages = [ pkgs.mesa ];)

Mesa doesn't appear to have that library:

 find /nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/share
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/share/drirc.d
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/share/drirc.d/00-mesa-defaults.conf
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib/libglapi.so
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib/libglapi.so.0.0.0
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib/libgbm.so.1
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib/libgbm.so
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib/libgbm.so.1.0.0
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/lib/libglapi.so.0
/nix/store/5j7k2nrgvl6vnichkg4c1fwj1907nvgg-mesa-21.3.5/etc

Anything you would recommend to find the missing library?

jonringer commented 2 years ago

oh sorry, it's pkgs.mesa.drivers

lapp0 commented 2 years ago

Thanks! That resolved the error when I simply run glxgears on my server.

Do you have any insights into why I might get the "fbconfig" error when I run it in vglrun?

$ TVNC_WM=/run/current-system/sw/bin/twm vncserver

Desktop 'TurboVNC: host:2 (remote)' started on display host:2

Starting applications specified in /home/user/.vnc/xstartup.turbovnc
Log file is /home/user/.vnc/host:2.log

$ cat /home/user/.vnc/host:2.log | grep running
18/02/2022 03:15:45 VNC extension running!

$ vglrun -d :2 glxgears
[VGL] NOTICE: Automatically setting VGL_CLIENT environment variable to
[VGL]    192.168.1.12, the IP address of your SSH client.
Error: couldn't get an RGB, Double-buffered visual

Seems turbovnc has the drivers linked already

nix-store -q --references $(which vncviewer) | grep drivers
/nix/store/2gl456ql1g1pj9qwkgkpjajknc1j702h-mesa-21.3.5-drivers

However virtualgl doesn't

$ nix-store -q --references $(which vglrun) | xargs nix-store -q --references | uniq
/nix/store/4s21k8k7p1mfik0b33r2spq5hq7774k1-glibc-2.33-108
/nix/store/6pdb0rz2w2hsfsy66kwrbz67jd424wv7-libX11-1.7.2
/nix/store/a3yw11i2iskvr1zx2za4mwrj9sawq7hz-libXext-1.3.4
/nix/store/5lzlfgrc37wqj400b4qgpaa6kc9d2wr1-libglvnd-1.4.0
/nix/store/ndnqiz3nnifj1blhg9q626xlmkqq1nmh-gcc-10.3.0-lib
/nix/store/04yj0nllw5bqzzlay5m6zzbmyw7csgnk-glu-9.0.2
/nix/store/a6i6c7hkfn5s9bbgc1x6j1cnd5dppzkv-libjpeg-turbo-2.1.2
/nix/store/pi2h6nky70gww75w05zq1ch9fmycrvvy-libGL-1.4.0
/nix/store/0yb5b9wq3y7wn5l9akcz7hcyyk2bc6rk-fltk-1.3.8
/nix/store/1dw67iap73klp5rqcvqpf8sadrvr8y8d-ocl-icd-2.3.1
/nix/store/n8k71gd1a759s9mmi85iinfdb0ckkzkv-glibc-2.33-108
/nix/store/fp08p7c881knk9h135vj1acb47q218id-gcc-10.3.0-lib
/nix/store/1l82d038523bapkkc0qkgjyzdblfxbri-gcc-10.3.0
/nix/store/290xnrwys55hbnv9xggcc98q2sfgqf6g-libXtst-1.2.3
/nix/store/2dv93bbc06c7zg866qid73j3r36zz3jx-gcc-10.3.0
/nix/store/4k40gdgf7ckimb3hlwywx76dj5435ack-libXv-1.0.11
/nix/store/cmq9rapgxx18h99r0yp6vvzk1fkwjs3j-libX11-1.7.2
/nix/store/nca9ls2cla27qal0p01k2g17agmd62bf-libXext-1.3.4
/nix/store/64hrj9wbf9yvqwkjwr2r7qsdl99f8wcm-libXtst-1.2.3
/nix/store/hrc96ak11li2czfqj0xf2fc1clpn6gvx-libglvnd-1.4.0
/nix/store/aqj8zmgxvx44r5kf7jnqyyiwwfpbhj0x-libGL-1.4.0
/nix/store/bqkimn04bkknc2ngl01ipmjlq782d7m6-libjpeg-turbo-2.1.2
/nix/store/zhh1ppg81ahlvbf7qlfirj1pzlm8gizr-glu-9.0.2
/nix/store/aa5m1mpvsamdx7pi92fbkfhwh19q62z3-fltk-1.3.8
/nix/store/rycnmssyan6nd1dzas6v6b886qvk663m-ocl-icd-2.3.1
/nix/store/vnm9fwc6hj2igr5as9x2bjwx5nm8g0w8-libXv-1.0.11
/nix/store/nicc84inpa08zi5m52l30nfbp411apnw-virtualgl-lib-2.6.5
/nix/store/sp7fy3jh5ikc2f0g61h164nn3vvcky4a-virtualgl-lib-2.6.5
nix-store -q --references /run/opengl-driver
/nix/store/2gl456ql1g1pj9qwkgkpjajknc1j702h-mesa-21.3.5-drivers
/nix/store/vlp25l161q65qnm8my6zj9i87gkfh748-nvidia-x11-510.47.03-5.16.8

For now I'm trying to recreate the virtualgl package definition with pkgs.mesa.drivers included.

lapp0 commented 2 years ago

export LD_LIBRARY_PATH="/run/opengl-driver/lib:/run/opengl-driver-32/lib" resulted in vglrun -d :2 glxgears rendering a black screen rather than an error, so it seems I have an issue that is likely unrelated now. Thanks so much for getting me past that hurdle!

vcunat commented 2 years ago

That's not how finding OpenGL is supposed to work in NixOS (but we did use it in past). Nowadays it should be indirected through libglvnd. (well, I have no idea about virtualgl in particular...)

dschrempf commented 2 years ago

FYI: I use nixos-unstable as my system flake. Stuff works fine when running, e.g., nix run nixos-unstable#glxinfo. However, if I use an older flake such as nix run nixos-21.11#glxinfo, I get the same errors mentioned in this thread.

I bumped into this because nixos-unstable#calibre is broken at the moment, and I cannot run nixos-21-.11#calibre either.

vcunat commented 2 years ago

I know it's a tangential topic, but as for workarounds for such cases, I'd:

dschrempf commented 2 years ago

Thank you for tthis tip! I can build calibre, but I get the same GLX error.Failed to finding matching FBConfig.

vcunat commented 2 years ago

For reference, the above calibre starts up without any errors on my 21.11 system.

dschrempf commented 2 years ago

Indeed, that's interesting...

3rd commented 2 years ago

The issue is back for kitty as well.

jeff-hykin commented 1 year ago

One year later, sadly still a problem. I've hit it with alacritty and realsense-viewer. Previously, multiple times, nixGL solved it for alacritty for me, but have issues with that currently. And as for realsense-viewer, nixGL doesn't work on arm which is where I'm using the realsense-viewer.

3rd commented 1 year ago

One year later, sadly still a problem. I've hit it with alacritty and realsense-viewer. Previously, multiple times, nixGL solved it for alacritty for me, but have issues with that currently. And as for realsense-viewer, nixGL doesn't work on arm which is where I'm using the realsense-viewer.

I just got used to rebooting after upgrading, and it's not always needed.

jeff-hykin commented 1 year ago

I just got used to rebooting after upgrading, and it's not always needed.

Rebooting doesn't work in my case.

If anyone knows where the error is being thrown (source code), I'm be interested in digging into the problem. For reproducability, I've also uploaded a 32Gb bootable image for a raspberry pi 3b here username: csce635 password bumpnrun (obviously there's no sensitive information on it)

greenm01 commented 1 year ago

I'm encountering this exact same error almost 4 years later.....

greenm01 commented 1 year ago

I'm encountering this exact same error almost 4 years later.....

I followed the rabbit hole on this thread and solved the problem as so:

The issue was an out of date home-manager flake in ~/.config/home-manager

nix flake update home-manager switch

Boom, problem solved!

ditsuke commented 5 months ago

Reproduced on nixpkgs 1a9df4f74273f90d04e621e8516777efcec2802a, on Fedora 40. Neither Kitty nor Alacrity work.

vcunat commented 5 months ago

On Fedora it will be more like topics around #9415