Skip to content

High idle CPU usage on Windows (push-to-talk mode) #290

@pszemraj

Description

@pszemraj

Hi, first off great project, love the design philsophy!

After using for a few days, I noticed: With the app sitting idle, GUI minimized, not recording, wake word disabled, CPU usage sits at 10-20% about 60-70% of the time. It cycles down to ~0% briefly then climbs back up. After an hour of doing nothing. Confirmed in both btop and PowerShell's Get-Process

Environment/specs

app details:

  • version: v1.8.0
  • Mode: Push-to-talk
  • Voice Mode/Wake Word: OFF

machine:

  • OS: Windows 11 Pro (25H2) x86_64
  • CPU: AMD Ryzen 9 8945HS (16) @ 5.25 GHz
  • RAM: 16.87 GiB / 31.29 GiB (54%)
  • GPU 1: NVIDIA GeForce RTX 4070 Laptop GPU @ 3.10 GHz (7.76 GiB) [Discrete]
  • GPU 2: AMD Radeon 780M Graphics (418.48 MiB) [Integrated]

The main reason I'm sharing the GPU info is because I noticed ort is hard-locked to CPU runtime and it would be nice to opt-in use what I have (this prob should be its own issue thread, i can create if you like)

attempt to be useful

I poked around the code a bit and noticed that the three ONNX sessions created at startup (encoder, decoder_joint, preprocessor) all pass None for intra_threads. afaik that means ONNX Runtime falls back to using all CPU cores for its thread pool, and on Windows it apparently uses a spin-then-sleep strategy that can eat CPU even when nothing is actually running.

Not sure if that's the full story or if I'm reading this wrong, but from a quick look that's what I can see. Specifically in my case, I've got a bunch of CPUs (above) so maybe for me its worse than normal. Would passing a small explicit thread count there help, or is there a reason it's left as None?

Also: while looking for things that could cause the CPU use I noticed the overlay window seems to always get created at startup even when overlay mode is off. figured I'd mention it.

  • if either of the two things are useful ^ I can draft a PR for them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions