Skip to content

Commit

Permalink
[k8s] Fix GPU detection when running with sky local up --ips (#4561)
Browse files Browse the repository at this point in the history
Fix GPU detection with explicit return values
  • Loading branch information
romilbhardwaj authored Jan 15, 2025
1 parent 2db9ae0 commit 065f467
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sky/utils/kubernetes/deploy_remote_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ cleanup_agent_node() {

check_gpu() {
local NODE_IP=$1
run_remote "$NODE_IP" "
if command -v nvidia-smi &> /dev/null; then
nvidia-smi --list-gpus | grep 'GPU 0'
fi
"
if run_remote "$NODE_IP" "command -v nvidia-smi &> /dev/null && nvidia-smi --query-gpu=gpu_name --format=csv,noheader &> /dev/null"; then
return 0 # GPU detected
else
return 1 # No GPU detected
fi
}

# Pre-flight checks
Expand Down

0 comments on commit 065f467

Please sign in to comment.