# Radeon Pro VII (MI50 crossflash) tuning Toolkit for unlocking and safely maximizing performance on an AMD Instinct MI50 that's been crossflashed to a Radeon Pro VII vbios for display output. Built and validated on a 16GB card; **do not use on a 32GB card** without re-deriving the vbios/values (mismatched VRAM configs in a crossflash can hard-brick the card). ## Background Chinese-market MI50s are commonly sold crossflashed to a Radeon Pro VII vbios, since the stock MI50 firmware has no display output. This works, but the specific Pro VII vbios many of these cards ship with (part `113-D1640600-104`) has a **vbios/firmware-locked 190W power cap** and **rejects all overdrive requests at the SMU firmware level** -- `rocm-smi --setoverdrive` and `--setpoweroverdrive` are both hard-refused, regardless of `amdgpu.ppfeaturemask`. This isn't a Linux driver limitation; the SMU firmware itself returns `[SetSclkOD] failed to set od gfxclk!` and reports `190` as both the current and max power cap in every table it exposes. This toolkit does two independent things to get past that: 1. **Crossflash to a different Pro VII OEM vbios** (`113-D1640700-100`, a Lenovo-branded build, same Vega20/gfx906 silicon, same display support) that exposes a real overdrive table instead of an empty one. This alone does *not* raise the power cap (see below) but is a prerequisite for step 2 to have anything to attach to. 2. **Live PowerPlay table injection** via [UPP (Uplift Power Play)](https://github.com/sibradzic/upp), which writes a modified table directly to `/sys/class/drm/cardX/device/pp_table`, live, at runtime -- no vbios flash, no RSA signature involved (the SMU already booted the signed vbios; this reprograms the running SMU's active table in software). This is what actually raises the power ceiling and adds a higher DPM clock state above the stock 1700MHz. Both were necessary. Flashing the Lenovo vbios alone did *not* unlock the power cap or clock overdrive on its own -- `pp_od_clk_voltage` existed after flashing + setting `ppfeaturemask`, but returned empty (`OD_RANGE:` with zero bytes of actual range data), and the legacy overdrive path still failed identically. UPP's live table injection is what actually did it. **A vbios hex-edit approach was deliberately avoided.** These vbios images are RSA-signed by AMD; the SMU firmware verifies that signature, so a hand-patched (and therefore unsigned) vbios is expected to fail to initialize properly -- a real hard-brick risk, not just a "flash tool complains" annoyance. UPP's live/runtime approach sidesteps this entirely since it never touches the signed vbios on flash. ## Validated results (on the original tuning machine) | | Stock (113-D1640600-104) | Tuned | |---|---|---| | Power cap | 190W (hard-locked) | 300W | | Max GPU clock | 1700MHz | 1800MHz | | Sustained junction temp (4x back-to-back GPU benchmark) | ~77-81C | 96C peak | | Stability | -- | 0 errors/resets across ~10 benchmark runs incl. 4x sustained back-to-back | 1850MHz was also tested and ran, but pushed sustained junction to 103C (2C below the 105C hard throttle limit) with an observed throttle-back event during a sustained run. 1800MHz was chosen as the stable target instead -- see "Re-tuning for your own hardware" below before assuming these exact numbers are safe on a different machine/cooling setup. Cooling on the tuning machine: this card is **passively cooled** (no fan of its own) -- cooling was an external fan on a motherboard header, controlled by `coolercontrold` keyed to GPU **junction** temp (not edge -- edge ran ~30-40C cooler than junction under load and is the wrong signal to fan off of). If your card has its own active cooler, or your case airflow differs, re-validate rather than assuming these numbers transfer. ## Prerequisites - The card must **already** be running some Pro VII-family vbios with working display output. Getting a raw stock MI50 to display output at all is a separate, board/seller-specific process not covered here. - Arch-based distro assumed for `03-enable-ppfeaturemask.sh` (GRUB). Adjust if you're on something else -- see comments in that script. - Root/sudo access. ## Usage Run in order, rebooting where indicated. Each script is standalone and safe to re-run. ```bash sudo scripts/01-check-hardware.sh # verifies card is Vega20/16GB sudo scripts/02-flash-vbios.sh # crossflash to the OC-unlocked vbios sudo reboot sudo scripts/03-enable-ppfeaturemask.sh # unlock the OD table at driver level sudo reboot sudo scripts/04-setup-upp.sh # installs UPP into /opt/gpu-tune/upp-venv sudo scripts/05-install-persistent-tuning.sh # installs + enables the systemd service scripts/status.sh # verify final state ``` After this, `gpu-tune.service` reapplies the tuning automatically on every boot (it has to -- the live table injection doesn't persist across a reboot on its own). ## Files - `vbios/pro-vii-lenovo-16gb-113-D1640700-100.rom` -- the OC-unlocked vbios. MD5 `bd58215956ab3f4e069476078c6f1e70`, RSA-signature-verified, originally sourced from TechPowerUp's VGA BIOS collection (entry #277846). - `tools/amdvbflash-4.71` -- the vbios flash tool. Note: the newer 4.104e build (from the `amdvbflash` AUR package) is missing the `-fs` (bypass SSID check) and `-fm` (bypass memory config check) flags present in this older 4.71 build -- 4.104e cannot complete this crossflash, use 4.71. - `scripts/02-flash-vbios.sh` -- backs up the current vbios, verifies the target file, flashes with `-fp -fs` (both checks are *expected* to fire since this is an intentional cross-OEM-variant flash). - `scripts/gpu-tune.sh` -- the actual tuning logic; power limit and clock are overridable via `GPU_TUNE_POWER_W` / `GPU_TUNE_CLOCK_MHZ` env vars. - `reference/stock-pptable-dump-113-D1640700-100.txt` -- full UPP dump of the untouched live PowerPlay table on the Lenovo vbios, for reference if you need to identify other fields to tune. ## Re-tuning for your own hardware If your cooling setup differs, don't trust 300W/1800MHz blindly. Re-run the incremental process that found these numbers: 1. Raise power cap first (`SmallPowerLimit1/2`, `BoostPowerLimit`, `smcPPTable/SocketPowerLimitAc0`, `smcPPTable/SocketPowerLimitDc`) in steps (e.g. 190 -> 250 -> 300W), checking `rocm-smi --showmaxpower` and dmesg for errors at each step. This alone is very low risk -- it only removes an artificial ceiling, it can't force the card to run out of spec. 2. Then raise the clock ceiling: add a new top DPM state (`smcPPTable/FreqTableGfx/9`), bump `smcPPTable/DpmDescriptor/0/NumDiscreteLevels` to match the new state count, and mirror the new value into `PowerSavingClockTable/PowerSavingClockMax/0` and `smcPPTable/DcModeMaxFreq/0`. Step in ~50MHz increments. 3. At each clock step, force `rocm-smi --setperflevel high` to pin the new top state, then run a **sustained** load test (several back-to-back GPU benchmark runs, not just one) while watching junction temp (`hwmon*/temp2_input`) and `dmesg` for `amdgpu` reset/timeout errors. A single short run can look fine while a sustained run reveals thermal throttling -- this is exactly what happened going from 1800 to 1850MHz on the original machine. 4. Back off one step from wherever you see throttling or errors, that's your stable ceiling. Update `GPU_TUNE_POWER_W` / `GPU_TUNE_CLOCK_MHZ` (or the defaults in `scripts/gpu-tune.sh`) accordingly. Recovery if a live table injection misbehaves: worst case is a hang requiring a physical power cycle. There's no persistent-storage risk -- a reboot always comes back on the stock signed vbios's default table. ## Safety notes - The vbios flash step (`02-flash-vbios.sh`) is the one genuinely hard-to-reverse step here. This card has **no dual-BIOS switch**. Verify you have a display fallback (iGPU, another GPU) before flashing on a new machine, in case the new vbios fails to POST. - Everything after the flash (ppfeaturemask, UPP tuning, systemd service) is either a kernel boot parameter (trivially reversible by editing grub again) or pure runtime state (reversible by rebooting).