1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 08:20:24 +08:00
This commit is contained in:
源文雨
2026-03-27 00:00:14 +08:00
parent 1eea9fa263
commit 3655795413

View File

@@ -74,27 +74,31 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install -y intel-level-zero-gpu level-zero sudo apt-get install -y intel-level-zero-gpu level-zero
# Discover the actual install path of libze_loader.so and expose it
# to subsequent steps so the Go runtime can find it at process startup.
LIB_PATH=$(dirname "$(find /usr -name 'libze_loader.so*' -print -quit 2>/dev/null)")
echo "Found libze_loader at: ${LIB_PATH}"
echo "LD_LIBRARY_PATH=${LIB_PATH}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> "$GITHUB_ENV"
- name: Install Intel Level Zero (Windows) - name: Install Intel Level Zero (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: pwsh shell: pwsh
run: | run: |
# The win-sdk zip only contains headers + import .lib files, no runtime DLLs.
# Build ze_loader.dll / ze_null.dll from source using the bundled MSVC toolchain.
$release = Invoke-RestMethod "https://api.github.com/repos/oneapi-src/level-zero/releases/latest" $release = Invoke-RestMethod "https://api.github.com/repos/oneapi-src/level-zero/releases/latest"
$asset = $release.assets | Where-Object { $_.name -match 'win.*\.zip$' } | Select-Object -First 1 $tag = $release.tag_name
if ($asset) { Write-Host "Building level-zero $tag from source"
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile level-zero-win.zip git clone https://github.com/oneapi-src/level-zero.git --depth=1 --branch $tag level-zero-src
Expand-Archive level-zero-win.zip -DestinationPath level-zero-win cmake -S level-zero-src -B level-zero-build `
# Copy all DLLs: ze_loader.dll, ze_null.dll, ze_validation_layer.dll, etc. -DCMAKE_BUILD_TYPE=Release `
$dlls = Get-ChildItem -Recurse -Filter "*.dll" -Path level-zero-win -DBUILD_TESTING=OFF
if ($dlls) { cmake --build level-zero-build --config Release --parallel
foreach ($dll in $dlls) { # Install all produced DLLs (ze_loader, ze_null, ze_validation_layer, ze_tracing_layer)
Copy-Item $dll.FullName "$env:SystemRoot\System32\" -Force $dlls = Get-ChildItem -Recurse -Filter "*.dll" -Path level-zero-build
Write-Host "Installed $($dll.Name) to System32" foreach ($dll in $dlls) {
} Copy-Item $dll.FullName "$env:SystemRoot\System32\" -Force
} else { Write-Host "Installed $($dll.Name) to System32"
Write-Warning "No DLLs found in downloaded archive"
}
} else {
Write-Warning "No Windows zip asset found in level-zero releases, skipping"
} }
- name: Run examples - name: Run examples