Skip to content

Commit

Permalink
ci: use llvmpipe instead of swiftshader in presubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
kpet committed Nov 24, 2024
1 parent 1c378c2 commit e0b62bd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- mesaci
pull_request:

jobs:
Expand Down Expand Up @@ -164,11 +165,11 @@ jobs:
${{ env.android-cmake-args }} \
-DCLVK_CLSPV_ONLINE_COMPILER=${{ matrix.online-compiler }}
- name: Build
run: cmake --build '${{ env.builddir }}' --config Release -j2
run: cmake --build '${{ env.builddir }}' --config Release --parallel
- name: Build clspv
run: cmake --build '${{ env.builddir }}' --config Release --target clspv -j2
run: cmake --build '${{ env.builddir }}' --config Release --parallel --target clspv
- name: Build clang
run: cmake --build '${{ env.builddir }}' --config Release --target clang -j2
run: cmake --build '${{ env.builddir }}' --config Release --parallel --target clang
if: ${{ matrix.compiler-available && matrix.android-abi == '' }}
- name: Install
run: cmake --install '${{ env.builddir }}'
Expand All @@ -179,25 +180,33 @@ jobs:
- name: Show stats
shell: bash
run: df -h
- name: Download Swiftshader artifacts
- name: Download Mesa artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-swiftshader.yml
workflow: build-mesa.yml
workflow_conclusion: success
name: swiftshader-${{ runner.os }}
path: swiftshader
- name: Register Swiftshader ICD
name: mesa-${{ runner.os }}
path: mesa
- name: Fixup Mesa ICD JSON
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
./tests/fixup-mesa-icd-json.py --input '${{ github.workspace }}'/mesa/lvp_icd.aarch64.json --output '${{ github.workspace }}'/mesa/lvp_icd.json
else
./tests/fixup-mesa-icd-json.py --input '${{ github.workspace }}'/mesa/lvp_icd.x86_64.json --output '${{ github.workspace }}'/mesa/lvp_icd.json
fi
- name: Register Mesa ICD
if: ${{ matrix.os == 'windows-2019' }}
run: |
reg query 'HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers'
reg add 'HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers' /v '${{ github.workspace }}\swiftshader\vk_swiftshader_icd.json' /t REG_DWORD /d 0
reg add 'HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers' /v '${{ github.workspace }}\mesa\lvp_icd.json' /t REG_DWORD /d 0
reg query 'HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers'
- name: Prepare test execution
shell: bash
run: |
ls -l '${{ github.workspace }}'/swiftshader
ls -l '${{ github.workspace }}'/mesa
ls -l '${{ env.builddir }}'
echo "VK_ICD_FILENAMES=${{ github.workspace }}/swiftshader/vk_swiftshader_icd.json" >> $GITHUB_ENV
echo "VK_ICD_FILENAMES=${{ github.workspace }}/mesa/lvp_icd.json" >> $GITHUB_ENV
echo "CLVK_LOG=3" >> $GITHUB_ENV
echo "CLVK_LOG_DEST=stderr" >> $GITHUB_ENV
echo "VK_LOADER_DEBUG=all" >> $GITHUB_ENV
Expand All @@ -209,9 +218,9 @@ jobs:
if [ "$RUNNER_OS" == "Windows" ]; then
find '${{ env.builddir }}' -name clang.exe
find '${{ env.builddir }}' -name OpenCL.dll
cat '${{ github.workspace }}'/swiftshader/vk_swiftshader_icd.json
cat '${{ github.workspace }}'/mesa/lvp_icd.json
cp '${{ github.workspace }}'/vulkanrt/vulkan-1.dll '${{ env.builddir }}'
cp '${{ github.workspace }}'/swiftshader/vk_swiftshader.dll '${{ github.workspace }}'/..
cp '${{ github.workspace }}'/mesa/vulkan_lvp.dll '${{ github.workspace }}'/..
cp '${{ env.builddir }}'/src/OpenCL.dll '${{ env.builddir }}'
fi
echo "testbindir=${{ env.builddir }}" >> $GITHUB_ENV
Expand Down
21 changes: 21 additions & 0 deletions tests/fixup-mesa-icd-json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

import argparse
import json
import os

parser = argparse.ArgumentParser()
parser.add_argument('--output', required=True)
parser.add_argument('--input', required=True)
args = parser.parse_args()

with open(args.input) as f:
data = json.load(f)
lpath = data['ICD']['library_path']
print(f"Origial library_path: {lpath}")
lpath = './' + os.path.basename(lpath)
print(f"Fixed up library_path: {lpath}")
data['ICD']['library_path'] = lpath

with open(args.output, 'w') as f:
json.dump(data, f)

0 comments on commit e0b62bd

Please sign in to comment.