Skip to content

Commit

Permalink
fix for mi300 tpx mode
Browse files Browse the repository at this point in the history
Change-Id: I9aa70501d1aedd277bb41643a2b3ef4fbbcc7c66
  • Loading branch information
gregrodgers authored and ronlieb committed Jun 26, 2024
1 parent dfbfbf7 commit ae81005
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions utils/bin/gpurun
Original file line number Diff line number Diff line change
Expand Up @@ -337,41 +337,46 @@ for _devid in `ls $_sysdevdir` ; do
_this_uuid=`cat $_sysdevdir/$_devid/unique_id`
if [ -z $_this_uuid ] ; then
_this_uuid=0
_has_unique_id=0
_has_unique_id_file=0
else
_this_uuid="GPU-$_this_uuid"
_has_unique_id=1
_has_unique_id_file=1
fi
fi
_this_cpulist=`cat $_sysdevdir/$_devid/local_cpulist`
# Search _ri_ arrays for matching bdfids.
_found_in_ri=0
_match_uuid_count=0
for _ri_i in ${!_ri_bdfids[@]} ; do
if [ $_has_unique_id == 1 ] ; then
_ss_value=$_this_uuid
_ri_value=${_ri_uuid[$_ri_i]}
if [ $_ss_value == $_ri_value ] ; then
_match_uuid_count=$(( $_match_uuid_count + 1 ))
fi
done
# Search _ri_ arrays for matching uuids or matching bdfids.
for _ri_i in ${!_ri_bdfids[@]} ; do
if [ $_has_unique_id_file == 1 ] ; then
_ss_value=$_this_uuid
_ri_value=${_ri_uuid[$_ri_i]}
else
_ss_value=$_devid
_ri_value="0000:${_ri_bdfids[$_ri_i]}.0"
fi
if [ $_ss_value == $_ri_value ] ; then
_found_in_ri=1
_gfxid=${_ri_gfxids[$_ri_i]}
_cucount=${_ri_cucount[$_ri_i]}
# Some GPUs do not have unique_id
[ $_this_uuid == 0 ] && _this_uuid=${_ri_dev_idx[$_ri_i]}
break
if [ $_this_uuid == 0 ] || [ $_match_uuid_count -gt 1 ] ; then
# Some GPUs do not have unique_id or TPX mode creates multiple
# identical uuids, so use device index for RVD
_ss_uuid+=( ${_ri_dev_idx[$_ri_i]} )
else
_ss_uuid+=( $_this_uuid )
fi
_ss_gfxid+=( ${_ri_gfxids[$_ri_i]} )
_ss_cucount+=( ${_ri_cucount[$_ri_i]} )
_ss_bdfid+=( $_devid )
_ss_numanode+=( $_numa_node )
_ss_cpulist+=( $_this_cpulist )
_ss_num_devices=$(( $_ss_num_devices + 1 ))
fi
done
if [ $_found_in_ri == 1 ] ; then
_ss_gfxid+=( $_gfxid )
_ss_cucount+=( $_cucount )
_ss_bdfid+=( $_devid )
_ss_numanode+=( $_numa_node )
_ss_cpulist+=( $_this_cpulist )
_ss_uuid+=( $_this_uuid )
_ss_num_devices=$(( $_ss_num_devices + 1 ))
fi
fi
fi
fi
Expand Down

0 comments on commit ae81005

Please sign in to comment.