Skip to content

Commit d052aa6

Browse files
committed
Fix build due to missing rocm-smi
1 parent c61d238 commit d052aa6

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

build_tools/rocm/run_xla.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ set -x
2424
N_BUILD_JOBS=$(grep -c ^processor /proc/cpuinfo)
2525
# If rocm-smi exists locally (it should) use it to find
2626
# out how many GPUs we have to test with.
27-
rocm-smi -i
28-
STATUS=$?
29-
if [ $STATUS -ne 0 ]; then TF_GPU_COUNT=1; else
30-
TF_GPU_COUNT=$(rocm-smi -i|grep 'Device ID' |grep 'GPU' |wc -l)
31-
fi
27+
TF_GPU_COUNT=$(/opt/rocm/bin/rocminfo -i | grep 'gfx' | wc -l)
3228
TF_TESTS_PER_GPU=1
3329
N_TEST_JOBS=$(expr ${TF_GPU_COUNT} \* ${TF_TESTS_PER_GPU})
34-
amdgpuname=(`rocminfo | grep gfx | head -n 1`)
30+
amdgpuname=(`/opt/rocm/bin/rocminfo | grep gfx | head -n 1`)
3531
AMD_GPU_GFX_ID=${amdgpuname[1]}
3632
echo ""
3733
echo "Bazel will use ${N_BUILD_JOBS} concurrent build job(s) and ${N_TEST_JOBS} concurrent test job(s) for gpu ${AMD_GPU_GFX_ID}."
@@ -41,7 +37,7 @@ export PYTHON_BIN_PATH=`which python3`
4137
export TF_NEED_ROCM=1
4238
export ROCM_PATH="/opt/rocm"
4339

44-
GPU_NAME=(`rocminfo | grep -m 1 gfx`)
40+
GPU_NAME=(`/opt/rocm/bin/rocminfo | grep -m 1 gfx`)
4541
GPU_NAME=${GPU_NAME[1]}
4642

4743
EXCLUDED_TESTS=(

build_tools/rocm/run_xla_multi_gpu.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,20 @@ set -x
3535
N_BUILD_JOBS=$(grep -c ^processor /proc/cpuinfo)
3636
# If rocm-smi exists locally (it should) use it to find
3737
# out how many GPUs we have to test with.
38-
rocm-smi -i
39-
STATUS=$?
40-
if [ $STATUS -ne 0 ]; then TF_GPU_COUNT=1; else
41-
TF_GPU_COUNT=$(rocm-smi -i|grep 'Device ID' |grep 'GPU' |wc -l)
42-
fi
38+
TF_GPU_COUNT=$(/opt/rocm/bin/rocminfo -i | grep 'gfx' | wc -l)
4339
if [[ $TF_GPU_COUNT -lt 4 ]]; then
4440
echo "Found only ${TF_GPU_COUNT} gpus, multi-gpu tests need atleast 4 gpus."
4541
exit
4642
fi
4743

48-
amdgpuname=(`rocminfo | grep gfx | head -n 1`)
44+
amdgpuname=(`/opt/rocm/bin/rocminfo | grep gfx | head -n 1`)
4945
AMD_GPU_GFX_ID=${amdgpuname[1]}
5046

5147
export PYTHON_BIN_PATH=`which python3`
5248
export TF_NEED_ROCM=1
5349
export ROCM_PATH="/opt/rocm"
5450

55-
GPU_NAME=(`rocminfo | grep -m 1 gfx`)
51+
GPU_NAME=(`/opt/rocm/bin/rocminfo | grep -m 1 gfx`)
5652
GPU_NAME=${GPU_NAME[1]}
5753

5854
BAZEL_DISK_CACHE_SIZE=100G

0 commit comments

Comments
 (0)