Skip to main content

Module gpu_context

Module gpu_context 

Source
Expand description

Shared GPU context and VRAM ledger for LLM + tensor + render coexistence.

Compute universes (Track B2): logical partitions on one physical adapter — pinned ledger slots and queue lanes, not multiple GPUDevice instances.

Qualia-native bindings (graph–tensor SOA, Phase-8 SPSC, Sentinel, ledger pins) live in compute_universe.rs — this module owns VRAM accounting and shared_gpu().

Operational modes: Full, Eco, Reserve (no heap in hot-path accounting).

Modules§

device_registry
Device-per-circuit registry — obtain a wgpu::Device for a SPECIFIC adapter/circuit (e.g. the integrated GPU), not just the single process-wide primary (STELLAR H3 foundation). Native only; mirrors try_shared_gpu — never panics on a missing/failed device. Device-per-circuit registry — obtain a wgpu::Device for a SPECIFIC adapter/circuit (STELLAR §A H3 foundation for heterogeneous GPU routing).

Structs§

GpuAdapterCaps
GpuFeatureCaps
GpuLimitCaps
SharedGpuContext
UniverseOrchestrator
Orchestrator enforces pinned boundaries on one adapter (Full / Eco / Reserve degrade per universe).
UniversePartition
Hermetic partition: universe ↔ ledger bounds ↔ queue preference.
VramByteRange
Immutable consecutive byte range in the logical VRAM ledger (no overlap between universes).
VramLedger
Zero-heap VRAM budget tracker (bytes, atomics).

Enums§

ComputeUniverse
Parallel compute plane on shared silicon (maps to 10D q / w semantics).
OperationalMode
Desktop / portal operational mode (thermal + VRAM driven).
QueueLane
Preferred async queue on the single wgpu::Device (spatial concurrency, not MIG).
VramLedgerSlot
Pinned VRAM accounting bucket (zero-copy crossover between universes reads, not writes).

Functions§

ambient_draw_instances
Live ledger hook for per-frame draw throttling (no buffer resize).
ambient_draw_instances_for_mode
Zero-heap ambient draw throttle — static SSBO, dynamic instance_count (instant step-down).
global_universe_orchestrator
Alias retained for orchestration call sites.
global_vram_ledger
qualia_backend_override
An explicit GPU-backend override for the inference device.
recommend_inference_backend
Capability-aware recommendation for which GPU backend this machine should run inference on (advisory; surfaced by the doctor/setup checker). Prefers the portable, vendor-neutral path so the build is not silently locked to Windows (DX12) or NVIDIA (CUDA). Reactive to the adapter actually in hand; a full enumerate-all-backends-and-pick is the next layer.
record_bake_pulse
Tensor / Quin bake or encode event.
record_context_ring_drop
Context inject ring full — lossy drop rather than stalling U0.
record_draft_acceptance
Topological speculative decode: accepted draft tokens this step (B3.1e).
record_llm_decode_step
Called once per autoregressive decode step (gguf_bridge hot loop).
record_logic_flash
SPARQL / GeoSPARQL / rule resolution flash.
record_network_ripple
Mesh / network I/O ripple (daemon fetch, torrent, etc.).
record_producer_cycle
U1 background producer completed a kNN inject cycle (B3.3).
sample_ambient_telemetry
Portal + desktop ambient field sampling (48 B contract subset).
shared_gpu
Process-wide wgpu device + queue (lazy init). Panics if no GPU is available — use only where a device is genuinely mandatory. Prefer try_shared_gpu on any path that can fall back to CPU.
try_shared_gpu
Process-wide wgpu device + queue, or None when no usable GPU adapter exists (headless / integrated-only / GPU-less machine, or the tokio runtime can’t start).
universe_orchestrator
Universe map derived from adapter budget + live operational mode (recomputed; 3 partitions).
viewport_operational_mode
U2-effective operational mode from live VramLedger pressure.