From 57abc5be0299bf5c9dcdbfbb57711ba788b9d75d Mon Sep 17 00:00:00 2001 From: Leonard Nielsen Date: Wed, 23 Aug 2023 16:49:22 +0200 Subject: [PATCH 1/3] Append EGL vendor dirs directly in Mesa easyblock --- easybuild/easyblocks/m/mesa.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/easybuild/easyblocks/m/mesa.py b/easybuild/easyblocks/m/mesa.py index 02e179678a..9267ee4455 100644 --- a/easybuild/easyblocks/m/mesa.py +++ b/easybuild/easyblocks/m/mesa.py @@ -179,3 +179,11 @@ def sanity_check_step(self): custom_paths['files'].extend(swr_arch_libs) super(EB_Mesa, self).sanity_check_step(custom_paths=custom_paths) + + def make_module_extra(self, *args, **kwargs): + """ Append to EGL vendor library path, + so that any NVidia libraries take precedence. """ + txt = '' + txt += self.module_generator.append_paths('__EGL_VENDOR_LIBRARY_DIRS', 'share/glvnd/egl_vendor.d') + txt += super(EB_Mesa, self).make_module_extra(*args, **kwargs) + return txt From 7d19e8c1781747a66b9f85a24ea8399ec400dbc6 Mon Sep 17 00:00:00 2001 From: Leonard Nielsen Date: Wed, 23 Aug 2023 17:28:45 +0200 Subject: [PATCH 2/3] Fix whitespace, add comment --- easybuild/easyblocks/m/mesa.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/easybuild/easyblocks/m/mesa.py b/easybuild/easyblocks/m/mesa.py index 9267ee4455..f1cbce1e23 100644 --- a/easybuild/easyblocks/m/mesa.py +++ b/easybuild/easyblocks/m/mesa.py @@ -181,9 +181,10 @@ def sanity_check_step(self): super(EB_Mesa, self).sanity_check_step(custom_paths=custom_paths) def make_module_extra(self, *args, **kwargs): - """ Append to EGL vendor library path, + """ Append to EGL vendor library path, so that any NVidia libraries take precedence. """ txt = '' + # Append rather than prepend path to ensure that system NVidia drivers have priority. txt += self.module_generator.append_paths('__EGL_VENDOR_LIBRARY_DIRS', 'share/glvnd/egl_vendor.d') txt += super(EB_Mesa, self).make_module_extra(*args, **kwargs) return txt From 85dbf9191608e96ebe7319cc4a82b88741aeec15 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Tue, 5 Sep 2023 19:22:33 +0200 Subject: [PATCH 3/3] trivial code style cleanup in make_module_extra of Mesa easyblock --- easybuild/easyblocks/m/mesa.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/easybuild/easyblocks/m/mesa.py b/easybuild/easyblocks/m/mesa.py index f1cbce1e23..897faacbaa 100644 --- a/easybuild/easyblocks/m/mesa.py +++ b/easybuild/easyblocks/m/mesa.py @@ -183,8 +183,7 @@ def sanity_check_step(self): def make_module_extra(self, *args, **kwargs): """ Append to EGL vendor library path, so that any NVidia libraries take precedence. """ - txt = '' + txt = super(EB_Mesa, self).make_module_extra(*args, **kwargs) # Append rather than prepend path to ensure that system NVidia drivers have priority. txt += self.module_generator.append_paths('__EGL_VENDOR_LIBRARY_DIRS', 'share/glvnd/egl_vendor.d') - txt += super(EB_Mesa, self).make_module_extra(*args, **kwargs) return txt