Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/windows-amd-clang-warp-preview-d3d12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Windows D3D12 Warp Preview Clang

permissions:
contents: read
checks: write

on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *' # run every 2 hours

jobs:
Windows-D3D12-Warp-Clang:
uses: ./.github/workflows/build-and-test-callable.yaml
with:
OS: windows
SKU: windows-amd
TestTarget: check-hlsl-clang-warp-d3d12
OffloadTest-branch: ${{ github.ref }}
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DOFFLOADTEST_USE_CLANG_TIDY=On -DWARP_VERSION=1.0.15-preview
21 changes: 21 additions & 0 deletions .github/workflows/windows-amd-dxc-warp-preview-d3d12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Windows D3D12 Warp Preview DXC

permissions:
contents: read
checks: write

on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *' # run every 2 hours

jobs:
Windows-D3D12-Warp-DXC:
uses: ./.github/workflows/build-and-test-callable.yaml
with:
OS: windows
SKU: windows-amd
BuildType: Debug
TestTarget: check-hlsl-warp-d3d12
OffloadTest-branch: ${{ github.ref }}
LLVM-ExtraCMakeArgs: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DWARP_VERSION=1.0.15-preview
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Experimental Runtime test suite for HLSL
| Windows DirectX12 AMD GPU | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-dxc-d3d12.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-clang-d3d12.yaml/badge.svg) |
| Windows DirectX12 Intel GPU | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-dxc-d3d12.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-clang-d3d12.yaml/badge.svg) |
| Windows DirectX12 NVIDIA GPU | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-dxc-d3d12.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-clang-d3d12.yaml/badge.svg) |
| Windows DirectX12 Warp | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-dxc-warp-d3d12.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-clang-warp-d3d12.yaml/badge.svg) |
| Windows DirectX12 Warp (LKG) | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-dxc-warp-d3d12.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-clang-warp-d3d12.yaml/badge.svg) |
| Windows DirectX12 Warp (1.0.15-preview) | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-dxc-warp-preview-d3d12.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-clang-warp-preview-d3d12.yaml/badge.svg) |
| Windows Vulkan AMD GPU | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-dxc-vk.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-amd-clang-vk.yaml/badge.svg) |
| Windows Vulkan Intel GPU | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-dxc-vk.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-intel-clang-vk.yaml/badge.svg) |
| Windows Vulkan NVIDIA GPU | ![DXC](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-dxc-vk.yaml/badge.svg) | ![Clang](https://github.com/llvm/offload-test-suite/actions/workflows/windows-nvidia-clang-vk.yaml/badge.svg) |
Expand Down
42 changes: 36 additions & 6 deletions cmake/modules/Warp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,54 @@ function(setup_warp version)
return()
endif()

message(STATUS "Fetching WARP ${version}...")
if (version STREQUAL "LKG")
if (NUGET_ARCH STREQUAL "arm64")
set(version "1.0.14.2")
else()
set(version "1.0.10.1")
endif()
set(version_description "Latest Known Good (${version})")
else ()
set(version_description "Custom (${version})")
endif()

message(STATUS "Fetching WARP ${version_description}...")

set(WARP_ARCHIVE "${CMAKE_CURRENT_BINARY_DIR}/Microsoft.Direct3D.WARP.${version}.zip")
file(DOWNLOAD "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/${version}/" ${WARP_ARCHIVE})
if (version STREQUAL "Latest")
file(DOWNLOAD "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/" ${WARP_ARCHIVE})
else()
file(DOWNLOAD "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/${version}/" ${WARP_ARCHIVE})
endif()

guess_nuget_arch(NUGET_ARCH)

file(ARCHIVE_EXTRACT INPUT ${WARP_ARCHIVE} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/warp" PATTERNS *${NUGET_ARCH}*dll *${NUGET_ARCH}*pdb)
# This is all awfulness to work around the fact that the last known good WRAP
# for x64 is before arm64 support was shipped via NuGet, and the packaging
# changed and we just aren't allowed to have nice things.
file(ARCHIVE_EXTRACT INPUT ${WARP_ARCHIVE} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/warp" PATTERNS *dll *pdb)

file(GLOB_RECURSE LIBS "${CMAKE_CURRENT_BINARY_DIR}/warp/*.dll" $<IF:$<CONFIG:DEBUG>,"${CMAKE_CURRENT_BINARY_DIR}/warp/*.pdb">)
file(GLOB_RECURSE LIBS "${CMAKE_CURRENT_BINARY_DIR}/warp/build/native/*/${NUGET_ARCH}/*.dll"
$<IF:$<CONFIG:DEBUG>,"${CMAKE_CURRENT_BINARY_DIR}/warp/build/native/*/${NUGET_ARCH}/*.pdb">)

if (${NUGET_ARCH} STREQUAL "x64" AND NOT LIBS)
file(GLOB_RECURSE LIBS "${CMAKE_CURRENT_BINARY_DIR}/warp/build/native/amd64/*.dll"
$<IF:$<CONFIG:DEBUG>,"${CMAKE_CURRENT_BINARY_DIR}/warp/build/native/amd64/*.pdb">)
endif ()

if (NOT LIBS)
message(FATAL_ERROR "Requested version of WARP does not support current architecture (or it was packaged in a way we don't handle).")
endif()

file(MAKE_DIRECTORY "${LLVM_RUNTIME_OUTPUT_INTDIR}")
foreach(FILE ${LIBS})
get_filename_component(FILENAME ${FILE} NAME)
file(COPY_FILE ${FILE} "${LLVM_RUNTIME_OUTPUT_INTDIR}/${FILENAME}")
endforeach()

file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/warp")
set_property(GLOBAL PROPERTY WARP_ARCHITECTURE ${NUGET_ARCH})
endfunction()

set(WARP_VERSION "System" CACHE STRING "")
setup_warp(${WARP_VERSION})
set(WARP_VERSION "LKG" CACHE STRING "")
setup_warp(${WARP_VERSION})
12 changes: 7 additions & 5 deletions docs/WARP.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ WARP:
non-WARP configurations. This is useful if you're running Windows in a VM and
do not have a physical GPU.

* **WARP_VERSION** - Defaults to `System` which uses the system version of WARP.
This option may also be set to an explicit WARP version, and the configuration
step will pull WARP from NuGet. See the [NuGet package
listing](https://www.nuget.org/packages/Microsoft.Direct3D.WARP) to identify
valid versions.
* **WARP_VERSION** - Defaults to `LKG` which uses a Known-Good version of WARP.
This is the default version tested in the GitHub actions. Alternatively this
option may be set to the special values `System` to use the system version or
`Latest` to use the latest non-preview version, or it may be set to an
explicit WARP version, and the configuration step will pull WARP from NuGet.
See the [NuGet package listing](https://www.nuget.org/packages/Microsoft.Direct3D.WARP)
to identify valid versions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ endif()
if (OFFLOADTEST_ENABLE_D3D12 AND WIN32)
set(TEST_d3d12 True)
set(FORCE_WARP True)
get_property(WARP_ARCHITECTURE GLOBAL PROPERTY WARP_ARCHITECTURE)
add_offloadtest_lit_suite(warp-d3d12)

if (OFFLOADTEST_TEST_CLANG)
Expand Down
3 changes: 2 additions & 1 deletion test/Feature/HLSLLib/firstbithigh.64.test
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ DescriptorSets:
# UNSUPPORTED: DXC-Vulkan

# https://github.com/microsoft/DirectXShaderCompiler/issues/7502
# WARP firstbithigh(s64 -1) should return -1 but returns 32
# WARP firstbithigh(s64 -1) should return -1 but returns 32 on older versions of
# Warp. This was fixed for x86 in 1.0.14, but not for arm64.
# XFAIL: DirectX-WARP

# https://github.com/llvm/llvm-project/issues/143171
Expand Down
1 change: 1 addition & 0 deletions test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def setDeviceFeatures(config, device, compiler):
config.available_features.add(API)
if "Microsoft Basic Render Driver" in device["Description"]:
config.available_features.add("%s-WARP" % API)
config.available_features.add("WARP-%s" % config.warp_arch)
if "Intel" in device["Description"]:
config.available_features.add("%s-Intel" % API)
if "UHD Graphics" in device["Description"] and API == "DirectX":
Expand Down
2 changes: 2 additions & 0 deletions test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ config.offloadtest_dxc = '"' + path(r"@DXC_EXECUTABLE@") + '"'
config.offloadtest_supports_spirv = @SUPPORTS_SPIRV@
config.offloadtest_test_clang = @FORCE_CLANG@
config.offloadtest_test_warp = @FORCE_WARP@
if config.offloadtest_test_warp:
config.warp_arch = r"@WARP_ARCHITECTURE@"
config.offloadtest_dxc_dir = r"@DXC_DIR@"
config.goldenimage_dir = r"@GOLDENIMAGE_DIR@"

Expand Down
Loading