Skip to content

Add libglvnd packages/Add EGL support#14572

Merged
chuckatkins merged 13 commits intospack:developfrom
opadron:package/libglvnd-rework
Jul 13, 2020
Merged

Add libglvnd packages/Add EGL support#14572
chuckatkins merged 13 commits intospack:developfrom
opadron:package/libglvnd-rework

Conversation

@opadron
Copy link
Copy Markdown
Member

@opadron opadron commented Jan 20, 2020

  • Adds a new package: libglvnd-frontend for exposing libglvnd-backed GL implementations in a way that plays well with Spack's packaging model.
  • Updates packages opengl and mesa to include libglvnd support.
  • Updates package paraview to include egl support.
  • Updates Spack-wide packages configuration to include libglvnd entries for gl, glx, and egl virtual packages.

TODO:

  • Add documentation discussing what libglvnd is, why it's packaged the way it is, and how to set up an external opengl or mesa that was built for libglvnd.

@opadron
Copy link
Copy Markdown
Member Author

opadron commented Jan 20, 2020

Confirmed working with #14372 using the following config files for an external opengl:

packages.yaml

---
packages:
  opengl:
    paths:
      [email protected]+egl+glx+glvnd: /usr
    variants: +glvnd+egl+glx
    buildable: False

modules.yaml

---
modules:
  tcl:
    [email protected]+glx+glvnd:
      environment:
        set:
          __GLX_VENDOR_LIBRARY_NAME: nvidia
    [email protected]+egl+glvnd:
      environment:
        set:
          __EGL_VENDOR_LIBRARY_FILENAMES: /usr/share/glvnd/egl_vendor.d/10_nvidia.json

@chuckatkins
Copy link
Copy Markdown

Confirmed working with #14372

Marked as dont-merge-yet until the necessary dependent feature is merged.

modules.yaml

---
modules:
  tcl:
    [email protected]+glx+glvnd:
      environment:
        set:
          __GLX_VENDOR_LIBRARY_NAME: nvidia
    [email protected]+egl+glvnd:
      environment:
        set:
          __EGL_VENDOR_LIBRARY_FILENAMES: /usr/share/glvnd/egl_vendor.d/10_nvidia.json

So, this is interesting. Would there be two different entries? It seems like that would give two different specs and that you might just have a single entry:

modules.yaml

---
modules:
  tcl:
    [email protected]+egl+glx+glvnd:
      environment:
        set:
          __EGL_VENDOR_LIBRARY_FILENAMES: /usr/share/glvnd/egl_vendor.d/10_nvidia.json
          __GLX_VENDOR_LIBRARY_NAME: nvidia

@opadron
Copy link
Copy Markdown
Member Author

opadron commented Jan 21, 2020

@chuckatkins my understanding is that these entries are not mutually exclusive. The way to read my modules.yaml is "If the current module being generated is for a package that matches [email protected]+glx+glvnd (i.e.: opengl 4.5 with glx through libglvnd), add the following __GLX variable." And then subsequently: "If the current module being generated is for a package that matches [email protected]+egl+glvnd (i.e.: opengl 4.5 with egl through libglvnd), add the following __EGL variable." An opengl with both +glx and +egl through +glvnd would match both entries and have both variables added to its module.

EDIT: Of course, your suggestion would work fine, too, if you only ever dealt with opengl specs that had both +glx and +egl (with +glvnd).

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Feb 18, 2020

@opadron I tried to rebase this branch locally on f396106 and this is the module I get using the configs mentioned at #14572 (comment):

#%Module1.0
## Module file created by spack (https://github.com/spack/spack) on 2020-02-18 18:35:40.269362
##
## [email protected]%[email protected]+egl+glvnd+glx arch=linux-ubuntu18.04-broadwell/hflpxtp
##
## Configure options: unknown, software installed outside of Spack
##


module-whatis "Placeholder for external OpenGL libraries from hardware vendors"

proc ModulesHelp { } {
puts stderr "Placeholder for external OpenGL libraries from hardware vendors"
}


prepend-path MANPATH "/usr/share/man"
prepend-path ACLOCAL_PATH "/usr/share/aclocal"
prepend-path PKG_CONFIG_PATH "/usr/lib/pkgconfig"
prepend-path PKG_CONFIG_PATH "/usr/share/pkgconfig"
setenv __GLX_VENDOR_LIBRARY_NAME "nvidia"
setenv __EGL_VENDOR_LIBRARY_FILENAMES "/usr/share/glvnd/egl_vendor.d/10_nvidia.json"

It seems fine to me.

@opadron
Copy link
Copy Markdown
Member Author

opadron commented Feb 18, 2020

@alalazo I cannot reproduce this behavior on the latest spack/centos7 image. I've tried both develop and this branch rebased on develop.

Are you using lmod for modules? The docker image uses that instead of TCL modules.

EDIT: In particular, I cannot get Spack to add any environment variables to any generated modules. I've tried opengl and simple packages like zlib.

spack --version

0.13.4-1177-4e1cbd7

@opadron
Copy link
Copy Markdown
Member Author

opadron commented Mar 19, 2020

@chuckatkins PTAL. I still need to rebase, but the necessary changes should be there.

Copy link
Copy Markdown

@chuckatkins chuckatkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. I think the documentation is good. It's difficult to convey the details because it's a very complicated situation but I think this works well.

Just need to update a few places in the docs for glvnd-be-* -> libglvnd-be-*. I didn't note all the places here so just take a quick look through to make sure they've all be hit.

Comment thread etc/spack/defaults/packages.yaml Outdated
Comment thread lib/spack/docs/getting_started.rst Outdated
@opadron opadron force-pushed the package/libglvnd-rework branch from dba38cf to eb10644 Compare July 10, 2020 18:00
@opadron
Copy link
Copy Markdown
Member Author

opadron commented Jul 10, 2020

Rebased.

@chuckatkins chuckatkins merged commit 573489d into spack:develop Jul 13, 2020
@opadron opadron deleted the package/libglvnd-rework branch July 15, 2020 15:46
@chuckatkins
Copy link
Copy Markdown

It looks like this was good to go prior to rebasing but something got borked in the rebase. Rather than churning through the things that got left out, we're going to revert this and re-introduce the change set based on develop head.

chuckatkins pushed a commit to chuckatkins/spack that referenced this pull request Jul 23, 2020
chuckatkins pushed a commit that referenced this pull request Jul 23, 2020
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.

3 participants