From 5156381581db07c0396f8cd0c0056d931e4e60d2 Mon Sep 17 00:00:00 2001 From: hzy46 <362583303@qq.com> Date: Fri, 5 Mar 2021 17:56:25 +0800 Subject: [PATCH 1/3] fix --- .../requirement/computing-devices/nvidia.com_gpu/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml index f5f4dad484..72cb72732e 100644 --- a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml +++ b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml @@ -53,7 +53,7 @@ when: # if nvidia-smi doesn't work, we can skip this step - nvidia_smi.rc == 0 - - "nvidia_gpu_count.stdout_lines[0]|int != computing_device_count" + - 'nvidia_gpu_count.stdout_lines|join("")|trim|int != computing_device_count' - nvidia_gpu_count.rc == 0 - name: "Check default docker runtime" From 997eeee136d37b1575961c70bf8b4c80f2bb04f2 Mon Sep 17 00:00:00 2001 From: hzy46 <362583303@qq.com> Date: Mon, 8 Mar 2021 10:44:53 +0800 Subject: [PATCH 2/3] fix --- .../computing-devices/nvidia.com_gpu/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml index 72cb72732e..2d9023cda1 100644 --- a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml +++ b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml @@ -46,14 +46,14 @@ - name: "Check NVIDIA GPU card number is matched or not" set_fact: - unmet_requirements: "{{ unmet_requirements + [\"NVIDIA GPU card number is not matched: {{ computing_device_count }} specified but only {{ nvidia_gpu_count.stdout_lines[0] }} found\"] }}" + unmet_requirements: "{{ unmet_requirements + [\"NVIDIA GPU card number is not matched: {{ computing_device_count }} specified but only {{ nvidia_gpu_count.stdout|trim }} found\"] }}" changed_when: false check_mode: false environment: {} when: # if nvidia-smi doesn't work, we can skip this step - nvidia_smi.rc == 0 - - 'nvidia_gpu_count.stdout_lines|join("")|trim|int != computing_device_count' + - 'nvidia_gpu_count.stdout|trim|int != computing_device_count' - nvidia_gpu_count.rc == 0 - name: "Check default docker runtime" From 99be5b20462c34181d7a255c7304178796b7a637 Mon Sep 17 00:00:00 2001 From: hzy46 <362583303@qq.com> Date: Mon, 8 Mar 2021 10:47:01 +0800 Subject: [PATCH 3/3] fix --- .../requirement/computing-devices/nvidia.com_gpu/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml index 2d9023cda1..bc2d2771c6 100644 --- a/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml +++ b/contrib/kubespray/roles/requirement/computing-devices/nvidia.com_gpu/tasks/main.yml @@ -46,7 +46,7 @@ - name: "Check NVIDIA GPU card number is matched or not" set_fact: - unmet_requirements: "{{ unmet_requirements + [\"NVIDIA GPU card number is not matched: {{ computing_device_count }} specified but only {{ nvidia_gpu_count.stdout|trim }} found\"] }}" + unmet_requirements: "{{ unmet_requirements + [\"NVIDIA GPU card number is not matched: {{ computing_device_count }} specified but {{ nvidia_gpu_count.stdout|trim }} found\"] }}" changed_when: false check_mode: false environment: {}