better handling of devices and choosing devices. fixes issues with multi GPU macs