Commit Graph

20 Commits

Author SHA1 Message Date
Mark Searles 34cc693bef Fix parsing of rocminfo output for ISAs with no features defined
Patch is an internal port of
 https://github.com/RadeonOpenCompute/rocminfo/pull/59

Change-Id: Iea84f49a60abce73716a7451960c20ee0d2b7bca
2023-03-27 08:56:00 -07:00
Mike Li 3a4d533a1e Check permission and handle PermissionError exception
Signed-off-by: Mike Li <Tianxinmike.Li@amd.com>
Change-Id: If7cb8464d0b761e4be45c85eb7147ceed609da61
2022-08-17 12:23:30 -04:00
David Salinas d8f236cd81 Handle case with no GPUs
Change-Id: I35b8d4d0c0b6e63d9851d56163686794c7bb8c1e
2022-06-17 14:40:44 -04:00
Ashutosh Mishra 6b4d69d011 changeing major_ver of targetlist to decimal
Change-Id: Iada6cf9d2ba3bce4c042dffbf97f1588ffe10a8a
2022-02-03 23:38:24 +05:30
Sean Keely b57c02d131 Handle high levels of concurrency in rocm_agent_enumerator.
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
2021-10-29 20:22:19 -05:00
Joseph Greathouse f419b81bdf Add capability to pull gfx architecture from KFD topology
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
2021-10-29 20:20:04 -05:00
Joseph Greathouse e9b7de43be Switch order of lspci and rocminfo for gfx arch query
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
2021-10-29 20:16:22 -05:00
Joseph Greathouse ea5ce46fb4 Add better PCI ID backup in rocm_agent_enumerator
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
2021-10-29 18:45:23 -05:00
Yi Qian e1df81cb8f Add a new rocm_agent_enumerator option '-name' which lists target names obtained from the output of rocminfo.
Change-Id: Iea366c744e2f03a46fd5c902ae4faa94b96f6942
2021-10-29 16:23:01 -05:00
Matt Arsenault 5d6be5b808 Refer explicitly to python3 in shebang line
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
2020-05-04 09:40:11 -04:00
Chris Freehill 373d8abdec Fix rocm_agent_enumerator on RHEL
This fixes SWDEV-231760

Change-Id: If704c8ff76548e10ddbda1b5c1ad0c28df7ab6f0
2020-04-16 16:39:51 -05:00
Chris Freehill 70ebe13a89 Fix ennumerator id parser.
Fixes SWDEV-226018

Change-Id: I14144cdd316c19fe29dcd70b406a52aac8a741cd
2020-03-06 19:50:35 -05:00
Wilfried Holzke a134847069 Added documentation for the new env var.
Change-Id: I0407a5dd36e91a1ea205ce4dda9a7fca906e1266
2019-12-16 10:38:47 -06:00
Wilfried Holzke 12736c6fd8 Added env var to set target.lst
Change-Id: Ie6aefba6ef79360e65d4a64a6be1ec50e59b5741
2019-12-16 10:37:33 -06:00
justxi cfbbb52395 Add files via upload 2019-06-19 13:44:12 -05:00
Gregory Stoner fd277f36c0 Update rocm_agent_enumerator 2017-12-23 13:09:02 -06:00
Gregory Stoner 57a7080ebb Update rocm_agent_enumerator 2017-12-23 13:01:11 -06:00
Gregory Stoner f5334a2ba3 Add support for RX580 2017-12-23 13:00:37 -06:00
Wen-Heng (Jack) Chung 6d1234484a Improve error handling logic 2017-11-09 13:20:45 -06:00
Wen-Heng (Jack) Chung 8b018900f6 Initial commit to introduce rocm_agent_enumerator into rocminfo
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.
2017-11-09 12:33:53 -06:00