mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-27 03:11:28 +00:00
Fixes a crash on macOS 15 when using CoreML. (#22277)
### Description In macOS 15, apps running with CoreML will crash with an error message like this one: ``` Terminating app due to uncaught exception 'NSGenericException', reason: 'Failed to set compute_device_types_mask E5RT: Cannot provide zero compute device types. (1)' ``` This can be easily seen when building ONNXRuntime from source and running the unit tests. The fix was suggested in [this bug report](https://forums.developer.apple.com/forums/thread/757040). I've ported the change to ONNXRuntime and verified that: * The issue is resolved in macOS 15 (all unit tests pass). * The behaviour is unchanged in macOS 14. ### Motivation and Context This fixes #22275 allowing apps using ONNXRuntime with CoreML to work normally.
This commit is contained in:
parent
ee7081b828
commit
ffca096b5a
1 changed files with 1 additions and 1 deletions
|
|
@ -394,7 +394,7 @@ Status Execution::LoadModel() {
|
|||
|
||||
compiled_model_path_ = [compileUrl path];
|
||||
|
||||
MLModelConfiguration* config = [MLModelConfiguration alloc];
|
||||
MLModelConfiguration* config = [[MLModelConfiguration alloc] init];
|
||||
config.computeUnits = (coreml_flags_ & COREML_FLAG_USE_CPU_ONLY)
|
||||
? MLComputeUnitsCPUOnly
|
||||
: MLComputeUnitsAll;
|
||||
|
|
|
|||
Loading…
Reference in a new issue