rocm_agent_enumerator may invoke rocminfo. Rocminfo opens the
GPU device which allocates limited resource. Beyond 254
concurrent processes this resource will be exhausted and rocminfo
will return an error.
This patch loops rocm_agent_enumerator when recieving a failure
message from rocminfo indicating KFD is out of memory.
Change-Id: I8637e214f5fa012642975c28578ae6bf9200eda8
New versions of amdkfd include the gfx architecture version number
for all GPUs surfaced in the HSA topology. This patch adds this as
the preferred way for rocm_agent_enumerator to check for supported
gfx architecture numbers.
Kernels that are missing this feature will not have the value in
the topology. rocm_agent_enumerator will fall back to checking
against the PCI IDs in this case. If PCI IDs fail, we fall back
to the heavyweight rocminfo method.
Change-Id: I5cf22e1069114675092e97ae52331b829cfafb04
rocminfo is a very heavyweight mechanism for learning a lot of
information about the GPUs that are attached to the system.
It opens up the limited /dev/kfd resource to gather lots of
information about each device, while rocm_agent_enumerator really
only wants the gfx number of AMD devices attached to the system.
To avoid this heavyweight lookup in most cases, this patch switches
the order of tests. Rather than starting with rocminfo and then
falling back to a poorly-maintained PCI ID list, this patch changes
the agent enumerator to start by checking in the PCI ID list (fast
case) and then falling back to rocminfo (slow case) if the PCI ID
list is out of date.
Change-Id: If24b8bc3baeeb6adad362abbb288ef3728383bce
The PCI ID backup method in rocm_agent_enumerator, where the
tool uses lspci to find all AMD GPU devices in the system and
manaully match them to gfx version, is extremely outdated. The
PCI ID list did not include anything after Vega 10, and the
actual call to lspci no longer returned anything due to some
missing conversions.
The patch adds all GPUs that might be needed by ROCr up through
Navy Flounder. The PCI ID to gfx matching pulls from the amdgpu
driver and libhsakmt.
Change-Id: I58b77bb6aa631f575352fc444d2542f265909706
On Ubuntu 20.04, there is no more python or python2. Currently I get
this: /usr/bin/env: ‘python’: No such file or directory
Change-Id: Ib310b8aa7c1bd62973ef3cc8bcaf571831ad4435
This is a python port of rocm_agent_enumerator, which is used by HIP/HCC to
determine available AMDGPU targets on a system.
Its previous implementation was written in C++ which makes it somewhat hard to
deploy onto different distros / architectures. A python port should remove such
issue.