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
rocminfo
ROCm Application for Reporting System Info
To Build
Use the standard cmake build procedure to build rocminfo. The location of ROCM root (parent directory containing ROCM headers and libraries) must be provided as a cmake argument using the standard CMAKE_PREFIX_PATH cmake variable.
After cloning the rocminfo git repo, please make sure to do a git-fetch --tags to get the tags residing on the repo. These tags are used for versioning. For example,
$ git fetch --tags origin
Building from the CMakeLists.txt directory might look like this:
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=/opt/rocm ..
make
cd ..
Upon a successful build the binary, rocminfo, and the python script, rocm_agent_enumerator, will be in the build folder.
Execution
"rocminfo" gives information about the HSA system attributes and agents.
"rocm_agent_enumerator" prints the list of available AMD GCN ISA or architecture names. With the option '-name', it prints out available architectures names obtained from rocminfo. Otherwise, it generates ISA in one of four different ways:
-
ROCM_TARGET_LST : a user defined environment variable, set to the path and filename where to find the "target.lst" file. This can be used in an install environment with sandbox, where execution of "rocminfo" is not possible.
-
target.lst : user-supplied text file, in the same folder as "rocm_agent_enumerator". This is used in a container setting where ROCm stack may usually not available.
-
rocminfo : a tool shipped with this script to enumerate GPU agents available on a working ROCm stack.
-
lspci : enumerate PCI bus and locate supported devices from a hard-coded lookup table.