Files
nvdriver/tests/native-compute/oracle.c
nvidia-driver-rs 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

43 lines
2.4 KiB
C

/* Independent bit-by-bit packing using NVIDIA's published QMD field macros.
* The selected smoke policies are explicit; this is not a GPU execution oracle. */
#include <stdint.h>
#include <string.h>
#include "clc3c0qmd.h"
#define MW(x) x
#define LO(x) (0 ? x)
#define HI(x) (1 ? x)
static void put(uint32_t *out,unsigned low,unsigned high,uint32_t value)
{
for(unsigned bit=low;bit<=high;bit++)
if(value&(UINT32_C(1)<<(bit-low))) out[bit/32]|=UINT32_C(1)<<(bit%32);
}
#define V(name,value) put(qmd,LO(NVC3C0_QMDV02_02_##name),HI(NVC3C0_QMDV02_02_##name),(value))
#define CB(name,i,value) put(qmd,LO(NVC3C0_QMDV02_02_##name(i)),HI(NVC3C0_QMDV02_02_##name(i)),(value))
void native_qmd_oracle(uint32_t *qmd,uint32_t *constants,uint64_t code,
uint64_t cb,uint64_t output,uint64_t completion,
uint32_t seed,uint32_t payload)
{
memset(qmd,0,256);memset(constants,0,368);
V(SM_GLOBAL_CACHING_ENABLE,1);V(SEMAPHORE_RELEASE_ENABLE0,1);
V(INVALIDATE_TEXTURE_HEADER_CACHE,1);V(INVALIDATE_TEXTURE_SAMPLER_CACHE,1);
V(INVALIDATE_TEXTURE_DATA_CACHE,1);V(INVALIDATE_SHADER_DATA_CACHE,1);
V(INVALIDATE_INSTRUCTION_CACHE,1);V(INVALIDATE_SHADER_CONSTANT_CACHE,1);
V(RELEASE_MEMBAR_TYPE,NVC3C0_QMDV02_02_RELEASE_MEMBAR_TYPE_FE_SYSMEMBAR);
V(CWD_MEMBAR_TYPE,NVC3C0_QMDV02_02_CWD_MEMBAR_TYPE_L1_SYSMEMBAR);
V(API_VISIBLE_CALL_LIMIT,NVC3C0_QMDV02_02_API_VISIBLE_CALL_LIMIT_NO_CHECK);
V(CTA_RASTER_WIDTH,1);V(CTA_RASTER_HEIGHT,1);V(CTA_RASTER_DEPTH,1);
V(MIN_SM_CONFIG_SHARED_MEM_SIZE,3);V(MAX_SM_CONFIG_SHARED_MEM_SIZE,25);
V(TARGET_SM_CONFIG_SHARED_MEM_SIZE,3);V(QMD_VERSION,2);V(QMD_MAJOR_VERSION,2);
V(CTA_THREAD_DIMENSION0,64);V(CTA_THREAD_DIMENSION1,1);V(CTA_THREAD_DIMENSION2,1);
CB(CONSTANT_BUFFER_VALID,0,1);V(REGISTER_COUNT_V,8);
V(RELEASE0_ADDRESS_LOWER,(uint32_t)completion);V(RELEASE0_ADDRESS_UPPER,(uint32_t)(completion>>32));
V(RELEASE0_STRUCTURE_SIZE,NVC3C0_QMDV02_02_RELEASE0_STRUCTURE_SIZE_ONE_WORD);
V(RELEASE0_PAYLOAD,payload);
CB(CONSTANT_BUFFER_ADDR_LOWER,0,(uint32_t)cb);CB(CONSTANT_BUFFER_ADDR_UPPER,0,(uint32_t)(cb>>32));
CB(CONSTANT_BUFFER_INVALIDATE,0,1);CB(CONSTANT_BUFFER_SIZE_SHIFTED4,0,23);
V(PROGRAM_ADDRESS_LOWER,(uint32_t)code);V(PROGRAM_ADDRESS_UPPER,(uint32_t)(code>>32));
constants[0]=64;constants[1]=1;constants[2]=1;
constants[0x160/4]=(uint32_t)output;constants[0x164/4]=(uint32_t)(output>>32);
constants[0x168/4]=seed;constants[0x16c/4]=64;
}