code wiki / _hdl_build / nx_device_probe.nx

nx_device_probe.nx

buildroot/runtime/_hdl_build/nx_device_probe.nx

4614 B72 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

about

nx_device_probe.nx -- R0-LIVE: CLOUD-AWARE sovereign compute-device discovery + HAL-shim ROUTING for the "S-class exceed for ANY DEVICE" stack. Detects the device interface available in THIS environment and routes to the right per-vendor sovereign shim: /dev/dxg -> WSL2 GPU-PV (nx_dxg shim; control-plane only, EXECUTE walled by NVIDIA priv-data) /dev/nvidiactl,/dev/nvidia0 -> native-Linux NVIDIA open-kernel-modules (GPFIFO+doorbell EXECUTE = BM-GPU-6 runnable) /dev/kfd -> native-Linux AMD (AM/PM4 path, nx_pm4_asm) /dev/dri/card0 -> generic DRM On WSL2 (here) reports dxg + enumerates GPUs; on a rented native-Linux cloud GPU instance reports the native path so the deploy runs BM-GPU-6 on real silicon (the brick-safe measured-exceed path, rule #26). No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_dxg.nx nx_device_probe.nx

imports: nx_syscalls.nxnx_dxg.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main p sys_write dev_exists sys_openat_rd sys_close n sys_mmap sys_write ↻ dxg_open sys_openat_rd ↻ sys_mmap ↻ dxg_enum sys_mmap ↻ sys_ioctl dxg_rd32 dxg_rd32 ↻ dxg_query_type sys_mmap ↻ sys_ioctl ↻ dxg_rd32 ↻ sys_close ↻ sys_exit

structs

none

consts

13const K_MAGIC_4096: i64 = 4096

functions

15func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 }
called by 1: main calls 1: sys_write
16func n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func dev_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
19func main() -> i64