Measure Windows interop GPU boundaries without added completion waits
This commit is contained in:
1 parent
0b471be024
commit
caecad0897
8 files changed
+151
-5
No files matched your search
@@ -3,6 +3,7 @@ param(
|
||||
[string]$NgxCore, [string]$DlssDll, [string]$NativeRoot,
|
||||
[string]$ZludaRoot, [string]$PackageRoot,
|
||||
[string]$Resolution = '3840x2160',
|
||||
[switch]$ProfileGpuBoundary,
|
||||
[string]$OutputDirectory
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -19,6 +20,7 @@ New-Item -ItemType Directory -Force $OutputDirectory | Out-Null
|
||||
$settings = @{D4R_DIAG_BURST='1'; D4R_DIAG_RECREATE=$null; D4R_ASYNC_INTEROP=$null;
|
||||
D4R_ZLUDA_NATIVE_DIR=$NativeRoot; D4R_QUIET_API='1'; D4R_VALIDATE_OUTPUT='1';
|
||||
D4R_PROFILE_STAGES='1'; D4R_ZLUDA_PROFILE=$null; D4R_ZLUDA_PROFILE_API=$null;
|
||||
D4R_PROFILE_GPU_BOUNDARY=$(if ($ProfileGpuBoundary) { '1' } else { $null });
|
||||
ZLUDA_CACHE_DIR=(Join-Path $repo 'build/zluda-cache-windows');
|
||||
PYTHONPATH=(Join-Path $repo '.tools/python/vendor')}
|
||||
$old=@{}
|
||||
@@ -40,13 +42,18 @@ try {
|
||||
OptiScalerDll=(Join-Path $repo 'dist/optiscaler-windows-d4r/OptiScaler.dll'); OutputDirectory=$output}
|
||||
& (Join-Path $PSScriptRoot 'test-windows-rdna4.ps1') @arguments
|
||||
if ($LASTEXITCODE) { throw "Failed $variant-$mode; logs: $output" }
|
||||
if ($ProfileGpuBoundary -and $variant -eq 'async') {
|
||||
$stdout=Get-Content -LiteralPath (Join-Path $output 'd3d12-evaluate-preset-11.stdout.log') -Raw
|
||||
$timings=[regex]::Matches($stdout, '(?m)^D4R_GPU_BOUNDARY [^\r\n]*diagnostics_cpu_bytes=32 serializing=0\r?$')
|
||||
if ($timings.Count -ne 3) { throw "Expected three completed GPU timing records for $variant-$mode, found $($timings.Count)." }
|
||||
}
|
||||
}
|
||||
& python.exe (Join-Path $repo 'tools/windows/frame_compare.py') --reference (Join-Path $OutputDirectory "sync-$mode") --actual (Join-Path $OutputDirectory "async-$mode") --width $width --height $height --exact |
|
||||
Tee-Object -FilePath (Join-Path $OutputDirectory "$mode-comparison.log")
|
||||
if ($LASTEXITCODE) { throw "Async $mode output mismatch" }
|
||||
}
|
||||
@{passed=$true; architecture='gfx1201'; preset=11; resolution=$Resolution;
|
||||
modes=@('burst','recreate'); framesPerMode=3; exactRgb=$true} |
|
||||
modes=@('burst','recreate'); framesPerMode=3; exactRgb=$true; gpuBoundaryTiming=[bool]$ProfileGpuBoundary} |
|
||||
ConvertTo-Json | Set-Content -LiteralPath (Join-Path $OutputDirectory 'validation.json') -Encoding UTF8
|
||||
Write-Host "PASS asynchronous K burst/recreate: $OutputDirectory"
|
||||
} finally {
|
||||
|
||||
@@ -13,6 +13,7 @@ param(
|
||||
[switch]$ProfileKernels,
|
||||
[switch]$ProfileCommandHooks,
|
||||
[switch]$ProfileCudaApi,
|
||||
[switch]$ProfileGpuBoundary,
|
||||
[switch]$UncachedInteropLists,
|
||||
[switch]$AsyncInterop,
|
||||
[switch]$VerboseRuntime,
|
||||
@@ -21,6 +22,7 @@ param(
|
||||
[string]$OutputDirectory
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
if ($ProfileGpuBoundary -and !$AsyncInterop) { throw '-ProfileGpuBoundary requires -AsyncInterop.' }
|
||||
$package = [IO.Path]::GetFullPath($PSScriptRoot)
|
||||
$GameExe = (Get-Item -LiteralPath $GameExe -ErrorAction Stop).FullName
|
||||
$game = Split-Path $GameExe
|
||||
@@ -182,6 +184,7 @@ $settings = @{
|
||||
D4R_ZLUDA_PROFILE=$(if ($ProfileKernels) { '1' } else { $null });
|
||||
D4R_PROFILE_COMMAND_HOOKS=$(if ($ProfileCommandHooks) { '1' } else { $null });
|
||||
D4R_ZLUDA_PROFILE_API=$(if ($ProfileCudaApi) { '1' } else { $null });
|
||||
D4R_PROFILE_GPU_BOUNDARY=$(if ($ProfileGpuBoundary) { '1' } else { $null });
|
||||
D4R_DISABLE_INTEROP_LIST_CACHE=$(if ($UncachedInteropLists) { '1' } else { $null });
|
||||
D4R_ASYNC_INTEROP=$(if ($AsyncInterop) { '1' } else { $null });
|
||||
D4R_DIAG_DIR=$OutputDirectory; ZLUDA_LOG_DIR=(Join-Path $OutputDirectory 'zluda-trace');
|
||||
|
||||
Reference in new issue
Block a user