You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log "DEBUG""amd_accelpath: amd-smi command failed, see output in $amd_smi_out"
265
+
return 3
266
+
fi
267
+
else
268
+
log "DEBUG""amd_accelpath: amd-smi command not found"
269
+
return 2
270
+
fi
271
+
}
272
+
178
273
accelpath() {
179
274
# If EESSI_ACCELERATOR_TARGET_OVERRIDE is set, use it
180
275
log "DEBUG""accelpath: Override variable set as '$EESSI_ACCELERATOR_TARGET_OVERRIDE' "
181
276
if [ !-z$EESSI_ACCELERATOR_TARGET_OVERRIDE ];then
182
-
if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE"=~ ^accel/nvidia/cc[0-9]+$ ]];then
183
-
echo${EESSI_ACCELERATOR_TARGET_OVERRIDE}
277
+
# Updated regex to allow both NVIDIA and AMD overrides
278
+
if [[ "$EESSI_ACCELERATOR_TARGET_OVERRIDE"=~ ^accel/(nvidia/cc[0-9]+|amd/gfx[0-9a-f]+)$ ]];then
279
+
echo"$EESSI_ACCELERATOR_TARGET_OVERRIDE"
184
280
return 0
185
281
else
186
-
log "ERROR""Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9]+', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'"
282
+
log "ERROR""Value of \$EESSI_ACCELERATOR_TARGET_OVERRIDE should match 'accel/nvidia/cc[0-9]+' or 'accel/amd/gfx[0-9a-f]+', but it does not: '$EESSI_ACCELERATOR_TARGET_OVERRIDE'"
283
+
return 1
187
284
fi
285
+
fi
286
+
287
+
# 1. Check for NVIDIA GPUs
288
+
local nv_res
289
+
nv_res=$(nvidia_accelpath)
290
+
if [[ $?-eq 0 ]];then
291
+
log "DEBUG""accelpath: result: ${nv_res}"
292
+
echo"$nv_res"
188
293
return 0
189
294
fi
190
295
191
-
# check for NVIDIA GPUs via nvidia-smi command
192
-
nvidia_smi=$(command -v nvidia-smi)
296
+
# 2. Check for AMD GPUs
297
+
local amd_res
298
+
amd_res=$(amd_accelpath)
193
299
if [[ $?-eq 0 ]];then
194
-
log "DEBUG""accelpath: nvidia-smi command found @ ${nvidia_smi}"
0 commit comments