diff options
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/docs/testing.md b/docs/testing.md index 0c187fdef..175e4b2bc 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -39,8 +39,9 @@ This page collects the setup steps and the problems testers have run into so far | |||
| 39 | conda-forge `llvm-tools` 23.1.6 package assembled the same f16 programs. | 39 | conda-forge `llvm-tools` 23.1.6 package assembled the same f16 programs. |
| 40 | - **SPIRV-Tools** (`spirv-as`, `spirv-val`): part of the Vulkan SDK, or a distribution package. | 40 | - **SPIRV-Tools** (`spirv-as`, `spirv-val`): part of the Vulkan SDK, or a distribution package. |
| 41 | - **A C++20 compiler, CMake and the Vulkan headers** to build the test programs: | 41 | - **A C++20 compiler, CMake and the Vulkan headers** to build the test programs: |
| 42 | - Windows: Visual Studio 2022 with "Desktop development with C++", the Windows SDK 10.0.26100 or newer, and the | 42 | - Windows: the full runtime needs Visual Studio 2022 with "Desktop development with C++" and Windows SDK |
| 43 | Vulkan SDK. | 43 | 10.0.26100 or newer. Install the Vulkan SDK for the backend headers. The standalone tools also compile with llvm-mingw and the Vulkan headers alone. |
| 44 | Running the GPU tests needs a Vulkan loader and a compatible driver. | ||
| 44 | - Linux: CMake 3.24+, GCC or Clang, and the Vulkan headers and loader. The headers should be recent enough | 45 | - Linux: CMake 3.24+, GCC or Clang, and the Vulkan headers and loader. The headers should be recent enough |
| 45 | for `VK_KHR_maintenance8`; older ones still build, but skip what needs it. | 46 | for `VK_KHR_maintenance8`; older ones still build, but skip what needs it. |
| 46 | - macOS: `brew install llvm molten-vk vulkan-headers vulkan-loader spirv-tools vulkan-tools`. The test programs | 47 | - macOS: `brew install llvm molten-vk vulkan-headers vulkan-loader spirv-tools vulkan-tools`. The test programs |
| @@ -54,6 +55,15 @@ Windows, from a "Developer PowerShell for VS 2022" or a plain shell: | |||
| 54 | scripts\build_runtime.ps1 # CMake + Ninja into runtime\build | 55 | scripts\build_runtime.ps1 # CMake + Ninja into runtime\build |
| 55 | ``` | 56 | ``` |
| 56 | 57 | ||
| 58 | For the standalone Vulkan tools, put llvm-mingw on `PATH` and point CMake at the directory containing `vulkan/vulkan.h`: | ||
| 59 | |||
| 60 | ```powershell | ||
| 61 | cmake -S runtime -B runtime/build/vulkan -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DLEONIDA_BUILD_WINDOWS_RUNTIME=OFF -DVulkan_INCLUDE_DIR=C:/Vulkan-Headers/include | ||
| 62 | cmake --build runtime/build/vulkan --parallel --target vk_harness vk_texture_test vk_sampler_test vk_compute_test vk_store_test vk_bindless_test | ||
| 63 | ``` | ||
| 64 | |||
| 65 | Pass `--build runtime/build/vulkan` to `scripts/run_gpu_tests.py`. | ||
| 66 | |||
| 57 | If you configure with CMake's Visual Studio generator instead, the programs end up in `runtime\build\Release` (or | 67 | If you configure with CMake's Visual Studio generator instead, the programs end up in `runtime\build\Release` (or |
| 58 | `RelWithDebInfo`); pass that folder to `--build` below. | 68 | `RelWithDebInfo`); pass that folder to `--build` below. |
| 59 | 69 | ||
| @@ -245,9 +255,11 @@ With more than one GPU, pick one through the Vulkan loader, for example | |||
| 245 | `vulkaninfo --summary` shows which devices the loader then sees. | 255 | `vulkaninfo --summary` shows which devices the loader then sees. |
| 246 | 256 | ||
| 247 | Two GPUs of one vendor share one driver, so the loader cannot tell them apart (an RTX 5070 Ti next to an RTX 3060, | 257 | Two GPUs of one vendor share one driver, so the loader cannot tell them apart (an RTX 5070 Ti next to an RTX 3060, |
| 248 | say; without a choice the D3D12 tests take the last discrete GPU). `LEONIDA_VK_DEVICE` names the GPU by part of its | 258 | say; without a choice the runtime and every test take the same one: a native driver over Microsoft's Dozen, discrete |
| 249 | name, without case: `LEONIDA_VK_DEVICE=5070` or `LEONIDA_VK_DEVICE=radeon`. The D3D12 tests (`vk_test_device.h`) | 259 | over integrated, the first on a tie, `vulkan_device_rank` in `runtime/src/vulkan_device_filter.h`). |
| 250 | and the layer's standalone device read it, and a value that matches no device fails the run instead of testing | 260 | `LEONIDA_VK_DEVICE` names the GPU by part of its name, without case: `LEONIDA_VK_DEVICE=5070` or |
| 261 | `LEONIDA_VK_DEVICE=radeon`. The D3D12 tests (`vk_test_device.h`) and the layer's standalone device read it, | ||
| 262 | and a value that matches no device fails the run instead of testing | ||
| 251 | another GPU. For the host side of the comparison tests, `LEONIDA_HOST_ADAPTER` picks the D3D12 adapter the same way. | 263 | another GPU. For the host side of the comparison tests, `LEONIDA_HOST_ADAPTER` picks the D3D12 adapter the same way. |
| 252 | The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) read it the same way through | 264 | The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) read it the same way through |
| 253 | `vk_device_pick.h`, and fail with a message naming the filter when it matches no device. | 265 | `vk_device_pick.h`, and fail with a message naming the filter when it matches no device. |
| @@ -275,7 +287,7 @@ The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) r | |||
| 275 | | CMake stops with "needs the Windows SDK 10.0.26100 or newer", or MSVC reports `'Desc_1_2': is not a member of 'D3D12_VERSIONED_ROOT_SIGNATURE_DESC'` | A Windows SDK older than 10.0.26100 (10.0.22621 is the common one), which has no version 1.2 root signatures | `winget install Microsoft.WindowsSDK.10.0.26100`, or add it in the Visual Studio Installer, then delete `runtime/build` and configure again | | 287 | | CMake stops with "needs the Windows SDK 10.0.26100 or newer", or MSVC reports `'Desc_1_2': is not a member of 'D3D12_VERSIONED_ROOT_SIGNATURE_DESC'` | A Windows SDK older than 10.0.26100 (10.0.22621 is the common one), which has no version 1.2 root signatures | `winget install Microsoft.WindowsSDK.10.0.26100`, or add it in the Visual Studio Installer, then delete `runtime/build` and configure again | |
| 276 | | `ctest` lists `fsr_dispatch` and `bvh_builder` as failed (`Not Run`) after clang-cl hits an internal compiler error in `fsr_dispatch_test.cpp` and `bvh_builder_test.cpp` | clang-cl 22.1.8 on Fedora (Linux cross-build) and Windows, plus 22.1.7 on Windows | Use clang-cl 23.1.6 (both files compile on Windows) | | 288 | | `ctest` lists `fsr_dispatch` and `bvh_builder` as failed (`Not Run`) after clang-cl hits an internal compiler error in `fsr_dispatch_test.cpp` and `bvh_builder_test.cpp` | clang-cl 22.1.8 on Fedora (Linux cross-build) and Windows, plus 22.1.7 on Windows | Use clang-cl 23.1.6 (both files compile on Windows) | |
| 277 | | `run_gpu_tests.py` fails on a `dict \| None` annotation | Python older than 3.10 | Use Python 3.11+ | | 289 | | `run_gpu_tests.py` fails on a `dict \| None` annotation | Python older than 3.10 | Use Python 3.11+ | |
| 278 | | `vulkaninfo` lists `Microsoft Direct3D12 (<gpu>)` next to the real GPU and the tests run on it | The Windows "OpenCL™, OpenGL® and Vulkan® Compatibility Pack" installs Mesa's Dozen, a Vulkan-on-D3D12 layer that reports `DISCRETE_GPU` like the native card | Current `main` prefers a native ICD over Microsoft's vendor (`0x1414`) in every harness; set `LEONIDA_VK_DEVICE=<part of the real GPU name>` to select explicitly. See #915. | | 290 | | `vulkaninfo` lists `Microsoft Direct3D12 (<gpu>)` next to the real GPU and the tests run on it | The Windows "OpenCL™, OpenGL® and Vulkan® Compatibility Pack" installs Mesa's Dozen, a Vulkan-on-D3D12 layer that reports `DISCRETE_GPU` like the native card | Current `main` prefers a native ICD over Microsoft's vendor (`0x1414`) in the runtime and every harness; set `LEONIDA_VK_DEVICE=<part of the real GPU name>` to select explicitly. See #915. | |
| 279 | | A GPU test that uses `image_load` (or lighting built from real shaders) reads zeros from its image; @Silliana saw every texel except pixel (0,0) come back zero in their own layer (#603, not reproduced here) | In this runtime the shader turns the T# words into an index through the descriptor hash table (`runtime/src/descriptor_table.h`: a miss gives index 0), and index 0 is a 1×1 image of zeros (`runtime/src/vulkan_bindless.h`), so a hand-built or zeroed T# that was never registered reads zeros even at (0,0). The translator does not compare coordinates with the T# size, and `cs_imgload.asm` only uses its T# words as a hash key | Register the descriptor through the runtime (for D3D12, create it with `CreateShaderResourceView`) so its T# hits the table, with the image's real width and height (stored as size − 1, see `runtime/src/gfx10_descriptors.h`) | | 291 | | A GPU test that uses `image_load` (or lighting built from real shaders) reads zeros from its image; @Silliana saw every texel except pixel (0,0) come back zero in their own layer (#603, not reproduced here) | In this runtime the shader turns the T# words into an index through the descriptor hash table (`runtime/src/descriptor_table.h`: a miss gives index 0), and index 0 is a 1×1 image of zeros (`runtime/src/vulkan_bindless.h`), so a hand-built or zeroed T# that was never registered reads zeros even at (0,0). The translator does not compare coordinates with the T# size, and `cs_imgload.asm` only uses its T# words as a hash key | Register the descriptor through the runtime (for D3D12, create it with `CreateShaderResourceView`) so its T# hits the table, with the image's real width and height (stored as size − 1, see `runtime/src/gfx10_descriptors.h`) | |
| 280 | 292 | ||
| 281 | ## Posting your result | 293 | ## Posting your result |