1 Deploy-Dependencies()2function Deploy-Dependencies { 3 param ( 4 [string] $deploy_directory 5 ) 6 7 Write-Host "Copying libva runtime and driver at:" 8 Get-Date 9 10 # Copy the VA runtime binaries from the mesa built dependencies so the versions match with the built mesa VA driver binary 11 $depsInstallPath="C:\mesa-deps" 12 Copy-Item "$depsInstallPath\bin\vainfo.exe" -Destination "$deploy_directory\vainfo.exe" 13 Copy-Item "$depsInstallPath\bin\va_win32.dll" -Destination "$deploy_directory\va_win32.dll" 14 Copy-Item "$depsInstallPath\bin\va.dll" -Destination "$deploy_directory\va.dll" 15 16 # Copy Agility SDK into D3D12 subfolder of vainfo 17 New-Item -ItemType Directory -Force -Path "$deploy_directory\D3D12" | Out-Null 18 Copy-Item "$depsInstallPath\bin\D3D12\D3D12Core.dll" -Destination "$deploy_directory\D3D12\D3D12Core.dll" 19 Copy-Item "$depsInstallPath\bin\D3D12\d3d12SDKLayers.dll" -Destination "$deploy_directory\D3D12\d3d12SDKLayers.dll" 20 21 # Copy WARP next to vainfo 22 Copy-Item "$depsInstallPath\bin\d3d10warp.dll" -Destination "$deploy_directory\d3d10warp.dll" 23 24 Write-Host "Copying libva runtime and driver finished at:" 25 Get-Date 26 } 27 Check-VAInfo-Entrypointnull28function Check-VAInfo-Entrypoint { 29 param ( 30 [string] $vainfo_app_path, 31 [string] $entrypoint 32 ) 33 34 $vainfo_run_cmd = "$vainfo_app_path --display win32 --device 0 2>&1 | Select-String $entrypoint -Quiet" 35 Write-Host "Running: $vainfo_run_cmd" 36 $vainfo_ret_code= Invoke-Expression $vainfo_run_cmd 37 if (-not($vainfo_ret_code)) { 38 return 0 39 } 40 return 1 41 } 42 43 # Set testing environment variables 44 $successful_run=1 45 $testing_dir="$PWD\_install\bin" # vaon12_drv_video.dll is placed on this directory by the build 46 $vainfo_app_path = "$testing_dir\vainfo.exe" 47 48 # Deploy vainfo and dependencies 49 Deploy-Dependencies -deploy_directory $testing_dir 50 51 # Set VA runtime environment variables 52 $env:LIBVA_DRIVER_NAME="vaon12" 53 $env:LIBVA_DRIVERS_PATH="$testing_dir" 54 55 Write-Host "LIBVA_DRIVER_NAME: $env:LIBVA_DRIVER_NAME" 56 Write-Host "LIBVA_DRIVERS_PATH: $env:LIBVA_DRIVERS_PATH" 57 58 # Check video processing entrypoint is supported 59 # Inbox WARP/D3D12 supports this entrypoint with VA frontend shaders support (e.g no video APIs support required) 60 $entrypoint = "VAEntrypointVideoProc" 61 62 # First run without app verifier 63 Write-Host "Disabling appverifier for $vainfo_app_path and checking for the presence of $entrypoint supported..." 64 appverif.exe /disable * -for "$vainfo_app_path" 65 $result_without_appverifier = Check-VAInfo-Entrypoint -vainfo_app_path $vainfo_app_path -entrypoint $entrypoint 66 if ($result_without_appverifier -eq 1) { 67 Write-Host "Process exited successfully." 68 } else { 69 $successful_run=0 70 Write-Error "Process exit not successful for $vainfo_run_cmd. Please see vainfo verbose output below for diagnostics..." 71 # verbose run to print more info on error (helpful to investigate issues from the CI output) 72 Invoke-Expression "$vainfo_app_path -a --display win32 --device help" 73 Invoke-Expression "$vainfo_app_path -a --display win32 --device 0" 74 } 75 76 # Enable appverif and run again 77 Write-Host "Enabling appverifier for $vainfo_app_path and checking for the presence of $entrypoint supported..." 78 appverif.exe /logtofile enable 79 appverif.exe /verify "$vainfo_app_path" 80 appverif.exe /enable "Leak" -for "$vainfo_app_path" 81 $verifier_log_path="$testing_dir\vainfo_appverif_log.xml" 82 $result_with_appverifier = Check-VAInfo-Entrypoint -vainfo_app_path $vainfo_app_path -entrypoint $entrypoint 83 if ($result_with_appverifier -eq 1) { 84 Write-Host "Process exited successfully." 85 appverif.exe /logtofile disable 86 } else { 87 Write-Host "Process failed. Please see Application Verifier log contents below." 88 # Need to wait for appverif to exit before gathering log 89 Start-Process -Wait -FilePath "appverif.exe" -ArgumentList "-export", "log", "-for", "$vainfo_app_path", "-with", "to=$verifier_log_path" 90 Get-Content $verifier_log_path 91 Write-Error "Process exit not successful for $vainfo_run_cmd." 92 appverif.exe /logtofile disable 93 $successful_run=0 94 } 95 96 if ($successful_run -ne 1) { 97 Exit 1 98 } 99 100