Skip to content

Commit

Permalink
Test suite: Assume compatible system if xcode not installed (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd authored Feb 12, 2025
1 parent f3549a4 commit 3ad45e2
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ if !Sys.isapple()
Skipping tests."""
Sys.exit()
else # if Sys.isapple()
archchecker = occursin(read(`xcrun metal-arch --name`, String))
if archchecker("Paravirtual") # Virtualized graphics (probably Github Actions runners)
@warn """Metal.jl succesfully loaded on macOS system with unsupported Paravirtual graphics.
This system is unsupported but should still load.
Skipping tests."""
Sys.exit()
elseif !archchecker("applegpu") # Every other unsupported system (Intel or AMD graphics)
@warn """Metal.jl succesfully loaded on macOS system with unsupported graphics.
This system is unsupported but should still load.
Skipping tests."""
Sys.exit()
cmd = pipeline(Cmd(`xcrun -f metal-arch`, ignorestatus = true), stdout = devnull, stderr = devnull)
is_xcode_present = run(cmd).exitcode == 0

if is_xcode_present
archchecker = occursin(read(`xcrun metal-arch --name`, String))
if archchecker("Paravirtual") # Virtualized graphics (probably Github Actions runners)
@warn """Metal.jl succesfully loaded on macOS system with unsupported Paravirtual graphics.
This system is unsupported but should still load.
Skipping tests."""
Sys.exit()
elseif !archchecker("applegpu") # Every other unsupported system (Intel or AMD graphics)
@warn """Metal.jl succesfully loaded on macOS system with unsupported graphics.
This system is unsupported but should still load.
Skipping tests."""
Sys.exit()
end
else
@info "GPU architecture could not be detected, assuming supported device."
end
end

Expand Down

0 comments on commit 3ad45e2

Please sign in to comment.