Skip to content

Commit c221806

Browse files
committed
Add support for running AMD GPU benchmarks
- AMD GPU benchmarks works on rocm platform (tested on rocm 6.1.1) and offers support of using CUDA api with AMD gpus - only code change is needed is to test.sh to check whether rocm-smi tool is available and whether it returns AMD GPUs - rocm-smi can be used to query the AMD gpu count - I had pytorch 2.3.0 and pytorch vision 0.18.0 installed with AMD rocm support enabled and all tests executed without errors on AMD RX 6800 Signed-off-by: Mika Laitio <[email protected]>
1 parent dfb532a commit c221806

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

test.sh

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
#! /bin/bash
2-
count=`nvidia-smi --query-gpu=name --format=csv,noheader | wc -l`
3-
4-
echo 'start'
5-
for (( c=$count; c>=1; c-- ))
6-
do
7-
python3 benchmark_models.py -g $c&& &>/dev/null
8-
done
9-
echo 'end'
2+
3+
if [ -x "$(command -v rocm-smi)" ]; then
4+
count=`rocm-smi --showproductname --json | wc -l`
5+
6+
echo 'AMD gpu benchmarks starting'
7+
echo "GPU count: " ${count}
8+
for (( c=$count; c>=1; c-- ))
9+
do
10+
python3 benchmark_models.py -g $c&& &>/dev/null
11+
done
12+
echo 'AMD GPU benchmarks finished'
13+
fi
14+
15+
if [ -x "$(command -v nvidia-smi)" ]; then
16+
count=`nvidia-smi --query-gpu=name --format=csv,noheader | wc -l`
17+
18+
echo 'NVidia gpu benchmarks starting'
19+
echo "GPU count: " ${count}
20+
for (( c=$count; c>=1; c-- ))
21+
do
22+
python3 benchmark_models.py -g $c&& &>/dev/null
23+
done
24+
echo 'Nvidia GPU benchmarks finished'
25+
fi

0 commit comments

Comments
 (0)