From c743f5328d5bf84656da4ba4afc384191f9968f4 Mon Sep 17 00:00:00 2001 From: jvino Date: Fri, 26 Jan 2024 14:44:18 +0100 Subject: [PATCH] Fix nvidia toolkit check (#33) * fix: nvidia toolkit check * add: Updated the nvidia driver branch * Improved container inspect --------- Co-authored-by: gioacchino.vino --- tasks/jupyterhub-partitioned-gpus.yml | 4 +++- tasks/main.yml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/jupyterhub-partitioned-gpus.yml b/tasks/jupyterhub-partitioned-gpus.yml index b560b6d..9c6c184 100644 --- a/tasks/jupyterhub-partitioned-gpus.yml +++ b/tasks/jupyterhub-partitioned-gpus.yml @@ -45,8 +45,10 @@ - ' running_containers_ids = client.containers()' - ' for id in running_containers_ids:' - ' my_c = client.inspect_container(id["Id"])' - - ' if my_c["HostConfig"]["DeviceRequests"] is not None:' + - ' try: ' - ' gpu_uuid.add(my_c["HostConfig"]["DeviceRequests"][0]["DeviceIDs"][0])' + - ' except: ' + - ' pass' - ' return gpu_uuid' - 'def get_available_gpu_ids():' - ' all_gpus_ids = get_all_gpus_ids()' diff --git a/tasks/main.yml b/tasks/main.yml index efc3541..2ee34d0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -43,8 +43,8 @@ ansible.builtin.include_tasks: gpu-support.yaml vars: enable_gpu: true - gpu_support_role: git+https://baltig.infn.it/infn-cloud/ansible-role-gpu-support,v1.2.1 - nvidia_driver_branch: "515" + gpu_support_role: git+https://baltig.infn.it/infn-cloud/ansible-role-gpu-support,v1.2.4 + nvidia_driver_branch: "535" nvidia_driver_ubuntu_install_from_cuda_repo: true nvidia_driver_skip_reboot: true when: (use_gpu | bool)