-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: add NSSupportsAutomaticGraphicsSwitching to Info.plist #1759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,5 +29,7 @@ | |
| <string>Cap captures your screen as part of recording your Caps</string> | ||
| <key>NSCameraUseContinuityCameraDeviceType</key> | ||
| <true/> | ||
| <key>NSSupportsAutomaticGraphicsSwitching</key> | ||
| <false/> | ||
|
Comment on lines
+32
to
+33
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Setting Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/desktop/src-tauri/Info.plist
Line: 32-33
Comment:
**Discrete GPU forced for entire app lifetime, not just recording**
Setting `NSSupportsAutomaticGraphicsSwitching` to `false` prevents macOS from ever switching to the integrated GPU while Cap is running — including when it's idle in the menu bar between recordings. On Intel dual-GPU MacBooks this continuously activates the discrete GPU, which can noticeably increase power consumption and fan activity even when the app is not encoding. Consider whether this trade-off is intentional; a more targeted approach (e.g. invoking `CGLEnable(kCGLCEMPEngine)` or the Metal equivalent only during active recording) would avoid the always-on GPU cost.
How can I resolve this? If you propose a fix, please make it concise.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is that a valid fix??
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, The reality is there's no clean programmatic way to switch the discrete GPU on/off only during recording in a Tauri + VideoToolbox app. You could enumerate Metal devices via The
The PR as-is is the right fix. My concern about "entire app lifetime" was valid to flag but the practical alternative doesn't really exist cleanly — so merging this is fine. Tip: You can customize Greptile's behavior for this repo with
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NSSupportsAutomaticGraphicsSwitching = false changed this and the issue still exist , so how can i fix it ,any idea???
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the plist change didn't help, the issue is likely not GPU switching — it's something in the encoder pipeline itself. Looking at For export ( options.set("allow_sw", "0"); // Forces hardware, fails hard if unavailableFor realtime recording, you don't set Fix: Add // in crates/enc-ffmpeg/src/video/h264.rs, "h264_videotoolbox" match arm
"h264_videotoolbox" => {
if is_export {
options.set("realtime", "false");
options.set("profile", "main");
options.set("allow_sw", "0");
} else {
options.set("realtime", "true");
options.set("prio_speed", "true");
options.set("profile", "main");
options.set("allow_sw", "0"); // add this
}
}Also worth checking: The debug logs. When recording starts, look for:
The software scaler case would cause high CPU regardless of the plist change.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if i give the log can you probe the issue??
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, share the logs and I can dig in. Most useful would be:
The key signals I'm looking for:
Paste them here and I'll trace the issue.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tell me the steps to genrate the log
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's how to capture the logs: 1. Run the app in dev mode (gets you Rust/FFmpeg logs directly in terminal): cd apps/desktop
pnpm tauri devThis streams all 2. If you need logs from a release build, use Console.app:
3. Capture VideoToolbox errors specifically: log stream --process Cap --level debug 2>&1 | tee cap_recording.logThen start the app and trigger a recording. Press 4. What to look for and paste here:
The |
||
| </dict> | ||
| </plist> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new keys use 4 spaces for indentation while all existing keys in the file use tabs. This mixes whitespace styles within the same XML document.
Prompt To Fix With AI