Stop execution of OnDeviceModelService utility

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Stop execution of OnDeviceModelService utility

Postby bjdupuis » Mon Dec 15, 2025 12:52 pm

We've noticed that the utility subprocess associated with the OnDeviceModelService doesn't always exit when we exit the rest of the application. A search online says this is associated with on-device AI model usage. Our application doesn't make use of these features, nor do we intend to. As such, it would be beneficial for us to just not have that enabled, as it creates issues with our updaters when the process won't quit when the rest does. Is there any way to accomplish this?
bjdupuis
Mentor
 
Posts: 82
Joined: Thu Jan 05, 2023 10:16 am

Re: Stop execution of OnDeviceModelService utility

Postby bjdupuis » Mon Dec 15, 2025 12:59 pm

Well... did I stumble on the right answer by accident? Adding "OnDeviceModelService" to the "disable-features" list sent in the command line seems to have done it. Is that the correct way?
bjdupuis
Mentor
 
Posts: 82
Joined: Thu Jan 05, 2023 10:16 am

Re: Stop execution of OnDeviceModelService utility

Postby bjdupuis » Thu May 07, 2026 10:16 am

Nope, I didn't stumble on the answer. Disabling that feature doesn't keep it from executing. Any other thoughts, please?
bjdupuis
Mentor
 
Posts: 82
Joined: Thu Jan 05, 2023 10:16 am

Re: Stop execution of OnDeviceModelService utility

Postby Phylanx » Fri May 08, 2026 12:23 am

I don't know which functionality you still have, but I guess you want to disable the background communication to google in general.
As far as we got, these changes were helpful (but didn't disable them completely):

Code: Select all
--disable-features=AutofillServerCommunication,OnDeviceModelService,OptimizationGuideOnDeviceModel,OptimizationGuideModelExecution


Additionally we are currently testing to disable GCM in general, see the patch in brave repository for details:
Brave Commit: https://github.com/brave/brave-core/com ... 55b543d0f6
Brave Issue: https://github.com/brave/brave-browser/issues/1716

Also see our jcef related thread we used there: viewtopic.php?f=17&t=20471
Phylanx
Expert
 
Posts: 274
Joined: Thu Aug 11, 2016 8:17 am

Re: Stop execution of OnDeviceModelService utility

Postby bjdupuis » Fri May 08, 2026 9:59 am

Unfortunately, that's what I already tried. The disable-features for OnDeviceModelService doesn't appear to do anything to keep it from running that process. Ideally we'd be able to disable all of those things since I don't love having an entirely unnecessary AI model being downloaded/utilized in our product which has no need for it. That said, I want this one gone specifically because it so often ends up as an orphan process that just won't quit when our application quits. It therefore holds files open and prevents clean updates and other install-related tasks.

EDIT: Thanks for your jcef link... reading through now.

EDIT EDIT: I'm wondering if I can just detect at process launch time that it's the OnDeviceModelService utility process and just exit. Not even let it start. My only worry is that Chromium attempts to relaunch it forever at some rate. I may give it a shot.
bjdupuis
Mentor
 
Posts: 82
Joined: Thu Jan 05, 2023 10:16 am

Re: Stop execution of OnDeviceModelService utility

Postby bjdupuis » Fri May 08, 2026 3:16 pm

Yep, I believe this is how I'll accomplish this given the provided mechanism isn't obeyed. In the wWinMain() method:

Code: Select all
   const std::string process_type = command_line->GetSwitchValue("type");
   const std::string utility_sub_type = command_line->GetSwitchValue("utility-sub-type");
   if (process_type == "utility" && utility_sub_type == "on_device_model.mojom.OnDeviceModelService")
   {
      ::OutputDebugString(L"Ending Chromium OnDeviceModelService utility process\n");
      return 0;
   }
bjdupuis
Mentor
 
Posts: 82
Joined: Thu Jan 05, 2023 10:16 am

Re: Stop execution of OnDeviceModelService utility

Postby Phylanx » Mon May 11, 2026 1:21 am

Good attempt. Please let me know if that worked.
There might be other parts trying to use the OnDeviceModel because the flags still are active and then cause other problems...

Don't know anything definite but might be
Phylanx
Expert
 
Posts: 274
Joined: Thu Aug 11, 2016 8:17 am

Re: Stop execution of OnDeviceModelService utility

Postby bjdupuis » Mon May 11, 2026 10:18 am

Phylanx wrote:Good attempt. Please let me know if that worked.
There might be other parts trying to use the OnDeviceModel because the flags still are active and then cause other problems...

Don't know anything definite but might be


So far so good. I can see a single instance of the utility being launched and ended on an instance I started last week, so it's not thrashing trying to relaunch a "failed" subtask. I haven't noted any bad behaviors otherwise either, no exceptions or crashes. We'll see.
bjdupuis
Mentor
 
Posts: 82
Joined: Thu Jan 05, 2023 10:16 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 27 guests