hypomnesis
ὑπόμνησις — External RAM and VRAM, measured.
⚠️ This crate is under active development.
0.0.1is an initial scaffold (placeholder bodies; not for production use). The first functional release will be0.1.0. See docs/hypomnesis-brief.md for the design and roadmap, and CHANGELOG.md for current progress.
Table of Contents
Install
[]
= "0.1"
The default feature set (nvml, dxgi, nvidia-smi-fallback) covers process RSS and per-process / device-wide GPU memory on both Windows (IDXGIAdapter3 + NVML) and Linux (NVML), with a nvidia-smi subprocess fallback. The dxgi dependency on the windows crate is target-conditional — Linux users pay nothing for it.
For candle-mi-compatible delta and printing helpers (MemoryReport, print_delta, print_before_after, ram_mb, vram_mb):
= { = "0.1", = ["report"] }
For a stripped-down build (process RSS only, no GPU backends):
= { = "0.1", = false }
Usage
use Snapshot;
Expected output (RTX 5060 Ti, Windows, idle process):
RAM: 142475264 bytes
GPU 0 [NVIDIA GeForce RTX 5060 Ti]: 1.8 / 16.0 GiB used
This process: 119 MiB (per-process)
Capabilities
| Metric | Windows | Linux |
|---|---|---|
| Process RSS | K32GetProcessMemoryInfo |
/proc/self/status (no unsafe) |
| Device-wide GPU memory | NVML (nvml.dll) |
NVML (libnvidia-ml.so.1) |
| Per-process GPU memory | DXGI (IDXGIAdapter3::QueryVideoMemoryInfo) |
NVML (nvmlDeviceGetComputeRunningProcesses) |
| Fallback | nvidia-smi subprocess |
nvidia-smi subprocess |
hypomnesis uses IDXGIAdapter3 on Windows because WDDM means the kernel memory manager — not the NVIDIA driver — owns GPU allocations, so NVML's per-process query returns NOT_AVAILABLE under Windows. DXGI 1.4 is the only reliable per-process source. On Linux, NVML's nvmlDeviceGetComputeRunningProcesses_v3 returns true per-process figures.
The crate handles two known driver bugs out of the box:
NVMLu64::MAXsentinel — someR570-series drivers report0xFFFFFFFFFFFFFFFFfor every running process's memory (observed onRTX 5060 Ti).hypomnesisdetects this and falls back tonvidia-smi.used > totalcorruption — sanity-checks each per-process reading against the device-wide total; falls back tonvidia-smion detected corruption.
Feature Flags
| Feature | Default | Description |
|---|---|---|
nvml |
yes | NVML dynamic load via libloading (Linux + Windows-WDDM device-wide) |
dxgi |
yes | Windows per-process VRAM via IDXGIAdapter3 (no-op on non-Windows) |
nvidia-smi-fallback |
yes | Subprocess fallback when NVML / DXGI fail or are disabled |
report |
no | MemoryReport delta + print_delta / print_before_after / ram_mb / vram_mb helpers (candle-mi parity, candidate for candle-mi v0.2 migration via Cargo flag flip) |
debug-output |
no | Print raw NVML / DXGI values to stderr (diagnostic) |
Used by
None yet — 0.0.1 is a name-reservation placeholder. Phase 2 will integrate with hf-fetch-model's inspect --check-gpu flag; Phase 3 may migrate candle-mi's in-tree memory module to depend on hypomnesis v0.1.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Development
- Exclusively developed with Claude Code (dev) and Augment Code (review)
- Git workflow managed with Fork
- All code follows CONVENTIONS.md, derived from Amphigraphic-Strict's Grit — a strict Rust subset designed to improve AI coding accuracy.