mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
- 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
17 lines
1.3 KiB
Python
17 lines
1.3 KiB
Python
from pathlib import Path
|
|
import json,hashlib,subprocess,tempfile,struct
|
|
R=Path(__file__).resolve().parent.parent
|
|
P=Path('/home/geodd/nvidia-driver/analysis-580.178.04')
|
|
incs=[P/'extracted/kernel/common/inc',P/'reference/open-gpu-kernel-modules-580.178.04/src/common/sdk/nvidia/inc']
|
|
results={}
|
|
with tempfile.TemporaryDirectory() as d:
|
|
for bits in [32,64]:
|
|
obj=Path(d)/f'layout{bits}.o';raw=Path(d)/f'layout{bits}.bin'
|
|
subprocess.run(['cc',f'-m{bits}','-std=c11','-Wall','-Werror','-ffreestanding','-fno-pic','-c',*[f'-I{i}' for i in incs],str(R/'tests/oracles/compat-layout.c'),'-o',str(obj)],check=True)
|
|
subprocess.run(['objcopy','--dump-section',f'.rodata={raw}',str(obj)],check=True)
|
|
data=raw.read_bytes();results[str(bits)]=list(struct.unpack('<'+'I'*(len(data)//4),data))
|
|
assert results['32'][0]==4 and results['64'][0]==8
|
|
assert results['32'][1:]==results['64'][1:]
|
|
report={'passed':True,'scope':'Compile-only i386/x86_64 exact-header layout proof; not a 32-bit process runtime test.','layouts':results,'all_wire_sizes_offsets_alignment_equal':True,'files':{str(p):hashlib.sha256(p.read_bytes()).hexdigest() for p in [R/'tests/oracles/compat-layout.c',incs[0]/'nv-ioctl.h',incs[0]/'nvtypes.h',incs[1]/'nvos.h']}}
|
|
(R/'reports/compat-layout-validation.json').write_text(json.dumps(report,indent=2)+'\n');print('i386 and x86_64 layouts match except pointer width')
|