File tree Expand file tree Collapse file tree 2 files changed +56
-2
lines changed
docs/content/docs/app/misc/faq Expand file tree Collapse file tree 2 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 11mod cmd;
22
3+ use std:: path:: Path ;
34use tauri:: Manager ;
45
56#[ tauri:: command]
@@ -24,8 +25,10 @@ pub fn run() {
2425 // 相同的bug: https://github.com/tauri-apps/tauri/issues/10702
2526 #[ cfg( target_os = "linux" ) ]
2627 {
27- std:: env:: set_var ( "__GL_THREADED_OPTIMIZATIONS" , "0" ) ;
28- std:: env:: set_var ( "__NV_DISABLE_EXPLICIT_SYNC" , "1" ) ;
28+ if Path :: new ( "/proc/driver/nvidia/gpus" ) . exists ( ) {
29+ std:: env:: set_var ( "__GL_THREADED_OPTIMIZATIONS" , "0" ) ;
30+ std:: env:: set_var ( "__NV_DISABLE_EXPLICIT_SYNC" , "1" ) ;
31+ }
2932 }
3033
3134 tauri:: Builder :: default ( )
Original file line number Diff line number Diff line change 22title : Linux 常见问题
33icon : Computer
44---
5+
6+ ## 界面卡顿
7+
8+ 通常是因为没有开启 GPU 加速或 GPU 频率过低
9+
10+ ### 开启 GPU 加速
11+
12+ 下列方法任选其一,或者使用其他方法,只要能修改环境变量即可
13+
14+ <Callout type = " warn" >
15+ 如果已经定义过 ` WEBKIT_DISABLE_COMPOSITING_MODE=1 ` 环境变量,需要先移除,因为这两个环境变量会相互冲突
16+ </Callout >
17+
18+ <Tabs items = { [" /etc/environment" , " Shell rc 文件" , " Hyprland" ]} >
19+ <Tab >
20+ ``` sh title="/etc/environment"
21+ WEBKIT_FORCE_COMPOSITING_MODE=1
22+ ```
23+
24+ </Tab >
25+
26+ <Tab >
27+ ``` sh title="~/.zshrc"
28+ export WEBKIT_FORCE_COMPOSITING_MODE=1
29+ ```
30+
31+ </Tab >
32+
33+ <Tab >
34+ ``` ini title="~/.config/hypr/hyprland.conf"
35+ env = WEBKIT_FORCE_COMPOSITING_MODE, 1
36+ ```
37+ </Tab >
38+
39+ </Tabs >
40+
41+ ### 设置最小 GPU 频率
42+
43+ 以 Intel GPU 和 TLP 调度为例,仅供参考
44+
45+ <Tabs items = { [" TLP" ]} >
46+ <Tab >
47+ ``` sh title="/etc/tlp.conf"
48+ INTEL_GPU_MIN_FREQ_ON_AC=700
49+ INTEL_GPU_MIN_FREQ_ON_BAT=700
50+ INTEL_GPU_BOOST_FREQ_ON_AC=1100
51+ INTEL_GPU_BOOST_FREQ_ON_BAT=1100
52+ ```
53+ </Tab >
54+
55+ </Tabs >
You can’t perform that action at this time.
0 commit comments