Basic Commands

UMR parses the command line from left to right in several passes. The first pass processes any options that modify UMR’s behaviour without the need to first connect to an ASIC instance. The second pass attaches to a test harness if any. The third pass connects to an ASIC model (locally, via rumr, etc). The last pass processes any commands that require an ASIC model to be bound to to function.

For instance,

umr -O bits -r *.*.RB_BASE

is equivalent to say:

umr -r *.*.RB_BASE -O bits

Device Selection

By default umr tries to issue commands for the device in the 0’th slot under /sys/kernel/debug/dri/. This is called the 0’th instance. A new instance can be selected with the –instance flag. If no ASIC is specified on the command line and the 0’th instance does not exist or it is not an AMDGPU device UMR will attempt the 1’st instance and so on until it connects with a device or hits the enumeration limit.

On most desktops the APU or dGPU are in slot #0 onwards. On servers with supervisor VGA ports the first AMDGPU device is often slot #1 onwards.

You can use the Scriptware Commands commands to enumerate AMDGPU instances in a manner that is suitable for putting into an automated script.

Selecting by Instance

umr --instance 1 ...

or with the -i shorthand

umr -i 1 ...

would both issue commands on the device in the #1 slot.

Selecting by Name

Devices may also be selected by name which is useful on systems with multiple GPUs but only one instance of a specific device. This is accomplished with the –force or -f flags.

umr -f vega10 ...

Would issue a command on the first vega10 it finds.

Selecting by PCI bus ID

For even more precision or using umr when the kernel module is not yet loaded the –pci flag can be used.

umr --pci 0000:00:01.0 ...

Would issue a command typically on the first integrated GPU found on a system. The –pci command will instruct umr to bypass debugfs when accessing registers and memory. Keep in mind that umr does not do any of the light up work required to make many of the IP cores accessible or functional. If you want to keep using debugfs but select devices by PCI use the –by-pci command.

umr --by-pci 0000:00:01.0 ....

This will pick the device with that bus address but still use debugfs.

Selecting by name and instance/pci

To simplify the selection of a device even further you can compound the asic model and instance/pci device selection into one command with the –gpu flag.

umr --gpu vega10@0

For instance, will tell umr that the 0’th instanced DRI device is a vega10.

umr --gpu vega10=0000:00:01.0

For instance, will tell umr that the PCI device at bus address 0000:00:01.0 is a vega10 asic.

Selecting a virtual device

There are times where you want to issue a command as if you had a device in your system (for instance –lookup to decode a register on a specific device). This can be accomplished with the virtual device name specifier:

umr --force .vega10 ...

Would issue a command as if a vega10 were present.

Exporting a model

AMDGPU devices no longer require static models for enumerating IP blocks but there are times where that might prove useful (for instance register lookup offline, etc). To do this, you need to run umr on a live host with the option -O export_model applied. This will create a DID named pair of .asic and .soc15 files that represent the created model data. The .asic file will likely require minor tweaks.

$ sudo umr -O export_model
[NOTE]: ASIC model exported uses FAMILY_NV family and IS_APU=0 flag, change these as appropriate.

$ head -n 10 *.asic
navi31 navi31.soc15 4 26 2 0
mp11300 mp1 0 /usr/local/share/umr/database//ip/mp_13_0_0.reg
lsdma600 lsdma 0 /usr/local/share/umr/database//ip/lsdma_6_0_0.reg
mmhub300 mmhub 0 /usr/local/share/umr/database//ip/mmhub_3_0_0.reg
osssys600 osssys 0 /usr/local/share/umr/database//ip/osssys_6_0_0.reg
vcn401{1} uvd 1 /usr/local/share/umr/database//ip/vcn_4_0_0.reg
vcn400 uvd 0 /usr/local/share/umr/database//ip/vcn_4_0_0.reg
hdp600 hdp 0 /usr/local/share/umr/database//ip/hdp_6_0_0.reg
smuio1306 smuio 0 /usr/local/share/umr/database//ip/smuio_13_0_6.reg
nbio430 nbif 0 /usr/local/share/umr/database//ip/nbio_4_3_0.reg

The first line of the .asic file has the family specified as the third column (4 in the above example). Choose the correct chipfamily from umr.h for the device you’re exporting.

The fourth column (26 in the above example) indicates how many IP blocks there are and shouldn’t need changing.

The fifth column (2 in the above example) indicates the VGPR granularity and may need changing depending on the device. A value of 2 indicates that VGPRs are allocated in blocks of 4. On many MI systems it should be 3 indicating they’re allocating in blocks of 8.

The last column (0 in the above example) indicates whether it’s an APU (1) or not (0).

Options

Options are specified with the -O command and are parsed as they appear on the command line which means they are typically specified before umr commands. Multiple options can be issued at once using a comma separator.

The options available are:

Option

Description

quiet

Disable various informative outputs that are not required for functionality.

read_smc

Enable scanning of SMC registers when issuing a –scan command

bits

Enables the display of bitfields when registers are presented

bitsfull

When printing bits use the full path to the bitfield

empty_log

Empty MMIO tracer after reading it

no_follow_ib

Instructs the –ring-stream command to not follow IBs pointed to by the ring

no_follow_chained_ib

Do not follow IBs that are marked as chained

use_pci

Enables direct PCI access bypassing the kernels debugfs entries.

use_colour

Enables colourful output in various commands. Also accepts use_color

no_kernel

Attempts to avoid kernel access methods. Implies use_pci.

verbose

Enables verbose output, for instance in VM decoding

halt_waves

Halt active waves while reading wave status data

wave64

Scan for 64 or 32 threads per wave

disasm_early_term

Terminate disassembly early for UMDs that don’t use 0xBF9F0000 marker

no_disasm

Disable LLVM disassembly. Used on systems with outdated llvm-dev

disasm_anyways

Enable disassembly in –waves even if rings are not halted.

no_fold_vm_decode

Disable folding of PDEs when VM decoding multiple pages of memory. By default, when subsequent pages are decoded if PDEs match previous pages they are omitted to cut down on the verbosity of the output. This option disables this and will print the full chain of PDEs for every page decoded.

force_asic_file

Force the use of static .asic files instead of trying IP discovery

export_model

Export a mostly complete .soc15/.asic model from IP discovered data

full_shader

Always print the full shader in –waves and –ring-stream output

filter_shader_registers

Filter shader registers presented when running –ring-stream

skip_gprs

Skip reading VGPR and SGPR registers when decoding wave status data

use_full_user_queue

Decode from the start of the ring buffer to the write pointer when user queues from either KFD or KGD clients

no_backtrace

Disable backtracing for commands where VM faults are expected

aql_heuristics

Use heuristics to decode AQL packets marked INVALID when racing a live command processor (CP) that is not halted.

Device Information

Device information for the selected device can be printed out with the –config (-c) command.

$ umr -c
asic.instance == 0
asic.devname == 0000:01:00.0

umr.version == 551b5972da1b
...<snip>...

Devices can be enumerated with the –enumerated (-e) command.