Skip to content

Commit

Permalink
Move remaining GPU logic into modify pod hook
Browse files Browse the repository at this point in the history
To have all GPU-related logic together in the modify pod hook for
computing resources.
  • Loading branch information
etejedor committed Apr 24, 2024
1 parent 6247ab4 commit 3802cb3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion swan-cern/files/swan_computing_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 3802cb3

Please sign in to comment.