diff --git a/Makefile b/Makefile index 6fa511d..73b8372 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,9 @@ endif ifneq ($(CI),true) # if not in CI, then use the GPU query ifndef GPU_COMPUTE_CAPABILITY # set to defaults if: make GPU_COMPUTE_CAPABILITY= ifneq ($(call file_exists_in_path, nvidia-smi),) - GPU_COMPUTE_CAPABILITY = $(shell nvidia-smi --query-gpu=compute_cap --format=csv,noheader | sed 's/\.//g') + # Get the compute capabilities of all GPUs + # Remove decimal points, sort numerically in ascending order, and select the first (lowest) value + GPU_COMPUTE_CAPABILITY=$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader | sed 's/\.//g' | sort -n | head -n 1) GPU_COMPUTE_CAPABILITY := $(strip $(GPU_COMPUTE_CAPABILITY)) endif endif