UMR(1)
π UMR(1) π
bestie, meet umr β the AMDGPU Userspace Register Debugger. she's the manual page you're reading rn, and she's that girl. π
β¨ NAME β¨
umr β AMDGPU Userspace Register Debugger
π DESCRIPTION π
okay so. umr is a tool to read and display, as well as write to AMDGPU device MMIO, PCIE, SMC, and DIDT registers via userspace. it can autodetect and scan AMDGPU devices (SI and up). no cap, it really does all that. π₯
π Device Selection π
--database-path,-dbp <path>β point at a database path for register, ip, and asic model data. give her the receipts.--gpu,-g <asicname>(@<instance> | =<pcidevice>)β pick a gpu by ASIC name plus either the instance number or the PCI bus identifier. for instance,"raven1@1"would pick the raven1 device in the 2nd DRI instance slot. similarly,"raven1=0000:06:00.0"would pick a raven1 device with the PCI bus address'0000:06:00.0'.--instance,-i <number>β pick a device instance to work with. defaults to the 0'th device. the instance refers to a directory under/sys/kernel/debug/dri/where 0 is the first card probed. π«Ά--force,-f <number>β force a PCIE Device ID in hex or by asic name. this is used in case the amdgpu driver is not yet loaded or a display is not yet attached. a.prefix will specify a virtual device which is handy for looking up register decodings for a device not present in the system, for instance,'.vega10'.--pci <device>β force a specific PCI device using thedomain:bus:slot.functionformat in hex. this is useful when more than one GPU is available. if the amdgpu driver is loaded the corresponding instance will be automatically detected. slay, autodetect. β¨--by-pci <device>β like--pcibut still uses the traditional debugfs path to interface with the hardware. this is useful for interacting with APIs that identify hardware by the PCI bus address.--user-queue,-uq <client>.<queue>β (yeah, that's the whole line, no extra description given for this form π« )--user-queue,-uq [<clienttype>,<client>,<queue>]β attach to a user queue specified by a given client and queue. where clienttype is'kgd'or'kfd', client is one of'client=number','pid=number', or'comm=string'to select a client by it's client number, process PID, or command name, and'queue'is one of'queue=number'or'type=string'. for'type'the string must be one of'gfx','compute', or'sdma'. for example:'kfd,comm=ollama,queue=2'specifies a KFD client attached to the first instance of ollama and queue #2. iykyk. π--print-uqβ print out all of the user queue information decoded. the tea is spilled, verbatim.--gfxoff,-go <0 | 1>β turn on or off GFXOFF on select hardware. a non-zero value enables the GFXOFF feature and a zero value disables it.--vm-partition,-vmp <-1, 0...n>β select a VM partition for all GPUVM accesses. default is-1which refers to the 0'th instance of the VM hub which is not the same as specifying'0'. values above-1are for ASICs with multiple IP instances. lowkey a trap if you skim it, so don't skim it. π--vgpr-granularity,-vgpr <-1, 0...n>β specify the VGPR size granularity as a power of 2, e.g.,'2'means 4 DWORDs per increment.--option,-O <string>[,<string>,...]β specify options to the tool. multiple options can be specified as comma separated strings. options should be specified before--updateor--forcecommands (among others) to enable options specified. and here's the whole menu of them, bestie, every single one:quietβ disable various informative but not required (for functionality) outputs.read_smcβ enable scanning of SMC registers.bitsβ enables displaying bitfields for scanned blocks.bitsfullβ enables displaying bitfields using their entire path for scanned blocks.empty_logβ empties the MMIO log after reading it.no_follow_ibβ instruct the--ring-streamcommand to not attempt to follow IBs pointed to by the packets in the ring.no_follow_chained_ibβ by default, umr will follow all IBs that have the CHAIN bit set regardless of the'no_follow_ib'option. specifying this will disable following chained IBs as well.use_pciβ enable PCI access for MMIO instead of using debugfs. used by the--read,--top,--write, and--write-bitcommands. does not currently support multiple instances of the same GPU (PCI device ID). note that access to non-MMIO registers might be disabled when using this flag. β οΈuse_colourβ enable colour output for--topcommand, scales from blue, green, yellow, to red. also accepted is'use_color'.no_kernelβ disable using kernel files to access the device. implies''use_pci''. this is meant to be used only if the KMD is hung or otherwise not working correctly. using it on live systems may result in race conditions.
fr fr, careful with this one on a live system. race conditions are not the vibe. π
verboseβ enable verbose diagnostics (used in--vram).halt_wavesβ halt/resume all waves while reading wave status.disasm_early_termβ terminate shader disassembly when firsts_endpgmis hit. this is required for older UMDs (or non-mesa UMDs) that don't use the quintuple0xBF9F0000to signal the true end of a shader.no_disasmβ disable shader disassembler logic (still outputs text just doesn't use LLVM to decode). useful if the linked llvm-dev doesn't support the hardware being debugged. avoids segfualts/asserts.disasm_anywaysβ enable shader disassembly in--waveseven if the rings aren't halted.wave64β enable full 64 wave disassembly.full_shaderβ enable full shader disassembly in--waveswhen'-O bits'is used and the shader is found in a gfx or compute ring.filter_shader_registersβ filter the shader registers presented when running-RS.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 using a database.asicfile matching inpci.didinstead of IP discovery.skip_gprsβ skip reading SGPRS and VGPRS when scanning waves.use_full_user_queueβ read the entire user queue buffer from start to the WPTR. may result in undefined behaviour with some VM accessess. useful though if the SQ is blocked on something the CP has advanced past.
undefined behaviour is giving chaos, so know what you're doing before you flip this one. π
πΈ Bank Selection πΈ
--bank,-b <se> <sh> <instance>β select a GRBM se/sh/instance bank in decimal. can use'x'to denote a broadcast selection.--sbank,-sb <me> <pipe> <queue> [vmid]β select a SRBM me/pipe/queue bank in decimal. VMID is optional (default:0).--cbank,-cb <context_reg_bank>β select a context register bank (value is multiplied by0x1000). used for context registers in the range0xA000..0xAFFF.
π¦ Device Information π¦
--config,-cβ print out configuation data read from kernel driver.--enumerate,-eβ enumerate all AMDGPU supported devices. she's making a list, she's checking it twice. π--list-blocks -lbβ list all blocks attached to the asic that have been detected.--list-regs,-lr <string>β list all registers in an IP block (can use'-O bits'to list bitfields).
π Register Access π
--lookup,-lu <address_or_regname> <number>β look up an MMIO register by address and bitfield decode the value specified (with0xprefix) or by register name. the register name string must include the ipname, e.g.,uvd6.mmUVD_CONTEXT_ID.--write -w <string> <number>β write a value specified in hex to a register specified with a complete register path in the form< asicname.ipname.regname >. for example,fiji.uvd6.mmUVD_CGC_GATE. the value of asicname and/or ipname can be*to simplify scripting. this command can be used multiple times to write to multiple registers in a single invocation. multi-write? iconic. β¨--writebit -wb <string> <number>β write a value specified in hex to a register bitfield specified with a complete register path as in the--writecommand.--read,-r <string>β read a value from a register specified by a register path to stdout. this command uses the same syntax as the--writecommand but also allows*for the regname field to read an entire block. additionally, a*can be appended to a register name to read any register that contains a partial match. for instance,"*.vcn10.ADDR*"would read any register from the'VCN10'block which contains'ADDR'in the name.
π₯ Device Utilization π₯
--top,-tβ summarize GPU utilization. can select a SE block with--bank. relevant options that apply are:use_colouranduse_pci.--waves,-wa [ <none> | <uq> | <ring_name> | <vmid>@<addr>.<size> ]β print out information about any active CU waves. note that if GFX power gating is enabled this command may result in a GPU hang. it's unlikely unless you're invoking it very rapidly. unlike the wave count reading in--topthis command will operate regardless of whether GFX PG is enabled or not. can usebitsto decode the wave bitfields. an optional ring name can be specified (default:gfx) to search for pointers to active shaders to find extra debugging information. alternatively, an IB can be specified by a vmid, address, and size (in hex bytes) triplet.
bestie, GPU hang is on the menu here. it's rare unless you're mashing this command, but it's there. π
--profiler,-prof [pixel= | vertex= | compute=]<nsamples> [ring]β capture'nsamples'samples of wave data. optionally specify a ring to use when searching for IBs that point to shaders. defaults to'gfx'. additionally, the type of shader can be selected for as well to only profile a given type of shader. π
π§ Virtual Memory Access π§
okay so VMIDs in umr are 16-bit numbers and they're doing the absolute most β the lower 8 bits are the actual hardware VMID, and the upper 8 bits tell you which VM space you're living in. main character bits fr:
0β GFX hub1β MM hub2β VC0 hub3β VC1 hub
so like, 0x107 means "the 7th VMID on the MM hub". slay π
--vm-decode,-vmvmid@<address> <num_of_pages> β Decode the page mappings sitting at a given address (in hex) using the VMID you picked. That VMID can be hex (leading0x) or plain decimal, your call. Heads up: this one quietly implies-O verbosefor however long the command runs, so you don't have to go type that in yourself. π«Ά--vm-read,-vr[vmid@]<address> <size> β Readsizebytes (in hex) from the address you gave (in hexadecimal), out of VRAM, straight to stdout. You can optionally drop a VMID in there (decimal, or hex with a0xprefix) and then the address gets treated as a virtual address instead. Also you can useuse_pcito go straight at VRAM. π₯--vm-write,-vw[vmid@]<address> <size> β Writesizebytes (in hex) to the address specified (in hexadecimal) into VRAM, reading the data from stdin.--vm-write-word,-vww[vmid@]<address> <data> β Write a single 32-bit worddata(in hex) to a given address (in hex), in host machine order.--vm-disasm,-vdis[<vmid>@]<address> <size> β Disassemblesizebytes (in hex) from a given address (in hex). cute trick: set the size to zero and umr will try to compute the shader size for you. β¨
π Ring and PM4 Decoding π
--ring-stream,-RS<string>[range] β Read the contents of the ring named by the stringamdgpu_ring_<string>β meaning you give it the string without theamdgpu_ringprefix. By default it reads and prints the entire ring, no notes. A range is optional and looks like'[start:end]'. The starting and ending addresses are non-negative integers, or the.(dot) symbol β and the dot means rptr when it's on the left side and wptr when it's on the right side. For instance,-RS gfxprints the entire gfx ring,-R gfx[0:16]prints the contents from 0 to 16 inclusively, and-RS gfx[.]or-RS gfx[.:.]prints the range[rptr,wptr]. Now when one range limit is a number and the other is the dot., that number means a relative range before or after the corresponding ring pointer. So for instance,-RS sdma0[16:.]prints[wptr-16, wptr]words of the SDMA0 ring, and-RS sdma1[.:32]prints[rptr, rptr+32]double-words of the SDMA1 ring. And the contents of the ring is always interpreted, if it can be interpreted. periodt. π--dump-uq,-duβ Dump the command submission attached to a given user queue β the one you selected with--user-queue. iykyk.--dump-ib,-di[vmid@]address length [pm] β Dump an IB packet at an address, with an optional VMID. The length is in bytes. The decoder type<pm>is optional and defaults to PM4 packets. You can say4for PM4 packets,3for SDMA packets,2for MES packets,1for VPE packets,5for UMSCH packets,6for HSA packets,7for VCN decode, and8for VCN encode. π¦--dump-ib-file,-dffilename [pm] β Dump an IB that's stored in a file, as a series of hexadecimal DWORDS, one per line. If the filename ends in.binthe file gets treated as binary, and if it ends in.ringit's treated as a ring copy and skips the first 12 bytes. You can optionally say3for SDMA packets,2for MES packets,1for VPE packets,5for UMSCH packets,6for HSA packets,7for VCN decode, and8for VCN encode. The default is PM4.--header-dump,-hd[HEADER_DUMP_reg] β Dump the contents of theHEADER_DUMPbuffer and decode the opcode into a human readable string. translating for the girlies π--print-cpc,-cpcβ Dump CPC register data.--print-sdma,-sdmaβ Dump SDMA register data.--logscan,-lsβ Read and display the contents of the MMIO register log. Usually you'll pair this with-O bits,empty_logso you get continual dumping of bit fields and the trace log gets emptied after. obsessed. β¨
β‘ Power and Clock β‘
--power,-pβ Read the content of clocks, temperature, and gpu loading at runtime. The optionuse_colourcolourizes the output. π--clock-scan,-cs[clock] β Scan the current hierarchy value of each clock. Default lists all the hierarchy values of the clocks; otherwise it lists just the corresponding clock, e.g.sclk.--clock-manual,-cm[clock] [value] β Set the value of the corresponding clock. The move here is: use-csfirst to check the hierarchy values of the clock, then use-cmwith a value to actually set that clock.--clock-high,-chβ Setpower_dpm_force_performance_leveltohigh.--clock-low,-clβ Setpower_dpm_force_performance_leveltolow.--clock-auto,-caβ Setpower_dpm_force_performance_leveltoauto.--ppt-read,-pptr[ppt_field_name] β Read a powerplay table value and print it to stdout. This command will print all the powerplay table information, or just the corresponding string in the powerplay table.--gpu-metrics,-gm[delay] β Print the GPU metrics table for the device, and optionally keep reading continuously everydelaymilliseconds.--power,-pβ Read the content of clocks, temperature, and gpu loading at runtime. The optionuse_colourcolourizes the output. (yes bestie, it's listed twice β that's just how the page is, and we respect the page π)
π Video BIOS Information π
--vbios-info,-viβ Print Video BIOS information.
π§ͺ Test Vector Generation π§ͺ
--test-log,-tl<filename> β Log all MMIO/memory reads to a file.--test-harness,-th<filename> β Use a test harness file instead of reading from the hardware. bye hardware π
π RUMR Commands π
--rumr-client<server> β Run as a RUMR client, connecting toserver, e.g.tcp://127.0.0.1:9000. You can also set theRUMR_SERVER_ADDRenvironment variable to tell umr to connect as a client β and with that env var set, you don't even need to pass--rumr-client. no cap. π--rumr-server<server> β Run as a RUMR server, binding toserver, e.g.tcp://127.0.0.1:9000.
π€ KFD Support π€
--runlist,-rls<node> β Dump any runlists for a given KFD node that you specify.--dump-mqdvmid@virtualaddr engsel β Dump an MQD from a given VMID and virtual address, for a given engine and asic family. Engines are0=compute,2=sdma0,3=sdma1,4=gfx,5=mes. π
π Scriptware Support π
--script[commands] β Run a script helper command. Run it without any parameters to see the list of commands.
π Notes π
- The "Waves" field in the DRM section of
--toponly works if GFX PG has been disabled. Otherwise, GPU hangs occur frequently. When PG is enabled, it will just read a constant0. π
fr fr, disable that PG first or you're gonna have a bad time.
πΈ Environmental Variables πΈ
UMR_LOGGERβ Directory to output the"umr.log"file when capturing samples with the--topcommand.UMR_DATABASE_PATHβ Should be set to the top directory of the database tree used for register, IP, and ASIC model data.RUMR_SERVER_ADDRβ Specifies the server address the rumr client should connect to. You can set this to avoid needing to add--rumr-clientto the command line.
ποΈ FILES ποΈ
${CMAKE_INSTALL_PREFIX}/share/bash-completion/completions/umrβ contains completion for bash shells. You'd normally source this file in your~/.bashrc.${CMAKE_INSTALL_PREFIX}/share/umr/databaseβ contains database files for ASICs, IPs, and registers.UMR_DATABASE_PATHis usually set to point here.
and that's the whole page, bestie π«Ά this one's from AMD (c) 2022, dated February 2022, and it's the UMR(1) manual page β go forth and debug, you're gonna eat π β¨π
π¦ where this page comes from
- fedora 44: umr 1.0.11-2.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms