nx_gpu_mem_gate.nx
buildroot/runtime/nx_gpu_mem_gate.nx
about
nx_gpu_mem_gate.nx -- gpu GP6 heaps and residency on the real device, driven directly through nx_gpu_mem.
Teeth: the budget is READ from the device for both segment groups; a bounded window of heaps (well under the budget)
is allocated, placed and made resident; every heap is then EVICTED through the device's own EVICT and the proof of
eviction is the device's own paging answer -- a make-resident after the evict returns DXG_MKRES_PENDING, where a heap
that was never evicted answers 0. Tampers: an evict of a bogus handle is refused; a budget query for an invalid
segment group is refused; and a positive control after the tampers reads the same local budget back.
THE THIRD STATE: absent /dev/dxg (every host but the GPU laptop) is a gv_need precondition -> SKIP, never RED.
SCOPE the board carries: the heaps are non-local (sysmem-backed, UMD-less); exhausting the LOCAL segment to force
driver-initiated eviction needs VRAM allocations the vendor UMD owns, and exhausting the non-local segment would
exhaust the host's RAM -- so this gate proves the EVICT MECHANISM and the budget accounting, not budget exhaustion.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0 (or 3 = SKIP where there is no /dev/dxg)
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_dxg.nxnx_gpu_sync.nxnx_gpu_mem.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 19 | const GMG_HEAPS: i64 = 16 |
| 20 | const GMG_HEAP_BYTES: i64 = 1048576 // 1 MiB per heap: 16 MiB in flight, a bounded window under any budget here |
| 21 | const GMG_BAD_GROUP: i64 = 5 |
| 22 | const GMG_BOGUS_ALLOC: i64 = 0xdeadbeef |
functions
| 24 | func main() -> i64 |