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

From KDE UserBase Wiki
m (Created page with ";說明 : 不幸的是,plasma 的原因似乎複雜很多,所以很難知道你們問題的原因。")
m (Created page with ";測試 : plasma 性能問題通常可以由''檔案夾檢視''plasmoid 清楚了解。移動它或檔案夾內的滾動可能會相當緩慢。")
Line 135: Line 135:
;說明 : 不幸的是,plasma 的原因似乎複雜很多,所以很難知道你們問題的原因。
;說明 : 不幸的是,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 性能問題通常可以由''檔案夾檢視''plasmoid 清楚了解。移動它或檔案夾內的滾動可能會相當緩慢。


==== General ====
==== General ====

Revision as of 13:28, 16 February 2011


Template:Warning (zh TW)

Template:Warning (zh TW)

入門

幾種流行的顯示卡 - 特別是 NVIDIA 的 - 在 KDE 4 出現性能問題。這些性能問題主要涉及 Plasma - KDE 4 的桌面,和 KWin - KDE 的視窗管理員。一般來說,不是因為 KDE 4 沒有被優化而是顯示卡驅動程式的問題。本頁包含可能出現的問題以及如何解決他們。

一般提示

繪圖驅動程式

這兩繪圖晶片製造商皆有不同的繪圖驅動程式可以使用:

  • NVIDIA顯卡有自由的nv和私有的nvidia驅動程式。雖然KDE4在前者同樣運作的很好,但它不提供3D加速,因此後者可能是你唯一的選擇。多數的NVIDIA小節僅指私有的驅動程式(還有一個第三方的自由驅動程式叫nouveau)。由於授權限制大多數發行版預設情況下不安裝私有的驅動程式。請參閱您的發行版資訊有關如何安裝它。
    • 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 64bit and 32bit versions. You need to add some options to your xorg.conf and enable certain feature at runtime, see 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 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 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 here.
    • Update 4: NVIDIA's 177.80 version of beta drivers out here; some performance problem were fixed.
    • 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 用戶可能會發現預設的情況下這個檔案不存在(depending on their card- 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)


一般

  • 您可以設定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 性能問題通常可以由檔案夾檢視plasmoid 清楚了解。移動它或檔案夾內的滾動可能會相當緩慢。

General

  • Please make sure this is not (only) related to the ARGB Visuals mentioned in the above section.

NVIDIA

  • You can set the IntialPixmapPlacement and the GlyphCache option with the nvidia-settings utility:
    $ nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1
    This works for some (but unfortunately not all) NVIDIA cards. Some cards reportedly work better using
    InitialPixmapPlacement=1
    or maybe even
    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

Folder View and other plasmoids look badly rendered

  • 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.

Open Source radeon driver

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.

To make the switch, edit your xorg.conf file. Locate the Device section for your graphics card. Before the "EndSection" line, add

Option "AccelMethod" "EXA"


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.

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

This seems to affect Intel and ATi cards. AccelMethod seems to be the culprit. The default acceleration path for most drivers right now 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

Try enabling EXA acceleration by adding these two lines to xorg.conf

Section "Device"
   Option      "UseAtomBIOS" "true"
   Option      "AccelMethod" "EXA"
   # ...
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.

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

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.

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

KRunner (Alt+F2) looks strange

NVIDIA

KRunner display problems
KRunner display problems

On NVIDIA cards krunner's dialog might appear several times below each other (with only the topmost one editable). This is related to setting InitialPixmapPlacement=1 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.

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. Otherwise, check the Qt4 libraries you are using. In my case I needed Qt 4.4.3 together with KDE 4.2.

Links/References

-- Performance tweaks to the 177.67 Nvidia beta driver
-- Thread about graphics issues on the NVIDIA forums.