NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.67k stars 13.81k forks source link

nvidia 390: primusrun broken on 18.09 stable X BadMatch X_GLXSwapBuffers #48795

Closed jasoncarr0 closed 5 years ago

jasoncarr0 commented 5 years ago

Issue description

With an older version of primus, I am able to succesfully run applications. Upgrading to master, or to 18.09 breaks.

The only difference between working and non-working primusrun is the nvidia-x11 path. Working has /nix/store/xbc1m27m16gbbcr9ha4b86iasvg1r73s-nvidia-x11-390.77/lib for me, and non-working has /nix/store/m0idarck89062k2hywdx5fi8ppz4xhil-nvidia-x11-390.87/lib though I'm not sure if that's 32-bit or 64-bit (both versions are different).

The paths for both the primus libs are identical.

$ primusrun glxgears X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 11 (X_GLXSwapBuffers) Serial number of failed request: 37 Current serial number in output stream: 38 primus: warning: dropping a frame to avoid deadlock primus: warning: timeout waiting for display worker terminate called without an active exception [1] 13958 abort primusrun glxgears

I'm able to find similar issues

Steps to reproduce

Set up bumblebeed as normal with nvidia. I have

hardware.bumblebee = { enable = true; driver = "nvidia"; };

Run: nix run -f channel:nixos-18.09 glxinfo primus -c primusrun glxgears

Technical details

filename: /run/current-system/kernel-modules/lib/modules/4.14.74/misc/nvidia.ko alias: char-major-195-* version: 390.87

thiagokokada commented 5 years ago

You can fix this issue by exporting __GLVND_DISALLOW_PATCHING=1, for example:

{
  environment.variables = {
    # Workaround Bumblebee issue.
    # https://github.com/Bumblebee-Project/Bumblebee/issues/971#issuecomment-410386426
    __GLVND_DISALLOW_PATCHING = "1";
  };
}

Maybe Bumblebee's default.nix itself should export this variable?