Skip to content
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

开启gpu支持 #148

Open
Moe-hacker opened this issue May 20, 2023 · 4 comments
Open

开启gpu支持 #148

Moe-hacker opened this issue May 20, 2023 · 4 comments

Comments

@Moe-hacker
Copy link

cpu渲染风扇声太大,尝试开启gpu渲染有所好转。
系统:Kali GNU/Linux Rolling
源码为最新版本。
由于本人没学过相关内容,部分改动无法保证正确性:

diff --git a/src/main/index.ts b/src/main/index.ts
index 4089d20..ec172df 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -10,9 +10,11 @@ import { createWindow, winPagePathMap } from './window'
 
 remoteMain.initialize()
 
+app.disableDomainBlockingFor3DAPIs()
+/*
 const isWin7 = os.release().startsWith('6.1')
 if (isWin7) app.disableHardwareAcceleration()
-
+*/
 if (app.isPackaged) {
   if (!app.requestSingleInstanceLock()) {
     app.quit()
@@ -22,11 +24,11 @@ if (app.isPackaged) {
     app.dock.hide()
   }
 }
-
+/*
 app.commandLine.appendSwitch('disable-renderer-backgrounding')
 app.commandLine.appendSwitch('disable-background-timer-throttling')
 app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required')
-
+*/
 let mainWindowState: windowStateKeeper.State
 
 app

修改后正常运行,cpu占用明显减少。

@jmjoy
Copy link

jmjoy commented Dec 11, 2023

这个好

@crownclownwl
Copy link

我在master分支上也没看见这个 文件的代码呀?你用的那个分支呀?

@crownclownwl
Copy link

大佬你能帮我打包一个 deb 吗?我这运行不起来代码

@crownclownwl
Copy link

好了 多打包几次就好了

crownclownwl added a commit to crownclownwl/PPet that referenced this issue Jun 18, 2024
根据:issues
zenghongtu#148

解决cpu占用太高的bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants