Skip to content

Unpack LLVM Distribution, and setup lit to run tests for specific test suite#1149

Open
bob80905 wants to merge 19 commits into
llvm:mainfrom
bob80905:fix-test-job-regen
Open

Unpack LLVM Distribution, and setup lit to run tests for specific test suite#1149
bob80905 wants to merge 19 commits into
llvm:mainfrom
bob80905:fix-test-job-regen

Conversation

@bob80905
Copy link
Copy Markdown
Contributor

@bob80905 bob80905 commented May 4, 2026

We are still encountering errors when configuring cmake with ninja, as ninja cannot be found:
https://github.com/llvm/offload-test-suite/actions/runs/25338698984/job/74291993540#step:13:155
Though the path is correct on the build machine's environment, it no longer holds in the test machine's (a different machine's) environment.
@Icohedron recommended a completely different approach, which involves installing an llvm distribution to the test machine. This avoids needing to replace exe paths in CMakeCache.txt files, and avoids dealing with CMake entirely.
This PR sets up the infrastructure for installing the LLVM offload distribution (with all relevant files) without needing ninja or cmake, and just running lit tests on the appropriate suite.

Assisted by Github Copilot.
Fixes #1150

@Icohedron
Copy link
Copy Markdown
Contributor

Icohedron commented May 8, 2026

As discussed offline, I do not think this is the correct approach. The CMakeCache file is very specific to the machine and is not portable to other machines. Simply patching the CMakeCache file is not a robust solution.

Instead, I think the better approach is to define an LLVM distribution that builds and installs the offloader, clang, and other dependencies into a self-contained and portable package. This package can then be distributed and ran on other machines without any additional building required.

Similarly for the offload tests, an install target can be defined that copies over all the lit tests into its own install prefix (which may or may not be the same as the install prefix for the LLVM distribution).

The main issue to solve would be getting lit to find all the dependencies required to run the tests. A solution for this would be to include a Python script that scans for the required dependencies and uses the information to generate a lit.site.cfg.py to satisfy the requirements for running lit tests.

@bob80905 bob80905 changed the title Patch ninja exe path to whatever is in test runner env, and foolproof cmake timestamps Unpack LLVM Distribution, and setup lit to run tests for specific test suite May 8, 2026
cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images -DHLSL_ENABLE_OFFLOAD_DISTRIBUTION=${{ inputs.SplitBuild == true && 'On' || 'Off' }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install ${{ github.workspace }}/llvm-project/llvm/
ninja hlsl-test-depends
- name: Dump GPU Info
- name: Dump GPU Info (build runner)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, though it doesn't seem to make sense long term to have a dump gpu info step on the build runner machine, it does make sense to have it short term, since PRs will continue to run with splitbuild disabled while I test and validate that everything is working correctly.

"d3d12": (True, False, False, False, False, "DXC-compiled shaders on DirectX 12"),
"vk": (False, True, False, False, False, "DXC-compiled shaders on Vulkan"),
"mtl": (False, False, True, False, False, "DXC-compiled shaders on Metal"),
"clang-d3d12": (
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks different because darker formatted it like this.

Comment thread .github/workflows/build-and-test-callable.yaml Outdated
mkdir build
cd build
cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/
cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images -DHLSL_ENABLE_OFFLOAD_DISTRIBUTION=${{ inputs.SplitBuild == true && 'On' || 'Off' }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install ${{ github.workspace }}/llvm-project/llvm/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: HLSL_ENABLE_OFFLOAD_DISTRIBUTION is introduced in PR llvm/llvm-project#196640

Comment thread test/CMakeLists.txt Outdated
Comment thread .github/workflows/build-and-test-callable.yaml Outdated
Comment thread utils/configure-test-suite.py
Comment thread utils/configure-test-suite.py Outdated
Comment thread utils/configure-test-suite.py Outdated
Comment thread utils/configure-test-suite.py Outdated
Comment thread utils/configure-test-suite.py Outdated
Comment thread .github/workflows/build-and-test-callable.yaml Outdated
Comment thread .github/workflows/build-and-test-callable.yaml Outdated
bob80905 added a commit to llvm/llvm-project that referenced this pull request May 13, 2026
This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other
machines so that offload testing can be optimized.
Assisted by: Github Copilot
This PR was inspired by @Icohedron 's comment here:
llvm/offload-test-suite#1149 (comment)
This addresses llvm/offload-test-suite#1150
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request May 13, 2026
This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other
machines so that offload testing can be optimized.
Assisted by: Github Copilot
This PR was inspired by @Icohedron 's comment here:
llvm/offload-test-suite#1149 (comment)
This addresses llvm/offload-test-suite#1150
llvm-upstreamsync Bot pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request May 13, 2026
This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other
machines so that offload testing can be optimized.
Assisted by: Github Copilot
This PR was inspired by @Icohedron 's comment here:
llvm/offload-test-suite#1149 (comment)
This addresses llvm/offload-test-suite#1150
Comment thread .github/workflows/build-and-test-callable.yaml Outdated
Comment thread .github/workflows/build-and-test-callable.yaml Outdated
cpullvm-upstream-sync Bot pushed a commit to navaneethshan/cpullvm-toolchain-1 that referenced this pull request May 13, 2026
This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other
machines so that offload testing can be optimized.
Assisted by: Github Copilot
This PR was inspired by @Icohedron 's comment here:
llvm/offload-test-suite#1149 (comment)
This addresses llvm/offload-test-suite#1150
Comment thread .github/workflows/build-and-test-callable.yaml
Comment thread .github/workflows/build-and-test-callable.yaml Outdated
EuphoricThinking pushed a commit to EuphoricThinking/llvm-project that referenced this pull request May 14, 2026
This PR adds a new distribution to the HLSL cmake file.
The purpose is so that we can portably distribute binaries to other
machines so that offload testing can be optimized.
Assisted by: Github Copilot
This PR was inspired by @Icohedron 's comment here:
llvm/offload-test-suite#1149 (comment)
This addresses llvm/offload-test-suite#1150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split build test feature cannot find ninja.exe on test runner machine

3 participants