个人工具

UbuntuHelp:BinaryDriverHowto/Nvidia/zh

来自Ubuntu中文

Zhan讨论 | 贡献2007年8月21日 (二) 17:39的版本

跳转至: 导航, 搜索


这是一份在一个有 NVIDIA 显卡的系统上安装 NVIDIA 驱动的指南。对于其他的显卡,请参考 UbuntuHelp:BinaryDriverHowto

需求

  • 运行命令 lspci | grep -i nvidia 有一行输出。
  • 您需要下面的一个和多个功能: 3D 硬件加速,TV 输出的支持,双头显示器的支持。

安装

7.04

对于 Ununtu 7.04(Feisty Fawn) 推荐的安装驱动的方式是使用 系统 -> 管理 ->受限驱动管理器"。这种方式将在 nvidia-glx-legacy(71xx 的驱动), nvidia-glx(96xx的驱动), nvidia-glx-new(在写这篇文章的时候还是 97xx 的驱动) 中自动选择您需要的正确的版本的驱动。(注: 受限驱动管理器可能在之前使用第三方工具比如 envy 安装驱动的机器上可能不能正常工作)。

A common problem after set up is that the screen resolutions on offer are far lower than those offered when using the open source driver. The NVIDIA binary driver seems to be very weak at reliably probing this information from the monitor and relys on additional information in xorg.conf to mask the problem. In Feisty, this information is not written into xorg.conf by default. See this launchpad bug talking about lost resolutions when using the NVIDIA binary driver along with FixVideoResolutionHowto for further details and potential workarounds.

安装之后的一个通常的问题是提供的屏幕分辨率比开源驱动提供的分辨率低了。Nvidia 的二进制驱动似乎在从监视器上探测这类信息的能力非常弱,它必须依靠 xorg.conf 中的额外信息来处理这个问题。在 Feisty 中这个信息默认没有写到 xorg.conf 中。请参考关于使用Nvidia 二进制驱动丢失分辨率信息的 bug 报告 还有 UbuntuHelp:FixVideoResolutionHowto 来得到进一步的信息和一些解决方式。

Another common problem for people using laptops with GeForce Go cards (and possibly other non laptop cards with displays connected by DVI) is that the driver sometimes defaults to displays on the external CRT socket. This is covered in a launchpad bug from a laptop user with a black screen and details a workaround to put into xorg.conf. The usual hint that you have this particular problem is you can hear the startup sound/Ubuntu drums but cannot see anything. If you do not hear any sound your issue is almost certainly not this one so please refrain from posting new comments about your issue in that particular bug.

If the above fails try checking the troubleshooting Troubleshooting at the end of this page. If this still fails, or you are using a version of Ubuntu older than 7.04 or you wish to configure things manually then please see the list of supported cards on the NVIDIA website and read on.

Please note: Any problems that occur after installing drivers not provided by Ubuntu repositories should not be reported to the launchpad bug area. If the drivers were downloaded from the NVIDIA web site then the NVIDIA linux web forum is an appropriate place to report issues. If a 3rd party installer was used please contact the 3rd party for support. Other places for manual driver support can be found on the Community Support page.

6.10 and earlier

Enable restricted packages

Note: If you are running Ubuntu 6.10 (Edgy Eft) or later, the Restricted repositories might already be enabled. Also if you are running Kubuntu, gedit is not installed by default, so you should use kate instead of gedit.

The NVIDIA drivers are in the "restricted" section of the Ubuntu package repository, so before you will be able to install the drivers, you must enable this section on your system. If you are following the MythTV setup guide this should already be done.

  • Select the System menu at the top of the screen.
  • Select Administration then Synaptic Package Manager. Enter your password when prompted.
  • In the package manager, select the Settings menu, then Repositories.
  • In the Software Preferences dialog that comes up, click the Add button.
  • In the Edit Repository dialog, ensure that the Restricted copyright box is checked, then press OK.
  • Press OK to close the Software Preferences dialog, when Synaptic asks you to reload the package database, say yes.

You now have access to the many additional packages in the restricted section, including the NVIDIA driver packages.

Install and activate drivers

Packages may be installed by right-clicking on the package and selecting Mark for Installation.

Note:

  • Click the Search button and search for "linux-restricted-modules". You must have restricted modules enabled (see above).
  • Find the appropriate module for your kernel. For example, if you have linux-image-amd64-k8 installed, then you should install linux-restricted-modules-amd64-k8. Selecting one will also install nvidia-kernel-common. (Note: you have to select the restricted modules first because the nvidia-glx package automatically installs the i386 one - and if you have a generic kernel image, the X will not work.)
  • Click the Search button and search for "nvidia".
  • You will install either nvidia-glx-legacy or nvidia-glx. If your graphics card is at the end of this list of cards (marked as "legacy"), you will need to install nvidia-glx-legacy. Otherwise, install nvidia-glx.
  • If you are going to compile 3D applications, install nvidia-glx-dev.
  • If you are running Hoary Hedgehog or Breezy Badger, then install nvidia-settings and nvidia-xconfig. DO NOT install either package in Ubuntu 6.06 LTS because it will remove nvidia-glx. These programs are now provided in nvidia-glx.
  • Click the Apply button to install the new packages.
  • Once Synaptic has finished applying your changes, exit the application.
  • Select the Applications menu at the top of the screen, then Accessories, then Terminal.
  • In the terminal window, if you are running Ubuntu 6.10 Edgy, type the following:
sudo nvidia-xconfig

If you are running an earlier version, type the following instead:

sudo nvidia-glx-config enable
  • Close all your applications, then press Ctrl-Alt-Backspace, or restart your computer, to restart the X server. If you see an NVIDIA splashscreen after hitting Ctrl-Alt-Backspace, your drivers are properly installed.

Nvidia Legacy Driver in 6.10

The above instructions did not work for me in Edgy on a GeForce 1 using the legacy drivers nvidia-glx-legacy 1.0.7184+2.6.17.6-1

I had to manually edit /etc/X11/xorg.conf and change

 Section "Device"
Identifier      "NVIDIA Corporation NV10DDR [GeForce 256 DDR]"
Driver          "nv"
BusID           "PCI:1:0:0"
EndSection 

to

 Section "Device"
Identifier      "NVIDIA Corporation NV10DDR [GeForce 256 DDR]"
Driver          "nvidia"
BusID           "PCI:1:0:0"
EndSection 

If Driver "nvidia" is not found in xorg.conf then attempting to modprobe nvidia will result in an error message (thus sudo nvidia-glx-config enable would not work for me). After this change, to allow OpenGL programs to run the following had to be added to the bottom of /etc/X11/xorg.conf :

 Section "Extensions"
Option  "Composite" "Disable"
EndSection

otherwise the following error occurred when running GL programs like glxinfo:

Xlib: extension "GLX" missing on display ":0.0".

This is not documented anywhere in the the legacy drivers (i.e. there is no mention of this in /usr/share/doc/nvidia-glx-legacy/*) but thankfully the following warning will appear in /var/log/Xorg.0.log:

(EE) GLX is not supported with the Composite extension

By default Composite is turned on and this will prevent OpenGL from working - the above stanza simply turns Composite off. These steps are only needed for the legacy driver. More information about this problem can be found in the launchpad bug about GLX being disabled on legacy drivers.


Remove the nVidia logotype

If you want to get rid of the nVidia logotype that shows up before your login screen you need to perform some manual edits in the Xorg configuration file.

  • Select the Applications menu at the top of the screen, then Accessories and then Terminal.
  • Type the following:
gksudo gedit /etc/X11/xorg.conf

or if you are using Kubuntu:

kdesu kate /etc/X11/xorg.conf
  • Find the line Driver "nvidia" in the Device section
  • Just after this line, add
Option		"NoLogo"
  • Save the file and exit
  • Close all your applications, then press Ctrl-Alt-Backspace to restart the X server. If the logotype is gone and everything seems to work you are done.

Anchor(troubleshooting)

Troubleshooting

  • NVIDIA recently changed (as of March 2007) which cards are supported by the unified driver and the legacy driver. You can find the release notes at NVIDIA's web site.
  • It seems that a reboot is sometimes necessary for these changes to take effect. If 3D acceleration isn't working, try this first.
  • If 3D acceleration still isn't working, be sure that you have the right version of linux-restricted-modules installed. It must match the version of the running kernel.
  • If you have the right version of linux-restricted-modules installed and 3D acceleration still isn't working, open your /etc/X11/xorg.conf file for editing with gksudo gedit /etc/X11/xorg.conf or kdesu kate /etc/X11/xorg.conf if using Kubuntu. Be sure that the Driver entry under Section "Device" is set to "nvidia".
  • If suspend no longer works, see NvidiaLaptopBinaryDriverSuspend (this applies to desktops too).
  • You may need to activate the "kernel framebuffer device interface" in X server. Copy/paste the below command into the terminal. The terminal will then start stepping you through each configuration setting. Most of the settings can be left at their defaults by pressing the ENTER button, but when you get to "Select the desired X server driver" (question 2), make sure to select "nvidia" and NOT "nv". At question 7 ("Activate kernel framebuffer device interface?") select "yes". Finish the rest of the questions (the rest of the settings can be left at their defaults) and then restart X server (or just restart your computer). If, when you reboot, you can't see the login screen, but instead get a message saying "X server failed to start (etc. etc.)", you will start in text mode (white text on black background) and it will ask you to login. After logging you will still be in text mode. Retype the same command below (make sure to write it down!) and then the configuration sequence will start again. This time at the "Activate kernel framebuffer device interface?") select "no" then restart your computer and your login screen will be restored.
sudo dpkg-reconfigure xserver-xorg
  • If you get an error while loading NVIDIA module try to rebuild module dependencies by running depmod.
sudo depmod
  • If you're feeling frisky and decide to fiddle around with the X Server Options for your Device in /etc/X11/xorg.conf and Firefox refuses to load (returns segmentation fault when launched from a terminal), this line may be the culprit:
Option "NoRenderExtension" "On"
Either comment it out (using a # at the beginning the line) or set it to Off.
  • If you have problems with video playback, e.g. in mplayer, gxine, or mythtv frontend with a legacy card, it may be due to too high a color depth (e.g. using NT6 Vanta/Vanta LT nvidia driver, I experienced flickering vertical bars & blue screen flashing). To fix this, manually edit /etc/X11/xorg.conf and change DefaultDepth to 16.

See Also

Install Nvidia proprietary drivers, Howto @gwos

NvidiaMultiMonitors

Part of UserDocumentation