We are evaluating various AI frameworks to use within our code, and are hoping to use some of the build-in frameworks in macOS including CoreML and Vision. However, we need to use these frameworks in a background process (system extension) that has no user session attached to it. (To be pedantic, we'll be using an XPC service that is spawned by the system extension, but neither would have an associated user session).
Saying the daemon-safe frameworks list has not been updated in a while is an understatement, but it's all we have to go on. CoreGraphics isn't even listed--back then it part of ApplicationServices (I think?) and ApplicationServices is a no go. Vision does use CoreGraphics symbols and data types so I have doubts.
We do have a POC that uses both frameworks and they seem to function fine but obviously having something official is better. Any Apple engineers that can comment on this?
is there any update here?
Thanks for the ping. And sorry about the lack of follow up. You can consider this thread to be roadkill on the highway to WWDC (-:
they're listed in the macOS release notes
Unfortunately that iOS advice isn’t directly applicable to macOS. iOS doesn’t have the equivalent of the global execution context we use for launchd daemons on the Mac.
The discussions I had with folks prior to WWDC made it clear that… well… things aren’t clear. If the framework you’re using guarantees that this process will get done on the CPU, then I don’t anticipate any problems. If it might get done on the GPU or NE [1], I’m much less confident. You’re straying into the world of implementation details, where things might work but that could change in different contexts, or over time.
Probably my best advice right now is to file a bug against the docs for the specific API you’re using, asking that they clarify whether that API is expected to work from the global context in which you’re running (so either launchd daemon or system extension).
Please post your bug number, just for the record.
@eddiewangyw, I recommend that you do the same.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] This is a momentous occasion, being the first time I’ve used NE to mean something other than Network Extension (-: Hmmm, maybe I should adopt ANE instead.