-
-
Save mhorga/602949a37d58ee68bc5ca281a504d31c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
class ViewController: NSViewController { | |
@IBOutlet weak var label: NSTextField! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let devices = MTLCopyAllDevices() | |
guard let _ = devices.first else { | |
fatalError("Your GPU does not support Metal!") | |
} | |
label.stringValue = "Your system has the following GPU(s):\n" | |
for device in devices { | |
label.stringValue += "\(device.name)\n" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment