Commit Graph

7 Commits

Author SHA1 Message Date
c9c47069db rmapi: add OS-event posting/poll wakeup and GA10x RM facts & usermode/shared-data classes
Cherry-picked MIT-clean pieces from PR #25:
- rmapi_node.c/.h: add nv_rs_rmapi_file_post() and report posted dataless OS events once in nv_rs_rmapi_poll() (EPOLLPRI | EPOLLIN, matching stock nvidia_poll).
- rmapi/gpu.rs: add GpuFacts::is_ga10x(), allow GA10x in MMU v2 vaspace/video memory paths, add Turing/Ampere usermode window 0xc461/0xc561 (0xbb_0000), and RM_USER_SHARED_DATA (0xde).

Co-authored-by: Kamil Skowron <1019893+Cinderella-Man@users.noreply.github.com>
2026-12-01 01:55:26 +00:00
5a02e03a79 Merge pull request #16 from morebrackets/fix/v100-16gb-iommu-irq-linux7
Fix 16GB V100 VRAM sizing, strict IOMMU DMA, IRQ deadlock, and Linux 7.0 build
2026-11-30 20:00:37 -05:00
33ff608a88 Add MIT LICENSE and unify repository SPDX/Cargo/module licensing
- Add root LICENSE (MIT License, Copyright (c) 2026 QuixiAI / Eric Hartford).
- Set license = "MIT" in workspace Cargo.toml and member crates (zero non-MIT dependencies).
- Update all kernel-open/ and tests/vm/ SPDX headers to MIT and EXPORT_SYMBOL_GPL -> EXPORT_SYMBOL.
- Use MODULE_LICENSE("Dual MIT/GPL") in Linux .ko modules so Linux modpost permits linking against the kernel's own EXPORT_SYMBOL_GPL symbols while keeping the repository source 100% MIT.

Closes #12.
2026-12-01 00:20:02 +00:00
2c09a6b64b Address review feedback on DMA mask, fault mapping, and PMA cursor
Route the 47-bit DMA mask negotiation in rmapi_node.c and uvm_node.c through nv_rs_pci_negotiate_dma() under p->access so active DMA leases and dma_bits stay consistent. Also require the faulting GPU's own page tree to map before returning Mapped in ManagedFaultMapper, and keep set_gpu_pma_base() monotonic on re-registration.
2026-11-30 10:58:06 -08:00
2d90287ede Fix 16GB V100 VRAM sizing, strict IOMMU DMA, IRQ top-half deadlock, and Linux 7.0 build
Tested on 4x Tesla V100-SXM2-16GB (Dell PowerEdge C4130) running Ubuntu
7.0.0-44-generic with Intel VT-d enabled (no iommu=pt).

Fixes #2 and a few other things that showed up once 16GB cards came up:

- Derive the GV100 runtime VRAM window, RMAPI VideoRegion ceiling, NVENC
  ucode staging address, and UVM descriptor/PMA base from the real FB size
  in placement::Placement::usable instead of hardcoding 32 GiB constants.
  Also pass the detected VRAM size through fb_info_v2_with_usable so
  cards with a smaller BAR1 still report the right total memory.

- Switch LiveEngine::irq_top_half, live_irq_mask, and live_irq_unmask to
  the lockless nv_rs_pci_{read,write}32_irq helpers. Using the normal
  nv_rs_pci_{read,write}32 path acquires p->access inside hardirq context
  and self-deadlocks when an IRQ lands on the same CPU running
  irq_thread_service.

- DMA-map sysmem pages per GPU instead of putting raw physical addresses
  in GPU page tables and rings: lazy per-GPU dma_map_page for RMAPI
  allocations and CPU-mapped UVM semaphore/managed pages, dma_alloc_coherent
  for SysmemPageTree and the replayable fault ring, and a live coherent
  flush page in 0x100c10 across ACR load/runtime/unload so SYS_MEMBAR does
  not hit stale unmapped IOVAs left behind by stock nvidia.ko.

- Add version-guarded compatibility wrappers for Linux 6.3-7.0 API changes
  (noop_llseek, vm_flags_set/clear, PCI_IRQ_INTX, timer_container_of,
  hrtimer_setup, MAX_PAGE_ORDER, MODULE_IMPORT_NS("DMA_BUF"), and
  drm_driver.date).

Verified with cargo fmt/clippy/test (918 passed), make modules +
check_kernel_module.py (10/10, largest_stack 1000), native-hello,
uvm-replayable-fault-test, 4-GPU cuda-multigpu-parity (matches stock
580.178.04), and llama-bench on 1 and 4 GPUs with zero DMAR faults and
clean unbind/rmmod.
2026-11-30 10:53:36 -08:00
4b6a77d90f Clean-room Rust NVIDIA 580.178.04 driver: GV100 0-diff parity (8-GPU PyTorch/NCCL/llama.cpp, H.264+HEVC NVDEC/NVENC, 2,096/2,096 RM controls, stock UVM/modeset bridges, artificial restrictions unlocked) 2026-11-27 20:45:30 +00:00
4526e6a816 Baseline: validated 30/30 tree with passing Level 7 hardware regression
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime
- Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after)
- Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
2026-11-23 23:48:38 +00:00