A small, dependency-free Python script that configures the
NvStrapsReBar UEFI DXE driver
(Resizable BAR for NVIDIA Turing GPUs) entirely from Linux, replacing the
project's Windows-only ReBarState tool. It reads and writes the driver's
configuration EFI variable directly via efivarfs, harvesting your GPU's PCI
data automatically from sysfs.
Scope: this is a single-GPU, global-enable configurator, not a full
ReBarState port. It does not offer the interactive menu, per-GPU BAR sizes,
GPU selectors/exclusions, or the BAR-size-mask override. It covers the common
case ("one NVIDIA card, turn Resizable BAR on") and nothing more.
Background story and full walkthrough: larssteck.de
This tool is step 3 of a firmware modification. Do not start here.
- It is only useful if the NvStrapsReBar v0.3 DXE driver is already flashed into your motherboard BIOS. Flashing modified firmware can leave your board unbootable. Read the NvStrapsReBar documentation first, and make sure you have a tested recovery path (USB BIOS flashback / Q-Flash Plus / hardware programmer) before flashing anything.
- This script writes UEFI NVRAM variables as root. A wrong configuration is normally rejected by the DXE driver (visible as a status code), but the worst case is a hang at POST. Recovery: clear CMOS — the DXE driver detects it and disables itself.
- It speaks the v0.3 wire format only. It is NOT compatible with DXE drivers built from the project's master branch (the variable layout changed after the v0.3 release).
- Tested on exactly one system: Gigabyte B550 AORUS PRO (BIOS F19a), RTX 2070 (TU106), openSUSE Tumbleweed. Anything else is uncharted territory.
- Use at your own risk. No warranty. See LICENSE.
./nvstraps-config.py show
Read-only: prints the current config variable and the driver's status
(e.g. "120 = GpuReBarConfigured" means everything works). Safe to run
anytime, no root needed on most systems.
sudo ./nvstraps-config.py enable-full [pci-bar-size-exp] [--gpu 0000:xx:00.0] [--yes]
Auto-detects your NVIDIA GPU, harvests device/subsystem IDs, the BAR0
address and the upstream bridge from sysfs, and writes a full v0.3
configuration: global enable + GPUConfig + BridgeConfig.
pci-bar-size-exp: firmware-side BAR allocation cap as 2^n MB
(default 13 = 8 GB; 0 = GPU straps only).
Asks for confirmation before writing (skip with --yes). Reboot to apply.
sudo ./nvstraps-config.py disable
Writes a zeroed config. Reboot to apply.
| Code | Meaning |
|---|---|
40 Unconfigured |
Driver runs, no config written yet |
100 GpuStrapsConfirm |
GPU straps programmed (straps-only mode) |
120 GpuReBarConfigured |
Fully working: straps + firmware-allocated BAR |
162 NoGpuConfig |
Config lacks the GPUConfig entry (use enable-full) |
163 BadGpuConfig |
Saved BAR0 address no longer matches — re-run enable-full |
Full list in the script source.
- The configuration references your GPU's current BAR0 address. If it changes
(hardware moved, major BIOS settings changes), re-run
enable-full. - A CMOS clear disables the driver by design — re-run
enable-fullafter. - A BIOS update removes the DXE driver entirely — the flashing procedure must be redone before this tool is useful again.
- Verify success after reboot with:
nvidia-smi -q -d MEMORY | grep -A2 BAR1andcat /sys/bus/pci/devices/<gpu>/resource1_resize.