conky 导致 xorg 高 CPU 使用率 - ati/radeon 加速问题

conky 导致 xorg 高 CPU 使用率 - ati/radeon 加速问题

我正在运行 debian jessie,最近从 fglrx 视频驱动程序切换到免费的 ati radeon 驱动程序。我设法设置了它,但我注意到 xorg 导致高 CPU 负载:30-50%。
谷歌搜索了一下,查看了 htop 并关闭了进程,我发现 conky 导致 xorg 高 CPU 使用率。默认设置/etc/conky.conf没问题,CPU 负载保持在 2% 以下。
我的自定义~/.conkyrc运行良好,并没有导致 fglrx 15.9 驱动程序的高 CPU 负载。所以我推测免费的 radeon 驱动程序不喜欢某些设置。
我附上了我的~/.conkyrc。也许有人可以看看它并告诉我我遗漏了什么?

内核:Linux 3.16.0-4-amd64 x86_64 Debian
X 服务器:X.Org X Server 1.16.4
Radeon 模块版本:7.5.0
Conky 版本:1.9.0-6

# conky configuration
background no
use_xft yes
xftfont DejaVu Sans Mono:size=8
xftalpha 1
out_to_console no
update_interval 1 
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300 760
maximum_width 300
draw_shades no
draw_outline no
draw_borders no
borders 10
border_inner_margin 0
default_color white
default_shade_color black
default_outline_color white
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
gap_x 4
gap_y 5
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
if_up_strictness link
use_spacer left

TEXT
${color green}${time %a, }${color }${time %Y-%m-%d}${alignr}${color green}${time %Z, }${color }${time %H:%M:%S}  
${color green}UpTime: ${color }${alignr}$uptime  
${color green}Kern:${color }${alignr}$kernel  
${color green}CPU0:${color }${cpu cpu0}% ${acpitemp}°C ${goto 153}${color green}CPU1:${color }${cpu cpu1}% ${acpitemp}°C  
${color dimgrey}${cpugraph cpu0 20,149 006400 00ff00} ${goto 153}${cpugraph cpu1 20,149 006400 00ff00}  
${color green}Load: ${color }$loadavg  
${color green}Processes: ${color }$processes  
${color green}Running:   ${color }$running_processes  

${color green}Top CPU: ${goto 153}${color green}Top MEM:  
${color yellow}${top name 1}${top cpu 1}${goto 153}${color yellow}${top_mem name 1}${top_mem mem 1}  
${color lightgrey}${top name 2}${top cpu 2}${goto 153}${color lightgrey}${top_mem name 2}${top_mem mem 2}  
${color lightgrey}${top name 3}${top cpu 3}${goto 153}${color lightgrey}${top_mem name 3}${top_mem mem 3}  
${color lightgrey}${top name 4}${top cpu 4}${goto 153}${color lightgrey}${top_mem name 4}${top_mem mem 4}  

${color green}MEM: ${color dimgrey}${goto 50}${membar 11,150}  
${color }${voffset -13}${goto 60}$mem/$memmax${goto 170}${memperc}%  
${color green}${voffset 2}SWAP:${color dimgrey}${goto 50}${swapbar 11,150}  
${color }${voffset -13}${goto 60}$swap/$swapmax${goto 170}${swapperc}%  

${color green}HDD:${color }${diskio_read /dev/sda} ${goto 153}${diskio_write /dev/sda} ${alignr}${hddtemp}°C  
${color dimgrey}${diskiograph_read /dev/sda 20,149 006400 00ff00 100000} ${goto 153}${diskiograph_write 20,149 006400 00ff00 100000}  
${color green}ROOT:${color dimgrey}${goto 50}${fs_bar 11,150 /}  
${color }${voffset -13}${goto 60}${fs_size /}/${fs_free /}${goto 170}${fs_used_perc /}%${goto 200}  
${color green}${voffset 2}USR:${color dimgrey}${goto 50}${fs_bar 11,150 /usr}  
${color }${voffset -13}${goto 60}${fs_size /usr}/${fs_free /usr}${goto 170}${fs_used_perc /usr}%${goto 200}  
${color green}${voffset 2}VAR:${color dimgrey}${goto 50}${fs_bar 11,150 /var}  
${color }${voffset -13}${goto 60}${fs_size /var}/${fs_free /var}${goto 170}${fs_used_perc /var}%${goto 200}  
${color green}${voffset 2}TMP:${color dimgrey}${goto 50}${fs_bar 11,150 /tmp}  
${color }${voffset -13}${goto 60}${fs_size /tmp}/${fs_free /tmp}${goto 170}${fs_used_perc /tmp}%${goto 200}  
${color green}${voffset 2}HOME:${color dimgrey}${goto 50}${fs_bar 11,150 /home}  
${color }${voffset -13}${goto 60}${fs_size /home}/${fs_free /home}${goto 170}${fs_used_perc /home}%${goto 200}  
${color green}${voffset 2}DATA:${color dimgrey}${goto 50}${fs_bar 11,150 /mnt/data}  
${color }${voffset -13}${goto 60}${fs_size /mnt/data}/${fs_free /mnt/data}${goto 170}${fs_used_perc /mnt/data}%${goto 200}  

${if_up wlan0}${color green}NET: ${color yellow}wlan0 ${alignr}${addrs wlan0}  
${color }${color red}Down: ${color }${downspeedf wlan0} KiB/s${goto 153}${color royalblue}Up: ${color }${upspeedf wlan0} KiB/s  
${color dimgrey}${downspeedgraph wlan0 20,149 8b0000 ff0000 6104}${goto 153}${upspeedgraph wlan0 20,149 00008b 4169e1 1221}${else}${voffset -13}${endif}  
${if_up eth0}${color green}NET: ${color yellow}eth0 ${alignr}${addrs eth0}  
${color }${color red}Down: ${color }${downspeedf eth0} KiB/s${goto 153}${color royalblue}Up: ${color }${upspeedf eth0} KiB/s  
${color dimgrey}${downspeedgraph eth0 20,149 8b0000 ff0000 6104}${goto 153}${upspeedgraph eth0 20,149 00008b 4169e1 6104}${else}${voffset -13}${endif}  
${if_up ppp0}${color green}NET: ${color yellow}ppp0 ${alignr}${addrs ppp0}  
${color }${color red}Down: ${color }${downspeedf ppp0} KiB/s${goto 153}${color royalblue}Up: ${color }${upspeedf ppp0} KiB/s  
${color dimgrey}${downspeedgraph ppp0 20,149 8b0000 ff0000 64}${goto 153}${upspeedgraph ppp0 20,149 00008b 4169e1 64}${else}${voffset -13}${endif}  

${color green}BAT0:${color dimgrey}${goto 50}${battery_bar 11,150 BAT0}  
${color }${voffset -13}${goto 60}${battery_short BAT0}${alignr}${battery_time BAT0}  

答案1

好吧,你的评论不是真正的答案,但给了我一个提示。我深入研究了man radeon一下https://wiki.archlinux.org/index.php/ATI(debian wiki 相当神秘或过时:仍然建议使用 EXA 进行性能调整),查看Xorg.0.log并找到了原因:
Xorg 自动检测为 TAHITI 之前的 GPU(我的是 ARUBA)加载 EXA 加速方法。而且 - 确实 - EXA 很慢。

因此,解决方案是自定义/etc/X11/xorg.conf.d/20-radeon.conf加载glamor加速方法:

Section "Device"  
    Identifier  "Radeon"  
    Driver "radeon"  
    Option "AccelMethod" "glamor"  
    Option "DRI" "3"  
    Option "TearFree" "on"  
EndSection  

注意:我发现一些文章指出 DRI3 需要 Xorg 版本 1.17 或更高版本以及 ati/radeon 驱动程序 7.6 或更高版本,因此如果它不起作用,请不要感到惊讶。
现在 Xorg 使用的 CPU 不超过 2%。问题解决了。

相关内容