Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesa_drivers_glvnd: init #34282

Closed
wants to merge 2 commits into from
Closed

mesa_drivers_glvnd: init #34282

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 26, 2018

Motivation for this change

See also #34461

This allows nothing more that co-existing of mesa and proprietary drivers in same /run/opengl-driver/ prefix e.g. for Nvidia Optimus setups. Then correct GL drivers are picked dynamically depending on what X/DRI drivers are used.

cc maintainers @eduarrrd @vcunat

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@ghost ghost changed the title mesa: add libglvnd variant mesa_drivers_glvnd: init Jan 28, 2018
@avnik
Copy link
Contributor

avnik commented Jan 28, 2018

I feel, better to have libglvnd as "default" libGL provider, used to build all software (it have fewer dependencies, than mesa-nonglu, so will be build faster and earlier, so more packages would be built on CI).

Real backend can still be dispatched via /run/opengl-driver symlink. (Backend can be buildEnv of libglvnd enabled mesa and other libglvnd capable implementations. In worst cases user can force real libGL from any non-glvnd compatible package, including old-style mesa builds).

@ghost
Copy link
Author

ghost commented Jan 29, 2018

@avnik

I feel, better to have libglvnd as "default" libGL provider, used to build all software (it have fewer dependencies, than mesa-nonglu, so will be build faster and earlier, so more packages would be built on CI).

We discussed this on IRC already:

vcunat: ... but it's difficult to find time for larger changes (or more risky ones).
gchristensen: it still requires holistic thinking about how it interacts with the rest of the systems

So not now, sorry. The next step is also drop that LD_LIBRARY_PATH=/run/opengl-driver/lib hack, once all drivers are ready to by picked by libglvnd.

@avnik
Copy link
Contributor

avnik commented Jan 29, 2018 via email

@coreyoconnor
Copy link
Contributor

I'm definitely interested in replacing direct mesa references everywhere. With that in mind I started testing this.

I've applied this patch and done the full rebuild of a Plasma 5 desktop:

xserver starts, and reports the expected GLX, but Plasma 5 does not:

Jan 29 09:39:09 grr xsession[29061]: Could not initialize GLX
Jan 29 09:39:09 grr xsession[29061]: CreateNotify: 12582915
Jan 29 09:39:09 grr xsession[29061]: libGL error: unable to load driver: swrast_dri.so
Jan 29 09:39:09 grr xsession[29061]: libGL error: failed to load driver: swrast

I think I've seen that error before but can't recall what the fix was. That said, the Plasma 5 desktop was working (with HW opengl) prior to this patch and enable of GLVND.

Note this config does not use primus.

Checking the /var/run/opengl-driver/lib directory: NVidia libs are present but no libGL.so.

@coreyoconnor
Copy link
Contributor

I think the issue with NVidia with glvnd but no optimus is related to this logic here:

I was able to restore OpenGL by applying this hack of a patch:

@ghost
Copy link
Author

ghost commented Jan 30, 2018

@avnik Unfortunately I'm not in position to implement that, but I would like to be a tester 😃 And we need someone from NixOS team with interest to support and approve that change.

@coreyoconnor Fixed, thank you!

@coreyoconnor
Copy link
Contributor

@gnidorah Thanks! No issues with current commits.

@ghost ghost closed this Feb 3, 2018
@ghost ghost deleted the mesa-glvnd branch February 3, 2018 20:09
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants