All demos (and some unit tests) use MTLCreateSystemDefaultDevice()! which may or may not return a valid device on all platforms. See https://developer.apple.com/documentation/metal/1433401-mtlcreatesystemdefaultdevice See also #5