diff --git a/ds4_metal.m b/ds4_metal.m index 6870bf9a..d89424b3 100644 --- a/ds4_metal.m +++ b/ds4_metal.m @@ -2663,6 +2663,14 @@ int ds4_gpu_init(void) { @autoreleasepool { g_device = MTLCreateSystemDefaultDevice(); + if (!g_device) { + NSArray> *devices = MTLCopyAllDevices(); + if ([devices count] > 0) { + g_device = devices[0]; + fprintf(stderr, "ds4: default Metal device unavailable; using enumerated device %s\n", + g_device.name ? [g_device.name UTF8String] : "unknown Metal device"); + } + } if (!g_device) { fprintf(stderr, "ds4: Metal device not available\n"); return 0;