summaryrefslogtreecommitdiff
path: root/lib/spack/docs/gpu_configuration.rst
diff options
context:
space:
mode:
authorBillae <65948826+Billae@users.noreply.github.com>2023-12-05 12:59:41 +0100
committerGitHub <noreply@github.com>2023-12-05 12:59:41 +0100
commiteb9c63541af676210052d493dc3dd72b3af28f19 (patch)
tree9e0e0e555f6aa97f3ddc3ab853a85e8ab57d523e /lib/spack/docs/gpu_configuration.rst
parentb9f4d9f6fcfbdc993bc8569b8e4458ef93e3c814 (diff)
downloadspack-eb9c63541af676210052d493dc3dd72b3af28f19.tar.gz
spack-eb9c63541af676210052d493dc3dd72b3af28f19.tar.bz2
spack-eb9c63541af676210052d493dc3dd72b3af28f19.tar.xz
spack-eb9c63541af676210052d493dc3dd72b3af28f19.zip
documentation: add instructions on how to use external opengl (#40987)
Diffstat (limited to 'lib/spack/docs/gpu_configuration.rst')
-rw-r--r--lib/spack/docs/gpu_configuration.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/spack/docs/gpu_configuration.rst b/lib/spack/docs/gpu_configuration.rst
index 1f807bb3b8..610431342f 100644
--- a/lib/spack/docs/gpu_configuration.rst
+++ b/lib/spack/docs/gpu_configuration.rst
@@ -111,3 +111,28 @@ CUDA is split into fewer components and is simpler to specify:
prefix: /opt/cuda/cuda-11.0.2/
where ``/opt/cuda/cuda-11.0.2/lib/`` contains ``libcudart.so``.
+
+
+
+-----------------------------------
+Using an External OpenGL API
+-----------------------------------
+Depending on whether we have a graphics card or not, we may choose to use OSMesa or GLX to implement the OpenGL API.
+
+If a graphics card is unavailable, OSMesa is recommended and can typically be built with Spack.
+However, if we prefer to utilize the system GLX tailored to our graphics card, we need to declare it as an external. Here's how to do it:
+
+
+.. code-block:: yaml
+
+ packages:
+ libglx:
+ require: [opengl]
+ opengl:
+ buildable: false
+ externals:
+ - prefix: /usr/
+ spec: opengl@4.6
+
+Note that prefix has to be the root of both the libraries and the headers, using is /usr not the path the the lib.
+To know which spec for opengl is available use ``cd /usr/include/GL && grep -Ri gl_version``.