This commit is contained in:
Pablo Castellazzi 2026-01-06 08:25:49 +01:00 committed by GitHub
commit 44251103f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -173,6 +173,11 @@ fi
# WSL2 only supports GPUs via nvidia passthrough
# so check for nvidia-smi to determine if GPU is available
if [ "$IS_WSL2" = true ]; then
# WSL2 has nvidia-smi installed by default,
# we add its folder to the end of the PATH as a fallback.
if [ -x /usr/lib/wsl/lib/nvidia-smi ]; then
export PATH=${PATH}:/usr/lib/wsl/lib
fi
if available nvidia-smi && [ -n "$(nvidia-smi | grep -o "CUDA Version: [0-9]*\.[0-9]*")" ]; then
status "Nvidia GPU detected."
fi