* pmu_bringup: log when the boot-voltage cap lowers a v100_p0_gpc_ndiv request
On GV100 (Tesla V100) a `v100_p0_gpc_ndiv` request above 172 is applied
as 172 (1290 MHz) whenever the LOGIC rail was not raised. Nothing said
so: with `v100_p0_gpc_ndiv=204` the only line was "GV100 P0 boost
active: GPC 555.0 -> 1290.0 MHz", which reads like the outcome of the
request, and the parameter still read back 204. The compiled-in default
(190) is capped the same way. Reported in #367.
The cap was two copies of an inline `if req > 172 && !volt_raised`, in
the bring-up path and in the governor tick that re-reads the parameter.
This commit only moves that existing condition; the value 172 and the
applied clock are unchanged. Both sites now go through nv_rs_core:
- `gv100_p0_boost::clamp_p0_gpc_ndiv_for_volt` returns
`(effective_ndiv, was_clamped)`; the cap is `BOOT_VOLT_MAX_GPC_NDIV`.
- `P0GpcClampNotice::retune` takes the request, the NDIV in effect and
a callback that performs the clock write, and decides whether to
write and whether to report. A capped request is reported only once
the capped clock is in effect: this pass wrote it successfully, or an
active boost already sits at the cap. A write that fails
(`P0BoostStatus::NafllNotReady` and the like) is not reported as
applied and is not remembered, so the retry that succeeds reports it.
Each capped request is reported once, not once per tick.
The line is printed before the boost line:
nvidia_rs: GV100 P0 GPC NDIV request capped gpu=0x...: requested 204
(1530.0 MHz), applied 172 (1290.0 MHz); LOGIC rail is at boot voltage
(no PMU VOLT scaling)
It is pr_info, next to nv_rs_p0_boost_log and in the same style, because
the default request is capped too and a warning on every default load
would be noise.
The parameter keeps reading back the request. `v100_hbm_ndiv` does the
same across an adaptive backoff, `v100_p0_volt_uv` (read-only, 0444) is
range-limited only in its getter, and one global value cannot show a
per-GPU result when `v100_p0_gpc_ndiv_map` or the rail state differs
per GPU. README says so.
No stock 580.178.04 function is cited because no RM control, register
sequence, struct layout or status code changes.
Tests (host, the clock write is a mock callback):
p0_gpc_request_is_capped_at_boot_voltage_and_reported,
p0_gpc_initial_capped_boost_is_reported_once_and_ticks_do_not_repeat_it,
p0_gpc_failed_retune_is_not_reported_as_applied,
p0_gpc_clamp_is_not_reported_where_no_boost_took_effect.
The C side is one printk wrapper; its callers are compiled out of the
EDU guest build (`cfg(not(nv_rs_edu_guest))`). QEMU EDU guest tests
were not run. Not run on a GPU.
Refs #367
* pmu_bringup: report the live GPC clock in the skipped-retune notice
Review finding on #447. The capped-request notice named the retune
baseline (`applied_gpc_ndiv`) even when no write ran. The thermal guard
and the idle governor lower the hardware GPC clock and update only
`SavedP0State::cur_gpc_ndiv`, so the baseline can be stale: request 190
boosts to 172, a hot tick drops the clock to 160, the request changes
to 204, the write is skipped because the target still equals the
baseline, and the line said "applied 172 (1290.0 MHz)" while the clock
was at 1200 MHz.
`P0GpcRetune::notice_ndiv(live_ndiv)` now picks the NDIV the notice
names: after a successful write, the NDIV just written (unchanged);
when the write was skipped, the live clock from `cur_gpc_ndiv`. The
live value is used for the report only. The write decision still
compares the retune target with the baseline, so a hot tick is not
undone by raising the clock back to the cap.
Test: p0_gpc_skipped_retune_notice_names_the_live_clock (host). Not run
on a GPU; QEMU EDU guest tests not run.
Refs #367
* pmu_bringup: track idle-clock writes in the live GPC clock
Review finding on #447 (round 2). The skipped-retune notice names the
live clock `SavedP0State::cur_gpc_ndiv`, but the idle governor's writes
did not update it except on the transition back to Active. Request 190
boosts to 172, the governor enters LowPower and writes NDIV 74, the
request changes to 204 while still idle, the write is skipped because
the target equals the baseline, and the notice said 172 instead of 74.
The same held when `idle_pstate_gpc_khz` changed while already idle.
`IdlePstateGovernor::tick_tracking_live_ndiv` wraps `tick_with_clock`
and stores every NDIV the governor wrote successfully in the live state:
entering LowPower, re-applying a changed idle clock while in LowPower,
and waking to Active (which replaces the caller's Active-only update).
A failed write leaves it unchanged. The retune baseline
`applied_gpc_ndiv` and the write decision are untouched. The thermal
guard and power cap still read `cur_gpc_ndiv` only while Active, and
the wake to Active sets it to the active clock first, as before.
Test: p0_gpc_skipped_retune_notice_names_the_idle_clock (host) runs the
tick sequence with the real retune, idle governor and boost_gv100_p0
writes on MockGv100; with the live-state store removed it fails with
172 != 74. Not run on a GPU; QEMU EDU guest tests not run.
Refs #367
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* README: say when the capped-request line repeats
retune() logs once per distinct capped request per GPU and re-arms after an
uncapped request, so 'one line per GPU' overstated it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* gpu_owner: don't claim the LOGIC rail stayed at boot voltage in the cap notice
runtime_pmu_volt_init_and_scale returns volt_raised = false when any
VOLT SET step fails, even after earlier steps raised the rail, so the
capped-request line cannot say no scaling happened. Say the cap is active
and the raise was not confirmed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Scott <scottbphone12@gmail.com>
The 19 areas of tools/gp106/check.sh, which hold all 26 GP106 opt-in
(#[ignore]) comparisons against the 580.178.04 instructions, were run by
nothing: not by validate_all.sh, not by the Makefile. They only ran when
someone typed the loop from reports/gp106-core-validation.md, and that
loop left out pte-policy.
check.sh gains an `all` area that runs every area in order and stops at
the first failure. validate_all.sh runs it as the optional step
gp106_oracles, next to gsp_620_headers. Missing prerequisites follow the
existing optional-step rule (exit 2 is SKIP, as in test_native_compute.sh
and oracle_gsp_620.py): `all` exits 2 before running anything when the
interpreter cannot import Unicorn and pyelftools, or when
resolve_580_binary() finds no original object. A present object with the
wrong digest, a generator error or a Rust mismatch is still FAIL. The
interpreter default is the top-level Makefile's REA_PYTHON default.
The report now documents `check.sh all` in place of the hand-written
loop. The step count in AGENTS.md, CLAUDE.md and docs/GPU_BRINGUP_GUIDE.md
is set to 36, the number of PASS/FAIL/SKIP lines validate_all.sh prints
with this step; those files said 31, 30 and 31 while the script already
printed 35.
Tests: tests/gp106/test_check_all.py covers both exit-2 paths and the
usage line with stand-in interpreters; tests/vm/test_validate_guest_steps.py
covers PASS, SKIP and FAIL of the new step. All six fail on master.
No driver logic changes. On this host `check.sh all` passes all 19 areas
(90 Rust tests, 0 failed) in about 4 minutes cold, 3 minutes warm; BAR2
and the two framebuffer generators are most of it.
tools/extract_gv100_firmware.py needs the exact 580.178.04
nv-kernel.o_binary. Distributions now ship 580.196.07, so that object is no
longer under /usr/src and the pre-GSP firmware packs cannot be built.
fetch_580_kernel_object.sh downloads NVIDIA's installer (or takes RUN_FILE),
unpacks that one file without executing the installer, and checks it
against the digest the extractor requires.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
P1 - --extra-blk attached a disk the guest could not use when the host builds
virtio_blk as a module: stage virtio/virtio_ring/virtio_pci/virtio_blk into the
initramfs and insmod virtio_blk before mounting (best-effort, since they are
built in on some kernels).
P2 - quote mount paths with shlex.quote so a path containing spaces works, for
both --home-mount and --extra-blk mountpoints.
P2 - repeated --extra-blk without explicit mountpoints defaulted every disk to
/mnt/extra, so each mount hid the previous one; they now default to
/mnt/extra0, /mnt/extra1, ...
P2 - the report advertised controls this branch does not carry (NV_RS_VM_CPUS,
-mem-prealloc, a separate shutdown timeout, tools/vm/gcycle.sh) and credited a
.ko.zst fallback that master already has; the section now describes exactly what
the branch does.
P2 - the utilisation note contradicted itself: utilization.gpu does track load,
the earlier 0% reading was sampled during model load.
Rebased onto current master with the host-specific pieces stripped, per review:
- run_vfio_guest.py: the /home/archivect 9p share, the /dev/nvme0n1p1 virtio-blk
drive and the /mnt/ai-models mount are now opt-in (--home-mount PATH,
--extra-blk DEV[:MOUNTPOINT]); nothing host-specific is left in the defaults.
Kept from the branch: decompressing .ko.zst host modules into the initramfs
(kernels that ship compressed modules have no plain .ko) and the
NV_RS_VM_RAM_MB / NV_RS_VM_CPUS overrides.
- The QEMU subprocess keeps args.timeout so TimeoutExpired still fires the report
handler at the deadline.
- README: only the Field Reports section, with the corrected conclusion (stock
reaches 1530 MHz under load; the driver is within noise; 1290 is a ceiling
because the VOLT unit is not enabled).
- gcycle.sh and the personal .gitignore entries dropped.
- /etc/modprobe.d/nvdriver.conf hardcoded 'runtime_engines=1 pci_target=*',
so MODPROBE_ARGS only applied until the next boot. Write MODPROBE_ARGS.
- bind_dev_nodes.sh refuses to run while stock nvidia is loaded; under
set -e that aborted install.sh after modprobe.d, udev and systemd were
written and before the verify step. Warn and skip the bind instead,
like the existing warning for pinned stock modules.
- nvidia-persistenced was stopped for the reload and never started
again; start it if it was active.
- uninstall.sh reverses install.sh: unloads the nvdriver modules, removes
updates/nvdriver for every kernel (unless DKMS owns it), the
modprobe.d / modules-load.d / udev / systemd / CDI-patch files, and with
REMOVE_FIRMWARE=1 /lib/firmware/nvidia-rs.
CLAUDE.md now imports AGENTS.md and adds build/test commands, the
crate and C-shim architecture, the kernel-object constraints enforced
by check_kernel_module.py, and the rules for generated files.
The README layout diagram listed the ABI crate under src/nvidia/abi;
it lives at src/common/abi.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Master's gsp_abi (default 620) picks the firmware and the message framing of gsp_bringup's path. The GA10x path boots
GSP-RM 580.178.04 (its .fwversion is checked) and speaks that ABI whatever gsp_abi says; it works with the default
620 too, but userspace has to be 580.178.04. The boot now logs that once when gsp_abi is not 580, and the README lists
the two GA10x parameters (ga10x_gsp, ga10x_events) next to gsp_abi.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fixes#47: dispatch wait_for_rm_init_done_with_abi, execute_gsp_boot_with_abi,
boot_gsp_rm, and GspRpcSession::rpc_call through the active session
GspAbiVersion (matching REA _nv041450rm dispatching via pRpc->rpcRecvPoll),
with end-to-end R620 MCTP/NVDM boot unit test.
- Fixes#52: guard <linux/unaligned.h> vs <asm/unaligned.h> on 6.12+ in
tests/vm/edu_adapter_test.c so validate_all.sh guest_build passes on 6.12+/7.x.
- Fixes#49: clarify in MODULE_PARM_DESC and README.md that driver_version
(default 580.178.04 for userspace NVML/libcuda matching) is independent of
gsp_abi (GSP-RM wire protocol framing).
Detect Volta GV100 PCI device IDs via sysfs after nvidia_rs.ko is built,
installed, and verified, and automatically install pinned volta-forever
v0.1.6 (HTTPS-only + SHA-256 verified) so V100 users get single-command
CUDA 13 compatibility out of the box without installing a second repo.
Supports SKIP_VOLTA_FOREVER=1 / INSTALL_VOLTA_FOREVER={auto,1,0},
VOLTA_FOREVER_VERSION override, idempotent re-runs, and non-fatal
warning fallback on offline systems.