mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-20 23:05:08 -04:00
fix makefile for multigpu setups
This commit is contained in:
parent
f72c1f2c64
commit
2882ec6b9e
1 changed files with 3 additions and 1 deletions
4
Makefile
4
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue