Unable to find GPU

I’m trying to work through the Bevy tutorial on NixOS, in an environment provided by a flake.

I’m running into this problem:

thread 'main' panicked at 'Unable to find a GPU! Make sure you have installed required drivers!',

How should I go about solving this problem?

Try this GitHub - nix-community/nixGL: A wrapper tool for nix OpenGL application [maintainer=@guibou]

I got same error on my laptop with AMD GPU. This commit explains how I got it to work with some links. For me it was a lot of trial and error. I hope it will help you.

Let me know if I can clarify anything.

Ah, yes, sorry, I was going to mention that I’m familiar with nixGL, that I have tried to apply it to this problem, and that it seems to address an orthogonal problem … but in the end I forgot.

Thanks, this gave me enough to go on to fix the problem.

In summary, after spending some time on testing exactly what was needed were, I ended up with


    • pkgs.xorg.libX11
    • pkgs.xorg.libXcursor
    • pkgs.xorg.libXi
    • pkgs.xorg.libXrandr
    • pkgs.vulkan-loader
  • in the devShell’s buildInputs

    • pkgs.udev
    • pkgs.alsa-lib
    • pkgs.pkgconfig

Note: no wayland

because I don't use Wayland

Because I use XMonad, which is not compatible with Wayland.

And XMonad is the most stable and reliable piece of software I am aware of using. After having configured the hell out of it to my liking back around 2009, I have fiddled with the odd keybinding every 3 years or so. Apart from that, XMonad has Just Worked for me without any problems, crashes, modifications, maintenance, all while performing a key role in my daily ergonomics. This is in such stark contrast to the overwhelming majority of other software I rely on … so you can prise XMonad from my cold, dead fingers.

Hence, no Wayland for me!