Archive:GPU-Performance/zh-cn: Difference between revisions

From KDE Wiki Sandbox
m (Created page with "=== 显卡驱动程序 ===")
m (moved GPU-Performance/zh-cn to Archive:GPU-Performance/zh-cn: Part of translatable page GPU-Performance.)
 
(59 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages />
<languages />


{{warning (zh CN)|在作出任何修改您的系统之前,请仔细阅读一切并了解你在做什么。如果你修改任何在您系统上的文件,留下未修改版本的备份,并确保您可以还原这些旧版本-即使你的Xserver没有再启动。}}
{{warning (zh CN)|修改您的系统之前,请仔细阅读并设法理解你要做什么。如果要修改系统文件,请在修改前备份,确保可以还原到这些旧版本——即使你的Xserver没有重新运行。}}


{{warning (zh CN)|有些下文提到的修改据说会'''增加你的GPU温度'''。在任何情况下,监控您的显卡确保它没有过热!}}
{{warning (zh CN)|下文提到的一些修改据说会让'''显卡升温'''。在任何情况下,监控您的显卡确保没有过热!}}


== 前言 ==
== 前言 ==


几种流行的显卡 - 特别是 NVIDIA 的 - 在 KDE 4 出现性能问题。这些性能问题主要涉及  [[Special:myLanguage/Plasma|Plasma]] - KDE 4 的桌面,和[[Special:myLanguage/KWin|KWin]]- KDE 的窗口管理器。一般来说,不是因为 KDE 4 没有被优化而是因为显卡驱动程序的问题。本页包含可能出现的问题以及如何解决他们。
几种流行的显卡——特别是 NVIDIA 的——在 KDE 4 出现性能问题。这些性能问题主要涉及  [[Special:myLanguage/Plasma|Plasma]] - KDE 4 的桌面,和[[Special:myLanguage/KWin|KWin]]- KDE 的窗口管理器。一般来说,不是因为没有优化 KDE 4 而是因为显卡驱动的问题。本页包含可能出现的问题和解决办法。


==一般提示 ==
==一般提示 ==
Line 13: Line 13:
===  显卡驱动程序  ===
===  显卡驱动程序  ===


For both of the ''big'' graphics chip manufacturers there different graphics drivers that can be used for each:
这两''大''显卡芯片制造商皆有不同的显卡驱动程序可以使用:
 
* NVIDIA显卡有自由的'''nv'''和私有的'''nvidia'''驱动程序。虽然KDE4在前者同样运作的很好,但它不提供3D加速,因此后者可能是你唯一的选择。多数的NVIDIA小节仅指私有的驱动程序(还有一个第三方的自由驱动程序叫''nouveau'')。由于授权限制大多数发行版预设情况下不安装私有的驱动程序。请参阅您的发行版信息有关如何安装它。
 
**'''Update 4:''' NVIDIA's 180.08 version of beta drivers out [http://www.nvnews.net/vbulletin/showthread.php?p=1847941 here]; some performance problem were fixed. Also check [http://www.nvnews.net/vbulletin/showthread.php?t=122606 here] for the latest version of beta drivers.


* For NVIDIA cards there's the free '''nv''' and the proprietary '''nvidia''' driver. While KDE4 should work fine with the former, it doesn't offer 3D acceleration, so the latter may be your only choice. <s>All</s> Most NVIDIA subsections herein only refer to the proprietary driver (there's also a 3rd free driver called '''nouveau''' that's currently under development. Unfortunately I don't know how usable it is so far). Due to licensing restrictions most distributions don't install the proprietary driver by default. Please refer to your distribution for information on how to install it.
** ''Update:'' Nvidia has recently issued a new beta driver which is supposed to address most of the performance problems seen with KDE4. It can be downloaded in [http://www.nvidia.com/object/linux_display_amd64_177.67.html 64bit] and [http://www.nvidia.com/object/linux_display_ia32_177.67.html 32bit] versions. You need to add some options to your ''xorg.conf'' and enable certain feature at runtime, see [http://www.nvnews.net/vbulletin/showthread.php?t=118088 this post] on the NvNews forums for details. '''Note:''' Only install beta drivers if you know what you are doing.
** ''Update 2:'' NVIDIA have released a new version 177.68 of beta drivers which fixes a couple of bugs and should improve performance with the KDE 4 '''OpenGL''' compositing manager. More info and downloads [http://www.nvnews.net/vbulletin/showthread.php?t=118244 here]. The latest beta version is 177.70 and it should enhance performance when dragging '''Plasma''' applets and fix some text rendering performance and corruptions. More info [http://www.nvnews.net/vbulletin/showthread.php?t=118602 here].
** ''Update 3:'' NVIDIA's 177.70 version of beta drivers has improved support for RENDER operations with the same source, and destination; this should enhance performance in some situations, e.g. when dragging '''Plasma''' applets in KDE4. More info [http://www.nvnews.net/vbulletin/showthread.php?t=118602 here].
** ''Update 4:'' NVIDIA's 177.80 version of beta drivers out [http://www.nvnews.net/vbulletin/showthread.php?t=120679 here]; some performance problem were fixed.
** ''Update 5:'' NVIDIA's 180.08 version of beta drivers out [http://www.nvnews.net/vbulletin/showthread.php?p=1847941 here]; some performance problem were fixed. Also check [http://www.nvnews.net/vbulletin/showthread.php?t=122606 here] for the latest version of beta drivers.
** ''Update 5:'' NVIDIA's 180.08 version of beta drivers out [http://www.nvnews.net/vbulletin/showthread.php?p=1847941 here]; some performance problem were fixed. Also check [http://www.nvnews.net/vbulletin/showthread.php?t=122606 here] for the latest version of beta drivers.


* For AMD/ATI cards you also have a few options. There are the free "ati" and "radeonhd" drivers for X.org ("ati" is also referred to as "radeon", without "hd", but most xorg driver packages I've seen seem to call it "ati"). Most distributions seem to default to "ati" which is compatible with cards from the earliest Radeons onwards; "RadeonHD", as the name suggests, is only for R500 and later generation cards - in retail model numbers that's the X1300 and later. Both basically should run OK for a standard desktop and they share the same 3D code in mesa so should be similar for desktop effects (note, 3D support for cards newer than R300 is considered unstable and for R600 and later is very experimental). Nonetheless, if you have an X1300 or later card (i.e. one that should be supported by both drivers) and you run in to problems with one it may be worth trying out the other. You also have the option of trying the proprietary fglrx driver, though this has limited support for older cards - there's more on the AMD/ATI website about this option. Some distributions package this or have third party repos that package it and this is likely to be easier than downloading from AMD directly.
* AMD/ATI显卡你也有几个选择。有自由的「ati」和「radeonhd」驱动程序在 X.org(「ati」也称为「radeon」(没有「hd」),但我看过大多数的xorg驱动程序套件似乎把它称作「ati」)。大多数发行版似乎预设为「ati」,相容早期的 Radeons 显卡;「RadeonHD」,顾名思义,只支持 R500 和之后的显卡 - 零售型号为 X1300 和之后版本。基本上两者都可以正常运行在标准桌面,它们共享相同的 3D 程序代码在 mesa ,所以桌面效果应该是类似的(注意,R300之后的显卡3D支持被认为是不稳定,R600和之后版本是非常实验性的)。Nonetheless, if you have an X1300 or later card (i.e. one that should be supported by both drivers) and you run in to problems with one it may be worth trying out the other. You also have the option of trying the proprietary fglrx driver, though this has limited support for older cards - there's more on the AMD/ATI website about this option. Some distributions package this or have third party repos that package it and this is likely to be easier than downloading from AMD directly.


It's usually advisable to stay up-to-date as improvements are being made in the drivers. Thus a first step in improving your KDE4 experience should be checking your current driver and updating if it's outdated. Please refer to your distribution's documentation on how to do that.
通常最好更新到已有改善措施的驱动程序。 因此,第一步改善您的 KDE 4 体验应该检查你的当前的驱动程序如果它已经过时就需要更新他。请参考您的发行版的文件,了解如何做到。


While it might further increase performance, I do '''NOT''' recommend installing beta quality drivers because your system's stability will most likely suffer.
尽管可能进一步提高性能,但我''''''建议安装测试版质量的驱动程序,因为有可能影响您系统的稳定。


=== nvidia-settings ===
=== nvidia-settings ===


Attributes set using the ''nvidia-settings'' utility aren't permanently saved unless it is started as a root user. Login as root in the terminal and start with
''nvidia-settings''工具设置的参数不会永久保存,除非你 用root 权限。终端下面用 root 登录,
:{{Input|1=nvidia-settings&}}
:{{Input|1=nvidia-settings&}}  
Otherwise you have to set them every time you restart your Xserver. This can be done conveniently by adding the lines to set the features to your ''~/.xinitrc''
不然你每次重启X 都得重新设置一次。可以通过添加下列字段到你的 ''~/.xinitrc'' 来轻松做到。


===nvidia - black window problem===
===nvidia - 窗口黑掉问题===


It seems that ''older'' NVidia cards run into the problem that newly opened windows just are drawn as black windows or do not refresh properly anymore. This happens if composite is activated and '''openGL''' is used with many windows opened. Maybe the cards are running out of video memory? (The problem does occur with the '''compiz''' window manager as well.) In KDE4 you can deactivate composite/effects with <keycap>Shift + Alt + F12</keycap> to continue your work with the desktop normally.
It seems that ''older'' NVidia cards run into the problem that newly opened windows just are drawn as black windows or do not refresh properly anymore. This happens if composite is activated and '''openGL''' is used with many windows opened. Maybe the cards are running out of video memory? (The problem does occur with the '''compiz''' window manager as well.) In KDE4 you can deactivate composite/effects with <keycap>Shift + Alt + F12</keycap> to continue your work with the desktop normally.
Line 40: Line 39:
The problem is that drawing of the window decorations does become very slow if no composite is activated (tested with KDE4.3). As alternative to using '''openGL''' as composite engine it is recommended to use '''XRender''' in this case. Because moving effects become very slow with '''XRender''' you should turn animation speed to instant.  
The problem is that drawing of the window decorations does become very slow if no composite is activated (tested with KDE4.3). As alternative to using '''openGL''' as composite engine it is recommended to use '''XRender''' in this case. Because moving effects become very slow with '''XRender''' you should turn animation speed to instant.  


=== System Settings ===
===系统设置 ===


KDE4's '''systemsettings''' allows you to tweak some kwin settings as well. You can find the settings in <menuchoice>Desktop -> Desktop Effects -> Advanced Options</menuchoice>. Depending on your card either '''OpenGL''' or '''XRender''' might work better. For '''OpenGL''' changing the ''OpenGL mode'' might change performance as well. Please bear in mind that changing some of the tweaks mentioned below might force you to change your settings.
KDE4的 ''系统设置'' 提供您调整KWin设定。你可以在<menuchoice>桌面 -> 桌面效果 -> 高级</menuchoice>找到设定。根据您的显卡在'''OpenGL''''''XRender''' 运作的较好。使用 '''OpenGL''' 可能性能会比较好。请记住,下文提到一些修改可能会改变您的设定。


(Note from user): XRender mode helped A LOT on a 6800 GT (agp) with the proprietary driver, especially while looking at videos (177.80).
(Note from user): XRender mode helped A LOT on a 6800 GT (agp) with the proprietary driver, especially while looking at videos (177.80).


Examples:
例如:
* Setting ''InitialPixmapPlacement'' to 2 might improve plasma's performance but might make kwin hang sometimes.
* 设定''InitialPixmapPlacement'' 为2可以提高 plasma 的性能,但有时可能使 KWin 挂掉。
* Setting ''OpenGL mode'' to ''Shared Memory'' might make kwin more responsive again.
* ''OpenGL 模式''设定为''共享内存''可以使KWin反应更快。
* (note from a user) Not selecting "Use Vsync" helped a lot in a gforce 6800 (and also on a GeForce 8400M GT).
(note from a user)* Not selecting "Use Vsync" helped a lot in a gforce 6800 (and also on a GeForce 8400M GT).


If for some reason your '''Xserver''' hangs after hitting the <menuchoice>Apply</menuchoice> button on the dialog and your settings get reverted because you can't confirm your changes in time, try again. Usually it will be faster on one of the subsequent tries. If it doesn't you can still change your settings in ''~/.kde4/share/config/kwinrc''.
如果由于某种原因点击对话框的''应用''按钮后你的 Xserver 挂掉,并且回复因为无法确认您的更改,再试一次。通常它随后会很快的再尝试。如果没有你仍然可以修改您的设定在<tt>~/.kde4/share/config/kwinrc</tt>。


=== XGL ===
=== XGL ===
Line 59: Line 58:
{{Note|1= XGL has *a lot* of issues regarding 3d applications, xvideo and keyboard layout but, with certain video cards, is now the unique way to enjoy KDE4 at full speed.  XGL actually 'bypass' the nvidia driver using the mesa library to render the desktop. OpenGL-based desktop effects cannot be run on XGL.}}
{{Note|1= XGL has *a lot* of issues regarding 3d applications, xvideo and keyboard layout but, with certain video cards, is now the unique way to enjoy KDE4 at full speed.  XGL actually 'bypass' the nvidia driver using the mesa library to render the desktop. OpenGL-based desktop effects cannot be run on XGL.}}


=== Fedora 10 (and later) and xorg.conf (for some users) ===
=== Fedora 10(及更新) 与 xorg.conf(给某些用户)===
 
本文中提到的一些微调是针对在大多数发行版都可找到的文件:


Some of the tweaks mentioned in this article are targeted at a file normally found in most distros at ''/etc/X11/xorg.conf''
  /etc/X11/xorg.conf


Some users on Fedora 10, however, may find that this file is no longer present by default (depending on their card- anyone with more details on this please feel free to elaborate), and so it must be re-created. To do this, either:
有些Fedora 10 用户可能会发现默认的情况下这个文件不存在(依赖于他们的显卡 - anyone with more details on this please feel free to elaborate),所以必须重新创建。请这样做:


==== GUI-friendlier method: ====
====GUI的方法: ====


* install and run the 'system-config-display' package (hitting <menuchoice>OK </menuchoice> after you're done configuring will generate the ''xorg.conf'' file).
* 安装并执行'system-config-display'套件,完成后点击'''Ok''',产生包含刚才设定的'xorg.conf'


==== Less GUI-friendly method: ====
==== 不用GUI的方法: ====


# open a command prompt
# 打开指令提示符
# switch to runlevel 1 by running the command (as root):  {{Input|1=init 1}}
# 通过执行指令(使用root)init 1切换到runlevel 1
# run {{Input|1=Xorg -configure}} as root (once you're done, this will generate the ''xorg.conf'' file), or you can do {{Input|1=sudo Xorg -configure :1}}without switching runlevel
# 运行{{Input|1=Xorg -configure}} 用root运行'Xorg -configure',完成后会产生'xorg.conf'档案或者用{{Input|1=sudo Xorg -configure :1}},这样无需切换runlevel


== Problems ==
== 问题 ==


This section summarizes several symptoms you might encounter and tries to explain possible causes.
本节简要阐述了一些可能会遇到的症状,并试图解释可能的原因。


=== Resizing certain windows is choppy ===
=== 调整窗口大小时会卡卡的  ===


* Explanation : This might be due to your card advertising ''ARGB Visuals'' (basically translucency) without having proper support for them. Applications/windows concerned are the '''Plasma Desktop''', the '''KRunner''' dialog (<keycap>Alt + F2</keycap>), Plasma's <menuchoice>Add new widget</menuchoice> dialog or a [[Special:myLanguage/Konsole|konsole]] window.
* 说明 : 这可能是由于您的显卡不完全支持 ''ARGB Visuals''(基本半透明)。有关的应用程序和窗口有plasma桌面、krunner对话框(<keycap>Alt + F2</keycap>)、plasma的<menuchoice>新增组件</menuchoice>对话框或  [[Special:myLanguage/Konsole|konsole]]的窗口。


* Test : If you want to make sure this issue is a problem for you, run {{Input|1= XLIB_SKIP_ARGB_VISUALS=1 konsole}}on the command-line and try to resize the new konsole window (setting the environment variable <tt>XLIB_SKIP_ARGB_VISUALS</tt> turns off ''ARGB visuals''). If it resizes without problems, then this is certainly one of the problems you're facing.
* 测试 : 如果你要确定这就是你的问题,执行<pre>$ XLIB_SKIP_ARGB_VISUALS=1 konsole</pre> 在指令列并尝试调整新开的konsole窗口大小(设定环境变量<tt>XLIB_SKIP_ARGB_VISUALS</tt>关闭''ARGB visuals'')。如果重设大小没有问题,那么这就是您遇到的问题。


{{Note|1= I have found that this fixes Dolphin's preview delay too for me. Please confirm. --[[User:Dpalacio|dpalacio]] 17:33, 27 July 2008 (CEST)}}
{{Note|1= I have found that this fixes Dolphin's preview delay too for me. Please confirm. --[[User:Dpalacio|dpalacio]] 17:33, 27 July 2008 (CEST)}}


=== General ===
===Your graphics card struggles with Flash video===
If you have an older graphics card, hardware acceleration may be a struggle for it. This may be particularly obvious when watching flash videos such as Youtube videos.  This may help:
 
:* While viewing a 'Flash' video right-click on the video 'screen'.
:* A menu will appear with 'settings' and 'check-boxes'.
 
[[Image:FlashOff1.png|center|500px|thumb]]
 
:* If you choose the 'global settings' (near the bottom) it takes you a box for the 'global settings'.
:* There you can turn off hardware acceleration for Flash
 
[[Image:FlashOff2.png|center|500px|thumb]]


* You can set the BackingStore options in your xorg.conf:
=== 常规 ===
In the Section "Device"
 
*您可以设定BackingStore选项在您的xorg.conf:
"Device"部分
:{{Input|1=<nowiki>    ...
:{{Input|1=<nowiki>    ...
     Option "BackingStore" "true"
     Option "BackingStore" "true"
     ...
     ...
EndSection "Device"</nowiki>}}This works for some (eg. '''konsole''') but unfortunately not all windows.
EndSection "Device"</nowiki>}}这可以作用在一些(例如konsole)程序,但不幸的是并非所有的窗口有效。


* As a last resort you can try setting {{Input|1=XLIB_SKIP_ARGB_VISUALS=1}}in your ''~/.xinitrc'' but this isn't pretty.
* 作为最后的手段,您可以尝试设定<tt>XLIB_SKIP_ARGB_VISUALS=1</tt>在您的 <tt>~/.xinitrc</tt> 但这并不漂亮。


==== NVIDIA ====
==== NVIDIA ====


* You can set the ''IntialPixmapPlacement'' with the ''nvidia-settings'' utility:
* 您可以用''nvidia-settings'' 程式设定''IntialPixmapPlacement'':{{Input|1=$ nvidia-settings -a InitialPixmapPlacement=2}} 这可以作用在一些NVIDIA 显示卡(但不幸的是不是全部)。
:{{Input|1=$ nvidia-settings -a InitialPixmapPlacement=2}}This works for some (but unfortunately not all) NVIDIA cards.


==== NV/Intel ====
==== NV/Intel ====


* You can enable EXA Acceleration
<span class="mw-translate-fuzzy">
In ''xorg.conf'' Section "Device"
* 您可以启用 EXA 加速
:{{Input|1=<nowiki>   ...
''xorg.conf'' "Device" 部分
:{{Input|1=<nowiki> ...
     Option "AccelMethod" "EXA"
     Option "AccelMethod" "EXA"
# optional, may improve performance but introduce visible artifacts
# optional, may improve performance but introduce visible artifacts
#   Option "MigrationHeuristic" "greedy"  
# Option "MigrationHeuristic" "greedy"
     ...
     ...
EndSection "Device"</nowiki>}}
EndSection "Device"</nowiki>}}
</span>


Performance will be somewhat better on older X servers (<=1.4.2) and significantly better on the latest prerelease X servers (>=1.4.99.901) with this option.
使用此选项的旧 X servers (<=1.4.2)性能会好些,新的 X servers (>=1.4.99.901)会有明显改善 。


* The problem with poor effects performance also can be overcome by using Intel video drivers 2.6.3.1 ( in my case deb based distro ) or higher, with kernel 2.6.30-rc1 or higher verion, with enabled UXA in xorg.conf like this :
* 这个效能不彰的问题也可以使用 intel影像驱动程序 2.6.3.1(在我的基于deb发行版)或之后的版本,与kernel 2.6.30-rc1 或之后的版本,并在 xorg.conf 启用 UXA 类似这样:


NOTE: If you use kernel 2.6.29, there is many bugs and xorg freeze randomly with enabled UXA extension.
注意:如果您使用 kernel 2.6.29,启用 UXA 扩展会有许多 bug 和随机的 xorg 冻结。


:{{Input|1=<nowiki>Section "Device"
:{{Input|1=<nowiki>Section "Device"
Line 126: Line 141:
EndSection</nowiki>}}
EndSection</nowiki>}}


With this config, my i945G with PentiumD820, makes 350-500 FPS in Glxgears, and all effects runs perfect with Opengl render.
有了这个设定,我的 i945G 与 PentiumD820,在Glxgears 可以跑 350-500 FPS,和完美运行所有OpenGL渲染效果。


==== ATI ====
==== ATI ====
Line 132: Line 147:
TODO
TODO


=== Plasma performance is bad ===
=== Plasma 效能很差===


* Explanation : Unfortunately the reasons for plasma being choppy seem to be numerous so it's hard to tell where your choppiness comes from.
* 说明 : 不幸的是,plasma 的原因似乎复杂很多,所以很难知道你们问题的原因。


* Test : Usually plasma performance problems can be seen best on the ''Folder View'' plasmoid. Moving it or scrolling inside the folder might be pretty slow.
* 测试 : plasma 性能问题通常可以由''文件夹视图''部件清楚了解。移动它或档案夹内的滚动可能会相当缓慢。


==== General ====
==== 常规 ====


* Please make sure this is not (only) related to the ''ARGB Visuals'' mentioned in the above section.
* 请确定这不是上面提到关于'''ARGB Visuals'''的部分。


==== NVIDIA ====
==== NVIDIA ====


* You can set the ''IntialPixmapPlacement'' and the ''GlyphCache'' option with the '''nvidia-settings''' utility: {{Input|1=$ nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1}}This works for some (but unfortunately not all) NVIDIA cards. Some cards reportedly work better using {{Input|1=InitialPixmapPlacement=1}}or maybe even {{Input|1=InitialPixmapPlacement=3}}
* 您可以用''nvidia-settings''程式设定''IntialPixmapPlacement'' ''GlyphCache'' 选项: {{Input|1=$ nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1}} 这可以作用在部份的NVIDIA显示卡(但不幸的是不是全部)。据说有些显卡使用{{Input|1=InitialPixmapPlacement=1}}(甚至{{Input|1=InitialPixmapPlacement=3}})运作的更好。


* Options that are said to work well on 8xxx cards but are untested (by me)
* Options that are said to work well on 8xxx cards but are untested (by me)
Line 168: Line 183:
TODO
TODO


=== Folder View and other plasmoids look badly rendered ===
===文件夹视图和其他部件渲染看起来相当糟糕===
 
*说明 : 文件夹视图和其他一些plasmoid使用硬件加速渲染。有两种方法做到这一点,并且Plasma需要新的EXA方法。


* Explanation : ''Folder View''' and some other widgets use hardware accelerated rendering. There are two methods to do this, and '''Plasma''' requires the newer EXA method.
* 测试 : 这在''文件夹视图''组件最容易看到,会在屏幕上显示随意歪曲的区块。


* Test : This is best seen on the Folder View widget, which will appear as a distorted and seemingly random region on the screen.
==== 开源的 Radeon 驱动 ====


==== Open Source radeon driver ====
开源 Radeon 驱动默认使用的是 XAA 硬件加速的方法。所以你需要从 XAA(X Acceleration Architecture)更改 2D 加速方法,以使用较新的 EXA。由于这涉及到编辑您的 xorg.conf 文件,记住,这样的修改可能会损害您的系统。''这一点需要您自担风险'',如果你做错了,有可能导致 X 无法启动,所以先备份 xorg.conf 文件。


The Open Source '''radeon''' driver uses the XAA acceleration method by default. So you need to change the acceleration method from XAA (X Acceleration Architecture) to the newer EXA. As this involves editing your ''xorg.conf'' file, bear in mind that if you make an error, it may result in X not starting on your system, so first save a copy of the existing xorg.cong file.
要更换,编辑你的 xorg.conf 文件。定位到设定显卡的 Device 部分。添加这行
{{Input|1=Option "AccelMethod" "EXA"}}
到 "EndSection" 这行之前。如果已经有一行是有 AccelMethod,那直接修改 XAA  成 EXA。保存文件并重启 X server。


To make the switch, edit your xorg.conf file.  Locate the Device section for your graphics card. Before the "EndSection" line, add{{Input|1=Option "AccelMethod" "EXA"}}<br />
If there is already a line with ''AccelMethod'', change it from XAA to EXA. Save the file and restart the X server.
Note that using EXA may result in some older applications, such as some KDE3 programs being rendered incorrectly.
Note that using EXA may result in some older applications, such as some KDE3 programs being rendered incorrectly.


Line 206: Line 222:
===Desktop Effects causes random freezes===
===Desktop Effects causes random freezes===


This seems to affect Intel and ATi cards.  AccelMethod seems to be the culprit.  The default acceleration path for most drivers right now
这似乎是受 Intel ATi 显卡影响。AccelMethod 似乎是罪魁祸首。大部分驱动程序现在预设加速途径是已经过时和缓慢的 XAA(Option "AccelMethod" "XAA")。这是不建议的作法,特别是在组成(compositing)。 不幸的是,私有的 ATI 和 Nvidia 驱动仍然只支持 XAA。
is the outdated and slower XAA (Option "AccelMethod" "XAA") which is not
recommended anymore, especially with compositing.  Unfortunately, the
proprietary binary blobs of ATI and NVidia still only support XAA


===ATi===
===ATi===


Try enabling EXA acceleration by adding these two lines to xorg.conf
尝试加入以下两行启用 EXA 加速


{{Input|1=Section "Device"
{{Input|1=Section "Device"
Line 221: Line 234:
EndSection}}
EndSection}}


This works with both the '''radeon''' as well as the '''radeonhd''' driver but only with cards up to an X1950.  HD2xxx and above aren't supported yet.
这个方法可以用在两款驱动 radeon 以及 radeonhd,但显卡有最高只到 X1950 有效。HD2xxx 及以上尚未不支持。


''AtomBIOS'' is automatically used by the '''radeon''' driver, so that line will need to be commented out.  If you have the '''radeonhd''' driver, however, you will need it.  EXA is expected to become the default in the near future, but having it specified here is unlikely to cause any problems even then.  3D and EXA support for HD2xxx and above is expected later this year (2009) as they are already in an experimental branch.
''AtomBIOS'' is automatically used by the '''radeon''' driver, so that line will need to be commented out.  If you have the '''radeonhd''' driver, however, you will need it.  EXA is expected to become the default in the near future, but having it specified here is unlikely to cause any problems even then.  3D and EXA support for HD2xxx and above is expected later this year (2009) as they are already in an experimental branch.
Line 227: Line 240:
===Intel===
===Intel===


It's worth checking Xorg.0.log for mention of EXA.  If you don't find it (or UXA) try adding the EXA line as described in the ATi section.  UXA is an experimental option, but only supported by a few drivers.  It's likely that the best bits will be merged into EXA soon.
检查 Xorg.0.log 中是否有 EXA。如果你没有找到它(或 UXA)试着加入EXA 在 ATi section。UXA是一个实验性的选择,但只支持少数驱动。It's likely that the best bits will be merged into EXA soon.


[http://www.phoronix.com/forums/ Phoronix forums] is a good place to read more about this.
[http://www.phoronix.com/forums/ Phoronix forums] is a good place to read more about this.


=== KRunner (Alt+F2) looks strange ===
=== KRunner(Alt+F2)看起来怪怪的 ===


==== NVIDIA ====
==== NVIDIA ====


[[Image:krunner-madness.png|right|200px|KRunner display problems]]
[[Image:krunner-madness.png|right|200px|KRunner 显示问题]]
On NVIDIA cards '''krunner's''' dialog might appear several times below each other (with only the topmost one editable). This is related to setting <i>InitialPixmapPlacement=1</i> as recommended above. There's currently no known way to remedy this problem.  However, it only appears on one relatively early version of KDE 4.
在NVIDIA显卡上krunner对话框可能会出现好几个(只有最上面的可以使用)。这是由于上述建议设定<i>InitialPixmapPlacement=1</i> 。目前还没有任何已知的方法来解决这个问题。


===Most of the icons in your SysTray have disappeared===
===在您系统托盘的图标大多数都消失===


At some point you may have been told to add KDE_SKIP_ARGB_VISUALS to either ~/.bash_profile, /etc/profile or in ~/.profile.  If that rings a bell for you, hunt for it and comment it out.  You may find that they magically re-appear.
At some point you may have been told to add KDE_SKIP_ARGB_VISUALS to either ~/.bash_profile, /etc/profile or in ~/.profile.  If that rings a bell for you, hunt for it and comment it out.  You may find that they magically re-appear.
Otherwise, check the Qt4 libraries you are using. In my case I needed Qt 4.4.3 together with KDE 4.2.
Otherwise, check the Qt4 libraries you are using. In my case I needed Qt 4.4.3 together with KDE 4.2.


==Links/References ==
 
==连接和参考文献 ==


:[http://www.nvnews.net/vbulletin/showthread.php?t=118088 -- Performance tweaks to the 177.67 Nvidia beta driver]
:[http://www.nvnews.net/vbulletin/showthread.php?t=118088 -- Performance tweaks to the 177.67 Nvidia beta driver]
:[http://www.nvnews.net/vbulletin/showthread.php?t=115916 -- Thread about graphics issues on the NVIDIA forums.]
:[http://www.nvnews.net/vbulletin/showthread.php?t=115916 -- Thread about graphics issues on the NVIDIA forums.]
:[[Special:myLanguage/GPU-Performance/External_Sound_Cards|Notes on using External Sound Cards]]


[[Category:System]]
<span class="mw-translate-fuzzy">
[[Category:系统/zh-cn]]
</span>

Latest revision as of 12:43, 9 December 2011


Template:Warning (zh CN)

Template:Warning (zh CN)

前言

几种流行的显卡——特别是 NVIDIA 的——在 KDE 4 出现性能问题。这些性能问题主要涉及 Plasma - KDE 4 的桌面,和KWin- KDE 的窗口管理器。一般来说,不是因为没有优化 KDE 4 而是因为显卡驱动的问题。本页包含可能出现的问题和解决办法。

一般提示

显卡驱动程序

这两显卡芯片制造商皆有不同的显卡驱动程序可以使用:

  • NVIDIA显卡有自由的nv和私有的nvidia驱动程序。虽然KDE4在前者同样运作的很好,但它不提供3D加速,因此后者可能是你唯一的选择。多数的NVIDIA小节仅指私有的驱动程序(还有一个第三方的自由驱动程序叫nouveau)。由于授权限制大多数发行版预设情况下不安装私有的驱动程序。请参阅您的发行版信息有关如何安装它。
    • Update 4: NVIDIA's 180.08 version of beta drivers out here; some performance problem were fixed. Also check here for the latest version of beta drivers.
    • Update 5: NVIDIA's 180.08 version of beta drivers out here; some performance problem were fixed. Also check here for the latest version of beta drivers.
  • AMD/ATI显卡你也有几个选择。有自由的「ati」和「radeonhd」驱动程序在 X.org(「ati」也称为「radeon」(没有「hd」),但我看过大多数的xorg驱动程序套件似乎把它称作「ati」)。大多数发行版似乎预设为「ati」,相容早期的 Radeons 显卡;「RadeonHD」,顾名思义,只支持 R500 和之后的显卡 - 零售型号为 X1300 和之后版本。基本上两者都可以正常运行在标准桌面,它们共享相同的 3D 程序代码在 mesa ,所以桌面效果应该是类似的(注意,R300之后的显卡3D支持被认为是不稳定,R600和之后版本是非常实验性的)。Nonetheless, if you have an X1300 or later card (i.e. one that should be supported by both drivers) and you run in to problems with one it may be worth trying out the other. You also have the option of trying the proprietary fglrx driver, though this has limited support for older cards - there's more on the AMD/ATI website about this option. Some distributions package this or have third party repos that package it and this is likely to be easier than downloading from AMD directly.

通常最好更新到已有改善措施的驱动程序。 因此,第一步改善您的 KDE 4 体验应该检查你的当前的驱动程序如果它已经过时就需要更新他。请参考您的发行版的文件,了解如何做到。

尽管可能进一步提高性能,但我建议安装测试版质量的驱动程序,因为有可能影响您系统的稳定。

nvidia-settings

nvidia-settings工具设置的参数不会永久保存,除非你 用root 权限。终端下面用 root 登录,

 :

nvidia-settings&

不然你每次重启X 都得重新设置一次。可以通过添加下列字段到你的 ~/.xinitrc 来轻松做到。

nvidia - 窗口黑掉问题

It seems that older NVidia cards run into the problem that newly opened windows just are drawn as black windows or do not refresh properly anymore. This happens if composite is activated and openGL is used with many windows opened. Maybe the cards are running out of video memory? (The problem does occur with the compiz window manager as well.) In KDE4 you can deactivate composite/effects with Shift + Alt + F12 to continue your work with the desktop normally.

The problem is that drawing of the window decorations does become very slow if no composite is activated (tested with KDE4.3). As alternative to using openGL as composite engine it is recommended to use XRender in this case. Because moving effects become very slow with XRender you should turn animation speed to instant.

系统设置

KDE4的 系统设置 提供您调整KWin设定。你可以在桌面 -> 桌面效果 -> 高级找到设定。根据您的显卡在OpenGLXRender 运作的较好。使用 OpenGL 可能性能会比较好。请记住,下文提到一些修改可能会改变您的设定。

(Note from user): XRender mode helped A LOT on a 6800 GT (agp) with the proprietary driver, especially while looking at videos (177.80).

例如:

  • 设定InitialPixmapPlacement 为2可以提高 plasma 的性能,但有时可能使 KWin 挂掉。
  • OpenGL 模式设定为共享内存可以使KWin反应更快。

(note from a user)* Not selecting "Use Vsync" helped a lot in a gforce 6800 (and also on a GeForce 8400M GT).

如果由于某种原因点击对话框的应用按钮后你的 Xserver 挂掉,并且回复因为无法确认您的更改,再试一次。通常它随后会很快的再尝试。如果没有你仍然可以修改您的设定在~/.kde4/share/config/kwinrc

XGL

If after installing the NVIDIA's 177.80 versions beta drivers you're still experiencing bad performance (especially on 8xxx-9xxx series) you can install XGL xserver. Please refer to your distribution's documentation on how to do that.

Note
XGL has *a lot* of issues regarding 3d applications, xvideo and keyboard layout but, with certain video cards, is now the unique way to enjoy KDE4 at full speed. XGL actually 'bypass' the nvidia driver using the mesa library to render the desktop. OpenGL-based desktop effects cannot be run on XGL.


Fedora 10(及更新) 与 xorg.conf(给某些用户)

本文中提到的一些微调是针对在大多数发行版都可找到的文件:

 /etc/X11/xorg.conf

有些Fedora 10 用户可能会发现默认的情况下这个文件不存在(依赖于他们的显卡 - anyone with more details on this please feel free to elaborate),所以必须重新创建。请这样做:

GUI的方法:

  • 安装并执行'system-config-display'套件,完成后点击Ok,产生包含刚才设定的'xorg.conf'

不用GUI的方法:

  1. 打开指令提示符
  2. 通过执行指令(使用root): init 1切换到runlevel 1
  3. 运行
    Xorg -configure
    用root运行'Xorg -configure',完成后会产生'xorg.conf'档案或者用
    sudo Xorg -configure :1
    ,这样无需切换runlevel

问题

本节简要阐述了一些可能会遇到的症状,并试图解释可能的原因。

调整窗口大小时会卡卡的

  • 说明 : 这可能是由于您的显卡不完全支持 ARGB Visuals(基本半透明)。有关的应用程序和窗口有plasma桌面、krunner对话框(Alt + F2)、plasma的新增组件对话框或 konsole的窗口。
  • 测试 : 如果你要确定这就是你的问题,执行
    $ XLIB_SKIP_ARGB_VISUALS=1 konsole
    在指令列并尝试调整新开的konsole窗口大小(设定环境变量XLIB_SKIP_ARGB_VISUALS关闭ARGB visuals)。如果重设大小没有问题,那么这就是您遇到的问题。
Note
I have found that this fixes Dolphin's preview delay too for me. Please confirm. --dpalacio 17:33, 27 July 2008 (CEST)


Your graphics card struggles with Flash video

If you have an older graphics card, hardware acceleration may be a struggle for it. This may be particularly obvious when watching flash videos such as Youtube videos. This may help:

  • While viewing a 'Flash' video right-click on the video 'screen'.
  • A menu will appear with 'settings' and 'check-boxes'.
  • If you choose the 'global settings' (near the bottom) it takes you a box for the 'global settings'.
  • There you can turn off hardware acceleration for Flash

常规

  • 您可以设定BackingStore选项在您的xorg.conf:

在 "Device"部分

    ...
    Option "BackingStore" "true"
    ...
EndSection "Device"
这可以作用在一些(例如konsole)程序,但不幸的是并非所有的窗口有效。
  • 作为最后的手段,您可以尝试设定XLIB_SKIP_ARGB_VISUALS=1在您的 ~/.xinitrc 但这并不漂亮。

NVIDIA

  • 您可以用nvidia-settings 程式设定IntialPixmapPlacement::
    $ nvidia-settings -a InitialPixmapPlacement=2
    这可以作用在一些NVIDIA 显示卡(但不幸的是不是全部)。

NV/Intel

  • 您可以启用 EXA 加速

xorg.conf 的 "Device" 部分

 ...
    Option "AccelMethod" "EXA"
# optional, may improve performance but introduce visible artifacts
# Option "MigrationHeuristic" "greedy"
    ...
EndSection "Device"

使用此选项的旧 X servers (<=1.4.2)性能会好些,新的 X servers (>=1.4.99.901)会有明显改善 。

  • 这个效能不彰的问题也可以使用 intel影像驱动程序 2.6.3.1(在我的基于deb发行版)或之后的版本,与kernel 2.6.30-rc1 或之后的版本,并在 xorg.conf 启用 UXA 类似这样:

注意:如果您使用 kernel 2.6.29,启用 UXA 扩展会有许多 bug 和随机的 xorg 冻结。

Section "Device"
        Identifier      "Generic Video Card"
        Driver          "intel"
        Option "AccelMethod" "UXA"
EndSection

有了这个设定,我的 i945G 与 PentiumD820,在Glxgears 可以跑 350-500 FPS,和完美运行所有OpenGL渲染效果。

ATI

TODO

Plasma 效能很差

  • 说明 : 不幸的是,plasma 的原因似乎复杂很多,所以很难知道你们问题的原因。
  • 测试 : plasma 性能问题通常可以由文件夹视图部件清楚了解。移动它或档案夹内的滚动可能会相当缓慢。

常规

  • 请确定这不是上面提到关于ARGB Visuals的部分。

NVIDIA

  • 您可以用nvidia-settings程式设定IntialPixmapPlacementGlyphCache 选项:
    $ nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1
    这可以作用在部份的NVIDIA显示卡(但不幸的是不是全部)。据说有些显卡使用
    InitialPixmapPlacement=1
    (甚至
    InitialPixmapPlacement=3
    )运作的更好。
  • Options that are said to work well on 8xxx cards but are untested (by me)
    • Option "RenderAccel" "True"
      • enabled by default
    • Option "TripleBuffer" "True"
      • Enables triple buffering. "Decreases the time an application stalls while waiting for vblank events, but increases latency slightly" (NVIDIA Readme)
    • Option "DamageEvents" "True"
      • Recommended by NVIDIA if running composite+glx, increases performance, enabled by default
    • Option "UseCompositeWrapper" "True"
      • Enables the X server's composite wrapper instead of the builtin one.
    • Option "AllowIndirectPixmaps" "True"
      • Could improve hardware rendering on G80+ cards with more than 256 MB of video memory.
    • Option "BackingStore" "True"
      • Cache overlayed areas in case they get redisplayed later
    • Option "PixmapCacheSize" "200000"
      • allocate said number of pixels for pixmap caches
    • Option "OnDemandVBlankInterrupts" "True"
      • only fire VBlank interrupts in modes where they are needed

ATI

TODO

文件夹视图和其他部件渲染看起来相当糟糕

  • 说明 : 文件夹视图和其他一些plasmoid使用硬件加速渲染。有两种方法做到这一点,并且Plasma需要新的EXA方法。
  • 测试 : 这在文件夹视图组件最容易看到,会在屏幕上显示随意歪曲的区块。

开源的 Radeon 驱动

开源 Radeon 驱动默认使用的是 XAA 硬件加速的方法。所以你需要从 XAA(X Acceleration Architecture)更改 2D 加速方法,以使用较新的 EXA。由于这涉及到编辑您的 xorg.conf 文件,记住,这样的修改可能会损害您的系统。这一点需要您自担风险,如果你做错了,有可能导致 X 无法启动,所以先备份 xorg.conf 文件。

要更换,编辑你的 xorg.conf 文件。定位到设定显卡的 Device 部分。添加这行

Option "AccelMethod" "EXA"

到 "EndSection" 这行之前。如果已经有一行是有 AccelMethod,那直接修改 XAA 成 EXA。保存文件并重启 X server。

Note that using EXA may result in some older applications, such as some KDE3 programs being rendered incorrectly.

When using EXA it is strongly recommended to use a recent X server, at least 1.6.x or even better the new 1.7 release -- perhaps best to wait for 1.7.1.

If you have an AGP-based card then you may also want to add the following line at the same location into the configuration file.

Option "AccelDFS"    "true"

This should accelerate the driver even more, but may get you a hardlock when starting X. So be cautious with this option. See this article for more information on this topic.

Some things that may speed up any card's performance

The first one refers particularly to systems running KDE prior to 4.3.1 -

  • Try to avoid using many widgets on your desktop, particularly if they are of the dynamic updating type.
  • Turn off transparency/translucency, choosing themes that don't use it.
  • Use a theme with transparency, but change the configuration. Set the fade time to zero.
    • There are two ways to do this, both in the desktop-effects systemsettings dialog. One, on the General tab, set animation speed to Instant.
    • Two, on the All Effects tab, find translucency, configure it, and set fading duration to 0 to 10 or so. (The spinner increments are 100 ms, so the 10 ms suggestion is only a tenth of that.)

These hints won't turn an old graphics card into a fast one, but they will make Desktop Effects a feasibility on many older cards.

Desktop Effects causes random freezes

这似乎是受 Intel 和 ATi 显卡影响。AccelMethod 似乎是罪魁祸首。大部分驱动程序现在预设加速途径是已经过时和缓慢的 XAA(Option "AccelMethod" "XAA")。这是不建议的作法,特别是在组成(compositing)。 不幸的是,私有的 ATI 和 Nvidia 驱动仍然只支持 XAA。

ATi

尝试加入以下两行启用 EXA 加速

Section "Device"
   Option      "UseAtomBIOS" "true"
   Option      "AccelMethod" "EXA"
   # ...
EndSection

这个方法可以用在两款驱动 radeon 以及 radeonhd,但显卡有最高只到 X1950 有效。HD2xxx 及以上尚未不支持。

AtomBIOS is automatically used by the radeon driver, so that line will need to be commented out. If you have the radeonhd driver, however, you will need it. EXA is expected to become the default in the near future, but having it specified here is unlikely to cause any problems even then. 3D and EXA support for HD2xxx and above is expected later this year (2009) as they are already in an experimental branch.

Intel

检查 Xorg.0.log 中是否有 EXA。如果你没有找到它(或 UXA)试着加入EXA 在 ATi section。UXA是一个实验性的选择,但只支持少数驱动。It's likely that the best bits will be merged into EXA soon.

Phoronix forums is a good place to read more about this.

KRunner(Alt+F2)看起来怪怪的

NVIDIA

KRunner 显示问题
KRunner 显示问题

在NVIDIA显卡上krunner对话框可能会出现好几个(只有最上面的可以使用)。这是由于上述建议设定InitialPixmapPlacement=1 。目前还没有任何已知的方法来解决这个问题。

在您系统托盘的图标大多数都消失

At some point you may have been told to add KDE_SKIP_ARGB_VISUALS to either ~/.bash_profile, /etc/profile or in ~/.profile. If that rings a bell for you, hunt for it and comment it out. You may find that they magically re-appear. Otherwise, check the Qt4 libraries you are using. In my case I needed Qt 4.4.3 together with KDE 4.2.


连接和参考文献

-- Performance tweaks to the 177.67 Nvidia beta driver
-- Thread about graphics issues on the NVIDIA forums.
Notes on using External Sound Cards