Shim - Adaptive output-event wait: sleep to ~120 us before the predicted completion (smoothed per wait site), spin near it, back off when late. D4R_SHIM_OUTPUT_POLL_US restores a fixed interval. - Defer the input-marker wait into the worker thread with VRAM interop (D4R_SHIM_DEFER_MARKER, default on), taking the host setup off the critical path. MicroCUDA - Experimental ZLUDA-free backend in wine_nvcuda_bridge, plus tools/microcuda and scripts/build_microcuda.sh. Serves accuracy, fast and native kernels; unregistered modules fall back to the reference path. Unclassified writes invalidate prepared weights. M kernels - SWIN_PREP_IDENTITY_AT: key weight prep by allocation identity (MicroCUDA); enc3 tube uses it with 8 slots. ZLUDA ignores it. - dec2 (gfx1101): SWIN_PACKED_RESIDUAL, byte-identical, ~1.6% faster. - Opt-in gfx12 hardware fp8 conversion (SWIN_FP8_HWCVT), unverified on hardware. Native K translators - ctile: handle variants that re-materialize the parameter base (mvlo). - rewrite_output: check live-in registers, not just outputs. - build.sh: native input covers all 8 flag variants, output the 4 HDR "max" variants; depth-tile skip stays mvhi-only. Tools - dump_runner and bench_dlss_kernel harness additions.
36 lines
1.5 KiB
C
36 lines
1.5 KiB
C
/* LD_PRELOAD for zluda_precompile.py: report D4R_SPOOF_GFX (e.g. gfx1201) as the device's gcnArchName, so
|
|
* ZLUDA compiles (and caches) code objects for a GPU that is not installed. Loading them then fails, which
|
|
* the precompile treats as expected; the cache entry is written before the load. Never use it for running. */
|
|
#define _GNU_SOURCE
|
|
#define __HIP_PLATFORM_AMD__
|
|
#include <hip/hip_runtime_api.h>
|
|
#include <dlfcn.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
hipError_t hipGetDevicePropertiesR0600(hipDeviceProp_tR0600* props, int device)
|
|
{
|
|
static hipError_t (*real)(hipDeviceProp_tR0600*, int);
|
|
if (!real)
|
|
real = (hipError_t (*)(hipDeviceProp_tR0600*, int))dlsym(RTLD_NEXT, "hipGetDevicePropertiesR0600");
|
|
if (!real)
|
|
{
|
|
/* ZLUDA loaded RTLD_LOCAL (ctypes): its HIP is not in the global scope RTLD_NEXT searches */
|
|
void* hip = dlopen("libamdhip64.so.7", RTLD_NOW | RTLD_NOLOAD);
|
|
if (!hip)
|
|
hip = dlopen("libamdhip64.so", RTLD_NOW | RTLD_NOLOAD);
|
|
if (hip)
|
|
real = (hipError_t (*)(hipDeviceProp_tR0600*, int))dlsym(hip, "hipGetDevicePropertiesR0600");
|
|
}
|
|
if (!real)
|
|
return hipErrorNotInitialized;
|
|
hipError_t result = real(props, device);
|
|
const char* arch = getenv("D4R_SPOOF_GFX");
|
|
if (result == hipSuccess && props && arch && *arch)
|
|
{
|
|
memset(props->gcnArchName, 0, sizeof(props->gcnArchName));
|
|
strncpy(props->gcnArchName, arch, sizeof(props->gcnArchName) - 1);
|
|
}
|
|
return result;
|
|
}
|