Skip to content

Commit

Permalink
Merge branch 'main' of github.com:casys-kaist/glet into main
Browse files Browse the repository at this point in the history
  • Loading branch information
csb1024 committed Jul 5, 2023
2 parents b32fa12 + e7b0ed4 commit 697421a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
10 changes: 6 additions & 4 deletions scripts/shutdown_MPS.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/bin/bash
if [ -z "$1" ]
then
echo "number of GPUs not given "
exit
echo "Number of GPUs not given! The sript will use nvidia-smi to detect number of GPUs "
NUM=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)

else
NUM=$1
NUM=$((NUM-1))
fi

NUM=$((NUM-1))

pkill proxy # for killing proxy servers remaining in the system
for i in `seq 0 $NUM`
do
sudo nvidia-smi -i $i -c DEFAULT
done
echo quit | nvidia-cuda-mps-control

echo "MPS shutdown complete"
11 changes: 5 additions & 6 deletions scripts/start_MPS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

if [ -z "$1" ]
then
echo "number of GPUs not given "
exit
echo "Number of GPUs not given! The sript will use nvidia-smi to detect number of GPUs "
NUM=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)
else
NUM=$1
NUM=$((NUM-1))
fi

echo "Starting MPS on $NUM GPUs"
NUM=$((NUM-1))
GPUS=`seq 0 $NUM`

export CUDA_VISIBLE_DEVICES=$GPUS
Expand All @@ -26,6 +26,5 @@ export CUDA_MPS_LOG_DIRECTORY=/tmp/nvidia-log # Select a location that’s acces

nvidia-cuda-mps-control -d # Start the daemon


echo "start_server -uid $(id -u sbchoi)" | nvidia-cuda-mps-control # start server manually

echo "MPS initiation complete"

0 comments on commit 697421a

Please sign in to comment.