code wiki / _hdl_build / nx_device_probe.nx
nx_device_probe.nx
buildroot/runtime/_hdl_build/nx_device_probe.nx
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
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
structs
| none |
consts
| 13 | const K_MAGIC_4096: i64 = 4096 |
functions
| 15 | func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 } |
| 16 | func 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 } |
| 17 | func dev_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 19 | func main() -> i64 |