Skip to content

Commit

Permalink
Added documentation for the new env var.
Browse files Browse the repository at this point in the history
Change-Id: I0407a5dd36e91a1ea205ce4dda9a7fca906e1266
  • Loading branch information
justxi authored and Chris Freehill committed Dec 16, 2019
1 parent 12736c6 commit a134847
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,17 @@ 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. There exist four different ways how it is generated:

1. 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.

2. 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.

3. rocminfo : a tool shipped with this script to enumerate GPU agents available on a working ROCm stack.

4. lspci : enumerate PCI bus and locate supported devices from a hard-coded lookup table.

14 changes: 9 additions & 5 deletions rocm_agent_enumerator
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def readFromTargetLstFile():
target = getGCNISA(line, match_from_beginning = True)
if target is not None:
target_list.append(target)

return target_list

def readFromROCMINFO():
Expand Down Expand Up @@ -123,11 +123,15 @@ def main():
The program collects the list in 3 different ways, in the order of
precendence:
1. target.lst : user-supplied text file. This is used in a container setting
1. 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.
2. target.lst : user-supplied text file. This is used in a container setting
where ROCm stack may usually not available.
2. rocminfo : a tool shipped with this script to enumerate GPU agents
3. rocminfo : a tool shipped with this script to enumerate GPU agents
available on a working ROCm stack.
3. lspci : enumerate PCI bus and locate supported devices from a hard-coded
4. lspci : enumerate PCI bus and locate supported devices from a hard-coded
lookup table.
"""
target_list = readFromTargetLstFile()
Expand All @@ -141,7 +145,7 @@ def main():
# workaround to cope with existing rocm_agent_enumerator behavior where gfx000
# would always be returned
print("gfx000")

for gfx in target_list:
print(gfx)

Expand Down

0 comments on commit a134847

Please sign in to comment.