code wiki / _hdl_build / _gpu_dxg_r1_recon4.nx

_gpu_dxg_r1_recon4.nx

buildroot/runtime/_hdl_build/_gpu_dxg_r1_recon4.nx

6769 B118 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic gpu
docsdependenciesstructsconstsfunctions

about

_gpu_dxg_r1_recon4.nx -- R1 recon pass 4. GROUND TRUTH from WSL2-Linux-Kernel (linux-msft-wsl-6.6.y) uapi d3dkmthk.h: enum kmtqueryadapterinfotype has ONLY _KMTQAITYPE_UMDRIVERPRIVATE=0, _KMTQAITYPE_ADAPTERTYPE=15, _KMTQAITYPE_ADAPTERTYPE_RENDER=57. There is NO ADAPTERREGISTRYINFO and NO adapter_string struct -> the "RTX 5080" DESCRIPTION STRING is NOT retrievable via QueryAdapterInfo on WSL2 dxgkrnl. The task's ABI hint (full Windows header) does not match WSL. dxgkio_query_adapter_info forwards to the host after resolving the handle via dxgprocess_adapter_by_handle (NULL -> -EINVAL). This pass tests the ONLY valid WSL query type for ADAPTER IDENTITY: type=15 ADAPTERTYPE, which returns struct d3dkmt_adaptertype (a 4-byte bitfield union: render_supported/display_supported/ software_device/paravirtualized/compute_only/...). That can POSITIVELY distinguish the real RTX 5080 (paravirtualized=1, render_supported=1, software_device=0) from the WSL software render adapter (software_device=1), even though it is NOT the literal name string. We use the OPENED per-process handle (from OpenAdapterFromLuid nr=0x01 size12, pinned in pass 3), type=15, private_data_size=4, and DUMP the returned 4-byte adaptertype value + decode the bits, for BOTH adapters. We also retry on the ENUM handle to confirm which handle dxgprocess_adapter_by_ handle accepts. AUTHOR=ORGAN / NO-WAVE / raw syscalls only. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _gpu_dxg_r1_recon4.nx

imports: nx_syscalls.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 sys_openat_rd sys_exit sys_mmap sys_ioctl n sys_mmap ↻ sys_write ↻ x p ↻ sys_mmap ↻ sys_write ↻ open_from_luid sys_mmap ↻ sys_ioctl ↻ try_type query sys_mmap ↻ sys_ioctl ↻ p ↻ x ↻ n ↻ decode_adaptertype p ↻ n ↻ sys_close

structs

none

consts

21const DXG_LX_DXENUMADAPTERS2: i64 = 0xC0104714
22const QAI_CODE: i64 = 0xC0184709 // QueryAdapterInfo, 24-byte struct

functions

24func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 }
25func 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;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 }
26func x(v: i64) -> i64 { p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 2: try_typemain calls 3: psys_mmapsys_write
28func query(fd: i64, handle: i64, qtype: i64, priv: *u8, psize: i64) -> i64
called by 1: try_type calls 2: sys_mmapsys_ioctl
38func open_from_luid(fd: i64, la: i64, lb: i64, out_h: *i64) -> i64
called by 1: main calls 2: sys_mmapsys_ioctl
49func decode_adaptertype(v: i64) -> i64
called by 1: try_type calls 2: pn
65func try_type(fd: i64, label: *u8, handle: i64, qtype: i64, sz: i64, priv: *u8) -> i64
called by 1: main calls 5: querypxndecode_adaptertype
76func main() -> i64