From 3802cb3f01c4474b7a779b81393c9f7f6190cf43 Mon Sep 17 00:00:00 2001 From: Enric Tejedor Saavedra Date: Wed, 24 Apr 2024 13:46:31 +0200 Subject: [PATCH] Move remaining GPU logic into modify pod hook To have all GPU-related logic together in the modify pod hook for computing resources. --- swan-cern/files/swan_computing_config.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/swan-cern/files/swan_computing_config.py b/swan-cern/files/swan_computing_config.py index df9a420..8c2edd7 100644 --- a/swan-cern/files/swan_computing_config.py +++ b/swan-cern/files/swan_computing_config.py @@ -124,6 +124,15 @@ def _modify_pod_for_gpu(self): resources.requests[gpu_resource_name] = '1' resources.limits[gpu_resource_name] = '1' + # Configure OpenCL to use NVIDIA backend + notebook_container.env = self._add_or_replace_by_name( + notebook_container.env, + V1EnvVar( + name='OCL_ICD_FILENAMES', + value='libnvidia-opencl.so.1' + ), + ) + async def _init_hadoop_secret(self): """ Create secret for Spark/Hadoop @@ -267,7 +276,7 @@ def _gpu_enabled(self): """ return True if the user has requested a GPU """ - return self.spawner.gpu_requested() + return "cu" in self.spawner.user_options[self.spawner.lcg_rel_field] def _spark_enabled(self): """