diff --git a/.gitlab-ci/image-tags.yml b/.gitlab-ci/image-tags.yml index d1a362163256d..347c2f4a8900f 100644 --- a/.gitlab-ci/image-tags.yml +++ b/.gitlab-ci/image-tags.yml @@ -40,7 +40,7 @@ variables: WINDOWS_X64_MSVC_TAG: "20231222-msvc" WINDOWS_X64_BUILD_PATH: "windows/x86_64_build" - WINDOWS_X64_BUILD_TAG: "20240322-agility-sdk" + WINDOWS_X64_BUILD_TAG: "20240405-vainfo-ci-1" WINDOWS_X64_TEST_PATH: "windows/x86_64_test" - WINDOWS_X64_TEST_TAG: "20240402-agility-sdk" + WINDOWS_X64_TEST_TAG: "20240405-vainfo-ci-1" diff --git a/.gitlab-ci/windows/Dockerfile_build b/.gitlab-ci/windows/Dockerfile_build index 5bd252c14772d..c4035aa757667 100644 --- a/.gitlab-ci/windows/Dockerfile_build +++ b/.gitlab-ci/windows/Dockerfile_build @@ -7,6 +7,10 @@ COPY mesa_deps_vulkan_sdk.ps1 C:\ RUN C:\mesa_deps_vulkan_sdk.ps1 COPY mesa_init_msvc.ps1 C:\ + +COPY mesa_deps_libva.ps1 C:\ +RUN C:\mesa_deps_libva.ps1 + COPY mesa_deps_build.ps1 C:\ RUN C:\mesa_deps_build.ps1 diff --git a/.gitlab-ci/windows/Dockerfile_test b/.gitlab-ci/windows/Dockerfile_test index 5b9c1fdd7a2d6..d75e2a8fa3c81 100644 --- a/.gitlab-ci/windows/Dockerfile_test +++ b/.gitlab-ci/windows/Dockerfile_test @@ -14,6 +14,9 @@ RUN C:\mesa_deps_rust.ps1 COPY mesa_init_msvc.ps1 C:\ +COPY mesa_deps_libva.ps1 C:\ +RUN C:\mesa_deps_libva.ps1 + COPY mesa_deps_test_piglit.ps1 C:\ RUN C:\mesa_deps_test_piglit.ps1 COPY mesa_deps_test_deqp.ps1 c:\ diff --git a/.gitlab-ci/windows/mesa_build.ps1 b/.gitlab-ci/windows/mesa_build.ps1 index 9b768e6281835..ee93ff74f007f 100644 --- a/.gitlab-ci/windows/mesa_build.ps1 +++ b/.gitlab-ci/windows/mesa_build.ps1 @@ -84,4 +84,6 @@ Copy-Item ".\.gitlab-ci\windows\spirv2dxil_run.ps1" -Destination $installdir Copy-Item ".\.gitlab-ci\windows\deqp_runner_run.ps1" -Destination $installdir +Copy-Item ".\.gitlab-ci\windows\vainfo_run.ps1" -Destination $installdir + Get-ChildItem -Recurse -Filter "ci" | Get-ChildItem -Include "*.txt","*.toml" | Copy-Item -Destination $installdir diff --git a/.gitlab-ci/windows/mesa_deps_build.ps1 b/.gitlab-ci/windows/mesa_deps_build.ps1 index 8b77c4ba34352..3c83cc8611acf 100644 --- a/.gitlab-ci/windows/mesa_deps_build.ps1 +++ b/.gitlab-ci/windows/mesa_deps_build.ps1 @@ -55,35 +55,6 @@ if (!$buildstatus) { Exit 1 } - -Get-Date -Write-Host "Cloning libva" -git clone https://github.com/intel/libva.git deps/libva -if (!$?) { - Write-Host "Failed to clone libva repository" - Exit 1 -} - -Push-Location -Path ".\deps\libva" -Write-Host "Checking out libva df3c584bb79d1a1e521372d62fa62e8b1c52ce6c" -# libva-win32 is released with libva version 2.17 (see https://github.com/intel/libva/releases/tag/2.17.0) -git checkout 2.17.0 -Pop-Location - -Write-Host "Building libva" -# libva already has a build dir in their repo, use builddir instead -$libva_build = New-Item -ItemType Directory -Path ".\deps\libva" -Name "builddir" -Push-Location -Path $libva_build.FullName -meson .. -Dprefix="$depsInstallPath" -ninja -j32 install -$buildstatus = $? -Pop-Location -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $libva_build -if (!$buildstatus) { - Write-Host "Failed to compile libva" - Exit 1 -} - Get-Date Write-Host "Cloning LLVM release/15.x" git clone -b release/15.x --depth=1 https://github.com/llvm/llvm-project deps/llvm-project diff --git a/.gitlab-ci/windows/mesa_deps_libva.ps1 b/.gitlab-ci/windows/mesa_deps_libva.ps1 new file mode 100644 index 0000000000000..e6b9fb696a122 --- /dev/null +++ b/.gitlab-ci/windows/mesa_deps_libva.ps1 @@ -0,0 +1,79 @@ +# Compiling libva/libva-utils deps + +$ProgressPreference = "SilentlyContinue" +$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent +. "$MyPath\mesa_init_msvc.ps1" + +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "deps" | Out-Null +$depsInstallPath="C:\mesa-deps" + +Write-Host "Cloning libva at:" +Get-Date +git clone https://github.com/intel/libva.git deps/libva +if (!$?) { + Write-Host "Failed to clone libva repository" + Exit 1 +} + +Write-Host "Cloning libva finished at:" +Get-Date + +Write-Host "Building libva at:" +Get-Date + +Push-Location -Path ".\deps\libva" +Write-Host "Checking out libva..." +git checkout 2.21.0 +Pop-Location + +# libva already has a build dir in their repo, use builddir instead +$libva_build = New-Item -ItemType Directory -Path ".\deps\libva" -Name "builddir" +Push-Location -Path $libva_build.FullName +meson .. -Dprefix="$depsInstallPath" +ninja -j32 install +$buildstatus = $? +Pop-Location +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $libva_build +if (!$buildstatus) { + Write-Host "Failed to compile libva" + Exit 1 +} + +Write-Host "Building libva finished at:" +Get-Date + +Write-Host "Cloning libva-utils at:" +Get-Date +git clone https://github.com/intel/libva-utils.git deps/libva-utils +if (!$?) { + Write-Host "Failed to clone libva-utils repository" + Exit 1 +} + +Write-Host "Cloning libva-utils finished at:" +Get-Date + +Write-Host "Building libva-utils at:" +Get-Date + +Push-Location -Path ".\deps\libva-utils" +Write-Host "Checking out libva-utils..." +git checkout 2.21.0 +Pop-Location + +Write-Host "Building libva-utils" +# libva-utils already has a build dir in their repo, use builddir instead +$libva_utils_build = New-Item -ItemType Directory -Path ".\deps\libva-utils" -Name "builddir" +Push-Location -Path $libva_utils_build.FullName +meson .. -Dprefix="$depsInstallPath" --pkg-config-path="$depsInstallPath\lib\pkgconfig;$depsInstallPath\share\pkgconfig" +ninja -j32 install +$buildstatus = $? +Pop-Location +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $libva_utils_build +if (!$buildstatus) { + Write-Host "Failed to compile libva-utils" + Exit 1 +} + +Write-Host "Building libva-utils finished at:" +Get-Date diff --git a/.gitlab-ci/windows/vainfo_run.ps1 b/.gitlab-ci/windows/vainfo_run.ps1 new file mode 100644 index 0000000000000..a02e6c57de09f --- /dev/null +++ b/.gitlab-ci/windows/vainfo_run.ps1 @@ -0,0 +1,99 @@ + +function Deploy-Dependencies { + param ( + [string] $deploy_directory + ) + + Write-Host "Copying libva runtime and driver at:" + Get-Date + + # Copy the VA runtime binaries from the mesa built dependencies so the versions match with the built mesa VA driver binary + $depsInstallPath="C:\mesa-deps" + Copy-Item "$depsInstallPath\bin\vainfo.exe" -Destination "$deploy_directory\vainfo.exe" + Copy-Item "$depsInstallPath\bin\va_win32.dll" -Destination "$deploy_directory\va_win32.dll" + Copy-Item "$depsInstallPath\bin\va.dll" -Destination "$deploy_directory\va.dll" + + # Copy Agility SDK into D3D12 subfolder of vainfo + New-Item -ItemType Directory -Force -Path "$deploy_directory\D3D12" | Out-Null + Copy-Item "$depsInstallPath\bin\D3D12\D3D12Core.dll" -Destination "$deploy_directory\D3D12\D3D12Core.dll" + Copy-Item "$depsInstallPath\bin\D3D12\d3d12SDKLayers.dll" -Destination "$deploy_directory\D3D12\d3d12SDKLayers.dll" + + # Copy WARP next to vainfo + Copy-Item "$depsInstallPath\bin\d3d10warp.dll" -Destination "$deploy_directory\d3d10warp.dll" + + Write-Host "Copying libva runtime and driver finished at:" + Get-Date +} + +function Check-VAInfo-Entrypoint { + param ( + [string] $vainfo_app_path, + [string] $entrypoint + ) + + $vainfo_run_cmd = "$vainfo_app_path --display win32 --device 0 2>&1 | Select-String $entrypoint -Quiet" + Write-Host "Running: $vainfo_run_cmd" + $vainfo_ret_code= Invoke-Expression $vainfo_run_cmd + if (-not($vainfo_ret_code)) { + return 0 + } + return 1 +} + +# Set testing environment variables +$successful_run=1 +$testing_dir="$PWD\_install\bin" # vaon12_drv_video.dll is placed on this directory by the build +$vainfo_app_path = "$testing_dir\vainfo.exe" + +# Deploy vainfo and dependencies +Deploy-Dependencies -deploy_directory $testing_dir + +# Set VA runtime environment variables +$env:LIBVA_DRIVER_NAME="vaon12" +$env:LIBVA_DRIVERS_PATH="$testing_dir" + +Write-Host "LIBVA_DRIVER_NAME: $env:LIBVA_DRIVER_NAME" +Write-Host "LIBVA_DRIVERS_PATH: $env:LIBVA_DRIVERS_PATH" + +# Check video processing entrypoint is supported +# Inbox WARP/D3D12 supports this entrypoint with VA frontend shaders support (e.g no video APIs support required) +$entrypoint = "VAEntrypointVideoProc" + +# First run without app verifier +Write-Host "Disabling appverifier for $vainfo_app_path and checking for the presence of $entrypoint supported..." +appverif.exe /disable * -for "$vainfo_app_path" +$result_without_appverifier = Check-VAInfo-Entrypoint -vainfo_app_path $vainfo_app_path -entrypoint $entrypoint +if ($result_without_appverifier -eq 1) { + Write-Host "Process exited successfully." +} else { + $successful_run=0 + Write-Error "Process exit not successful for $vainfo_run_cmd. Please see vainfo verbose output below for diagnostics..." + # verbose run to print more info on error (helpful to investigate issues from the CI output) + Invoke-Expression "$vainfo_app_path -a --display win32 --device help" + Invoke-Expression "$vainfo_app_path -a --display win32 --device 0" +} + +# Enable appverif and run again +Write-Host "Enabling appverifier for $vainfo_app_path and checking for the presence of $entrypoint supported..." +appverif.exe /logtofile enable +appverif.exe /verify "$vainfo_app_path" +appverif.exe /enable "Leak" -for "$vainfo_app_path" +$verifier_log_path="$testing_dir\vainfo_appverif_log.xml" +$result_with_appverifier = Check-VAInfo-Entrypoint -vainfo_app_path $vainfo_app_path -entrypoint $entrypoint +if ($result_with_appverifier -eq 1) { + Write-Host "Process exited successfully." + appverif.exe /logtofile disable +} else { + Write-Host "Process failed. Please see Application Verifier log contents below." + # Need to wait for appverif to exit before gathering log + Start-Process -Wait -FilePath "appverif.exe" -ArgumentList "-export", "log", "-for", "$vainfo_app_path", "-with", "to=$verifier_log_path" + Get-Content $verifier_log_path + Write-Error "Process exit not successful for $vainfo_run_cmd." + appverif.exe /logtofile disable + $successful_run=0 +} + +if ($successful_run -ne 1) { + Exit 1 +} + diff --git a/src/gallium/drivers/d3d12/ci/gitlab-ci.yml b/src/gallium/drivers/d3d12/ci/gitlab-ci.yml index 43d6a35eb9477..a1a9bf396b048 100644 --- a/src/gallium/drivers/d3d12/ci/gitlab-ci.yml +++ b/src/gallium/drivers/d3d12/ci/gitlab-ci.yml @@ -43,3 +43,9 @@ test-d3d12-quick_shader: variables: PIGLIT_SUITE: d3d12-quick_shader.toml PIGLIT_BASELINE: d3d12-quick_shader.txt + +test-d3d12-vainfo: + extends: + - .d3d12-test + script: + - . _install/vainfo_run.ps1