* build/tools: forward LLVM to kbuild, preserve major-195 nodes, and trim GV100 WPR stack
- Forward LLVM=$(LLVM) to kbuild invocations in Makefile
- Treat /sys/module/nvidia symlinks safely in install.sh and tools/bind_dev_nodes.sh, and preserve major-195 character device nodes when nvidia_rs registers them directly
- Split gv100_decode_and_plan in wpr_blob.rs to keep kernel stack frames well below the 1,024-byte IBT/codegen limit
* tools/bind_dev_nodes.sh: match nvidia-ctl and nvidia-gpu major-195 chrdev names
---------
Co-authored-by: braulio <braulio@localhost>
- Require non-empty values for --index/--nvflash/--rom/--backup-dir in
tools/vbios_flash.sh so --index "" exits 2 instead of selecting all GPUs.
- Move empty regular-file stub cleanup after the mountpoint check in
tools/bind_dev_nodes.sh::unbind_one() (guarding against symlinks) so
already-unmounted stubs are also removed.
- tools/vbios_flash.sh:
- Support non-zero PCI domains when walking ancestor bridges to wake to D0 (replace hardcoded */0000:* check with full DDDD:BB:DD.F regex).
- Back up every target adapter's VBIOS before flashing instead of only ADAPTER_INDICES[0].
- Validate missing option values before shift 2 and verify --index is a non-negative integer present in detected adapters.
- tools/resize-bar1.sh:
- Verify none of DRIVER_MOD, nvidia, nvidia_rs, or nouveau remain loaded before writing PCI config space.
- Wrap PCI_COMMAND memory-decode disable/restore in try/finally, guard against empty ReBAR size masks (avoiding sizes.bit_length()-1 == -1), clamp want to the 6-bit PCI_REBAR_CTRL_BAR_SIZE field, and abort cleanly if no root ports resolve.
- tools/bind_dev_nodes.sh:
- Remove newly created empty stub files if mount --bind fails, and remove empty regular-file stubs on --unbind (never touching real character device nodes).
Three fixes for bare-metal GSP-RM bring-up and runtime feature parity:
1. Register the 'nvidia-caps' character device alongside /proc/driver/nvidia/capabilities (#83):
- Exposing /proc/driver/nvidia/capabilities/mig/{config,monitor} without an 'nvidia-caps'
major in /proc/devices caused bare-metal NVML 580 (nvidia-smi) to abort with
'Failed to initialize NVML: GPU access blocked by the operating system' (exit 17).
- Register a minimal 'nvidia-caps' cdev (matching 580.178.04 nv-caps.c), assign distinct
minors (1=mig/config, 2=mig/monitor, 3=fabric-imex-mgmt), expose /proc/driver/nvidia-caps/
{mig-minors,nvlink-minors,sys-minors}, skip cleanly if stock /proc/driver/nvidia or
/proc/driver/nvidia-caps already exists, and create/clean /dev/nvidia-caps/nvidia-cap{1,2,3}
in tools/bind_dev_nodes.sh.
2. Wire SET_REGISTRY feature unlocks & disable_ecc=1 on default ga10x_gsp=1 path (#131, #132):
- Add BootRegistryOptions / write_registry_with_options() in nv_rs_core::gpu::ga10x_gsp
and encode EnableResizableBar=1, dyn_bar1_p2p keys, unpriv_profiling, and RMEnableEcc=0
(when disable_ecc=1) in Ga10xGsp::system_info(). Previously these were only sent on
gsp_bringup.rs (ga10x_gsp=0).
3. Verify Booter Unload mailbox0 and WPR2 teardown state (#83):
- Add classify_booter_unload() matching 580.178.04 kgspExecuteBooterUnloadIfNeeded_TU102
and check both mbox0 != 0 and WPR2_ADDR_HI != 0 in Ga10xGsp::unload() instead of
silently logging result=0 when Booter Unload fails (e.g. mbox0=0x88 on GA104M).
Verified:
- cargo fmt --all -- --check, cargo clippy, cargo test (15/15 ga10x_gsp, 986/986 workspace)
- make modules + tools/check_kernel_module.py PASS (0 GOT, 0 memcpy/memset, max stack 1000B)
- QEMU EDU + QEMU EDU --iommu guest validation PASS
- Live GA107M (RTX 3050 Mobile, 10de:25a2) VFIO VM: real uncovered /proc/driver/nvidia +
/proc/driver/nvidia-caps + /dev/nvidia-caps/nvidia-cap{1,2,3} + nvidia-smi RC=0,
disable_ecc=1 SET_REGISTRY boot OK, clean booter-unload WPR2 teardown & rmmod OK.
- Zero-friction first-run UX (#133): default runtime_engines=1 and pci_target=*
in nvidia_rs.ko (with explicit bringup=N precedence via resolve_bringup_mode);
install.sh auto-extracts pre-GSP firmware packs + GSP blobs, installs
/etc/modprobe.d/nvdriver.conf (install nvidia /bin/false, char-major-195-*
alias), /etc/modules-load.d/nvdriver.conf, and /etc/udev/rules.d/70-nvdriver.rules,
and enables BIND_DEV_NODES=1 by default.
- Maxwell & Pascal real firmware loading (GM10x-GP108): extend
tools/extract_gv100_firmware.py (--family gm20x|gp100|gp10x|all) using
REA-verified 580.178.04 ACR/PMU bundles (_nv016827rm/_nv016828rm/_nv016888rm)
with a shared pack_container() builder; wire LoadedPack::request_legacy and
HS Falcon IMEM/DMEM upload + execution into boot_maxwell_pascal_pre_gsp.
- Unified Hopper/Blackwell split-RM routing: add GspFirmwareChipFamily::boot_mode()
(FwsecBooter vs Fmc) as a single source of truth; integrate GH100/GB10x/GB20x
FMC BootROM handshake into Ga10xGsp::boot/unload via PciRegIo so every GSP-RM
GPU from Turing through Blackwell runs on the unified gsp_route.rs split-RM.
- Issue #142 Phases 3-4: add FileMappingLedger and GpuSlotLedger (+ unit tests)
to src/nvidia/src/rmapi/alloc_registry.rs + rmapi_memory.rs FFI, removing
struct nv_rs_rmapi_mapping and redundant bar0/bar1/numa_status fields from
kernel-open/nvidia/rmapi_node.c.
Validated: cargo fmt/clippy/test (957+2), NV_RS_KERNEL_IBT=0 & 1 make modules +
check_kernel_module.py (largest_stack=1000), test_gate_cases.py (18/18),
extract_gv100_firmware.py --check, and QEMU EDU verify_rust_guest.py (non-IOMMU
and --iommu, maxframe=984).
Require CAP_SYS_ADMIN for NV_RS_ESC_EXPORT_TO_DMABUF_FD now that RMAPI nodes are 0666, unmap retained RMAPI and UVM DMA mappings in nv_rs_rmapi_node_gpu_remove() before PCI teardown, bump the nv_vma_start_write() guard to Linux 6.4+ (6.3 doesn't have vma_start_write), and switch bind_dev_nodes.sh from lsmod|grep to /sys/module checks so pipefail SIGPIPE can't bypass the stock-driver guard.
btop queries nvmlDeviceGetPowerManagementLimit, which hits RM control 0x2080a61d and was falling through to NOT_SUPPORTED. Wire it up next to 0x2080a61f to return the 300W limit.
Also switch the RMAPI and UVM misc devices to mode 0666 (matching stock /dev/nvidia*) and add a small bind-mount helper (wired optionally via BIND_DEV_NODES=1 in install.sh) so tools like btop, nvidia-smi, and non-root services can use nvidia_rs directly without a mount namespace.