Skip to content

Commit 4e654b6

Browse files
authored
Better support for Windows in shell scripts (#3035)
* Do not install spirv-dis on Windows (will revisit if this is required). * Use sycl-ls as last resort to identify GPU (works on Windows). Fixes #3033.
1 parent c4201fa commit 4e654b6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

scripts/capture-hw-details.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ if command -v clinfo &> /dev/null; then
4242
export GPU_DEVICE=$(clinfo --json | jq -r '[.devices[].online[] | select(.CL_DEVICE_TYPE.raw == 4)][0].CL_DEVICE_NAME')
4343
elif command -v nvidia-smi &> /dev/null; then
4444
export GPU_DEVICE=$(nvidia-smi -L | sed -e 's,\(.*\) (UUID.*),\1,')
45+
elif command -v sycl-ls &> /dev/null; then
46+
export GPU_DEVICE=$(ONEAPI_DEVICE_SELECTOR=level_zero:gpu sycl-ls --verbose 2>/dev/null | grep Name | sed -n '2p' | sed -E 's/\s+Name\s+:\s+(.+)$/\1/')
4547
else
4648
export GPU_DEVICE="Not Installed"
4749
fi

scripts/pytest-utils.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ capture_runtime_env() {
140140
}
141141

142142
ensure_spirv_dis() {
143+
# Does not work on Windows
144+
if [[ $OSTYPE = msys ]]; then
145+
return
146+
fi
143147
export PATH="$HOME/.local/bin:$PATH"
144148
local spirv_dis="$(which spirv-dis || true)"
145149
if [[ $spirv_dis ]]; then

0 commit comments

Comments
 (0)