]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix device index in gdb.rocm/addr-bp-gpu-no-deb-info.exp
authorLuis Machado <luis.machado@amd.com>
Wed, 29 Oct 2025 10:07:08 +0000 (10:07 +0000)
committerLuis Machado <luis.machado@amd.com>
Thu, 30 Oct 2025 15:09:42 +0000 (15:09 +0000)
On a system with a single GPU, I spotted this test failing. The environment
variable ROCR_VISIBLE_DEVICES can be a bit misleading, as it actually expects
a list of device id's as opposed to a literal number of devices to make
visible.

This test sets it to 1, which is the second GPU on the system. As a result,
systems with a single GPU will have no visible GPU's and the test will FAIL.

Set ROCR_VISIBLE_DEVICES to 0 to make use of the first GPU on the system.

Approved-By: Lancelot Six <lancelot.six@amd.com> (AMDGPU)
gdb/testsuite/gdb.rocm/addr-bp-gpu-no-deb-info.exp

index be459673dc90dc8b7870c7565745e04a1c874e4d..2719f0d8b1380b538881c0d929a05d33d01edf00 100644 (file)
@@ -28,9 +28,10 @@ if {[build_executable "failed to prepare" $testfile $srcfile {hip}]} {
 
 clean_restart $::testfile
 
-# We may have multiple GPUs, resulting in many possible locations. This is
-# needed to ensure we get a single address to break on.
-gdb_test_no_output "set environment ROCR_VISIBLE_DEVICES=1"
+# We may have multiple GPUs, resulting in many possible locations.  This is
+# needed to ensure we get a single address to break on, so make device 0 the
+# only visible one.
+gdb_test_no_output "set environment ROCR_VISIBLE_DEVICES=0"
 
 # Make the HIP runtime load all the GPU code objects during initialization.
 gdb_test_no_output "set environment HIP_ENABLE_DEFERRED_LOADING=0"