diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13eabef2..f1144754 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,12 @@ permissions: jobs: test: - runs-on: github-gpu + strategy: + matrix: + include: + - machine: github-gpu + - machine: macos-latest-xlarge + runs-on: ${{ matrix.machine }} steps: - uses: actions/checkout@v4 diff --git a/scripts/debug_mac_gpu.swift b/scripts/debug_mac_gpu.swift new file mode 100644 index 00000000..b09ded89 --- /dev/null +++ b/scripts/debug_mac_gpu.swift @@ -0,0 +1,39 @@ +import Metal +import MetalPerformanceShaders + +guard let device = MTLCreateSystemDefaultDevice() else { + print("Error: Could not find Metal device.") + exit(1) +} +print("Name: \(device.name)") +print("Is Headless: \(device.isHeadless)") +print("Supports Raytracing: \(device.supportsRaytracing)") +print("Supports Dynamic Libraries: \(device.supportsDynamicLibraries)") +print("Max Buffer (GB): \(String(format: "%.2f", Double(device.maxBufferLength) / 1.0e9))") +print("Recommended Max VRAM (GB): \(String(format: "%.2f", Double(device.recommendedMaxWorkingSetSize) / 1.0e9))") +if device.supportsFamily(.metal3) { + print("Supports Metal 3 features") +} else { + print("Does not support Metal 3 features") +} +if device.supportsFamily(.common3) { + print("Supports Common Family 3 features") +} else { + print("Does not support Common Family 3 features") +} +if device.supportsFamily(.common2) { + print("Supports Common Family 2 features") +} else { + print("Does not support Common Family 2 features") +} +if device.supportsFamily(.common1) { + print("Supports Common Family 1 features") +} else { + print("Does not support Common Family 1 features") +} +if MPSSupportsMTLDevice(device) { + print("Supports Metal Performance Shaders") +} else { + print("Does not support Metal Performance Shaders") +} + diff --git a/solutions/run.sh b/solutions/run.sh index 8480e54d..bc6dfa2b 100644 --- a/solutions/run.sh +++ b/solutions/run.sh @@ -57,12 +57,12 @@ detect_gpu_platform() { fi # Check for Apple Silicon (macOS) - if [[ "$OSTYPE" == "darwin"* ]]; then - if system_profiler SPDisplaysDataType 2>/dev/null | grep -q "Apple"; then + if [[ "$(uname -s)" == "Darwin" ]]; then + if [[ "$(uname -m)" == "arm64" ]]; then echo "apple" return fi - fi + fi echo "unknown" } @@ -534,6 +534,19 @@ print_startup_banner() { local compute_cap=$(detect_gpu_compute_capability) local gpu_name="" + # TEMPORARY Debugging MacOS CI issue + local mac_displays_info=$(system_profiler SPDisplaysDataType) + local mac_hardware_info=$(system_profiler SPHardwareDataType) + local mac_swift_debug=$(swift ../scripts/debug_mac_gpu.swift) + echo -e "Debug info about Mac displays:" + echo -e "$mac_displays_info" + echo -e "Debug info about Mac hardware:" + echo -e "$mac_hardware_info" + echo -e "Debug info from Swift:" + echo -e "$mac_swift_debug" + + # End + echo -e "${BOLD}GPU Information:${NC}" echo -e " ${BULLET} Platform: ${CYAN}$(echo "$gpu_platform" | tr '[:lower:]' '[:upper:]')${NC}"