Skip to content

Commit bc1d702

Browse files
Switch to macos-15-intel for x64 load tests (#660)
* Rely less on Xcode to check gpu architecture
1 parent fdff9e3 commit bc1d702

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

.github/workflows/Load.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- '1' # latest stable 1.x release
2727
os:
2828
- 'ubuntu-latest'
29-
- 'macOS-13'
29+
- 'macOS-15-intel'
3030
- 'windows-latest'
3131
arch:
3232
- x64

test/runtests.jl

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,34 @@ if !Sys.isapple()
1212
Skipping tests."""
1313
Sys.exit()
1414
else # if Sys.isapple()
15-
cmd = pipeline(Cmd(`xcrun -f metal-arch`, ignorestatus = true), stdout = devnull, stderr = devnull)
16-
is_xcode_present = run(cmd).exitcode == 0
15+
# Skip tests on older unsupported versions
16+
if !Metal.is_macos(v"13")
17+
@warn """Metal.jl succesfully loaded on unsupported macOS version (v$(Metal.macos_version())).
18+
This system is unsupported but should still load.
19+
Skipping tests."""
20+
Sys.exit()
21+
end
22+
23+
archname = if Metal.is_macos(v"14")
24+
arch = device().architecture
25+
if !isnothing(arch)
26+
string(arch.name)
27+
else
28+
""
29+
end
30+
end
31+
32+
# device.architecture returns null on Intel graphics devices so use Xcode
33+
if isempty(archname)
34+
cmd = pipeline(Cmd(`xcrun -f metal-arch`, ignorestatus = true), stdout = devnull, stderr = devnull)
35+
36+
if run(cmd).exitcode == 0 # Check that Xcode is installed
37+
archname = read(`xcrun metal-arch --name`, String)
38+
end
39+
end
1740

18-
if is_xcode_present
19-
archchecker = occursin(read(`xcrun metal-arch --name`, String))
41+
if !isempty(archname)
42+
archchecker = occursin(archname)
2043
if archchecker("Paravirtual") # Virtualized graphics (probably Github Actions runners)
2144
@warn """Metal.jl succesfully loaded on macOS system with unsupported Paravirtual graphics.
2245
This system is unsupported but should still load.

0 commit comments

Comments
 (0)