NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

Unable to get EGL working with Intel integrated graphics #169792

Open PAI5REECHO opened 2 years ago

PAI5REECHO commented 2 years ago

Describe the bug

I'm not really sure what's wrong with my system configuration but I'm unable to get EGL working under Wayland or Xorg when it was previously working some days ago. I'm on unstable so maybe I updated something that broke it?

Steps To Reproduce

Steps to reproduce the behavior:

  1. Configure a system with Intel HD 4000 graphics using the following:

    { ... }: {
    environment = {
    variables = {
      MESA_GL_VERSION_OVERRIDE = "4.3";
    };
    };
    
    hardware = {
    opengl = {
      enable = true;
      driSupport = true;
      driSupport32Bit = true;
      extraPackages = with pkgs; [
        vaapiIntel
        vaapiVdpau
        libvdpau-va-gl
      ];
    };
    };
    }
  2. Run eglinfo in SwayWM:
    
    $ echo $DISPLAY $MESA_GL_VERSION_OVERRIDE $WAYLAND_DISPLAY
    :0 4.3 wayland-1
    $ eglinfo
    ...

Device platform: eglinfo: eglInitialize failed


### Expected behavior
EGL should initialize

### Additional context
Normal OpenGL applications work (`glxinfo` reports fine and `glxgears` works)

### Notify maintainers
Not sure who'd be best to ping here since the OpenGL module & `vaapiIntel` package list no maintainers.
@primeos
@colemickens
@Synthetica9
@Ma27 
@abbradar

### Metadata

```console
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.17.1, NixOS, 22.05 (Quokka), 22.05.20220417.1ffba9f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.9.0pre20220420_9345b4e`
sweber83 commented 2 years ago

Not sure if I suffer from the same problem, but since I switched from 21.11 to 22.05, looking-glass-client (which relies on egl) is broken. It quits with this message:

[E]  43025886882               egl.c:677  | egl_renderStartup              | Failed to get EGL display
[E]  43025886884              main.c:152  | renderThread                   | EGL render failed to start

I use a dedicated AMD gpu, no Intel integrated. The same happens on unstable.

edit: I noticed one difference when running eglinfo on 21.11 and unstable. On unstable, I get this error, which is not there on 21.11:

MESA-LOADER: failed to open zink: /run/opengl-driver/lib/dri/zink_dri.so: cannot open shared object file: No such file or directory (search paths /run/opengl-driver/lib/dri, suffix _dri)
failed to load driver: zink
PAI5REECHO commented 2 years ago

Yup, both eglinfo, soundux & looking-glass-client all fail from EGL errors for me

sweber83 commented 2 years ago

@PAI5REECHO For me the issue is resolved. The problem was, that I pinned the looking-glass-client package to a different nixpkgs branch than the rest of the system.

nixos-discourse commented 1 year ago

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

https://discourse.nixos.org/t/im-not-finding-the-correct-intel-driver/34005/6