archlinux中Nvidia 驱动的安装

其他Linux/Unix/BSD/OSX等发行版讨论
回复
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

archlinux中Nvidia 驱动的安装

#1

帖子 skyx » 2008-02-04 15:32

图片
http://wiki.archlinux.org/index.php/NVIDIA

How to install Nvidia Driver with pacman
Info from Package Maintainer tpowa

The package is for those people who run a stock arch kernel! I only test with kernel 2.6 and xorg.

NOTE by someone else: we didn't forget people using the -beyond kernel, check next paragraph

Multiple kernel users: You need to install nvidia package for each extra!
Installing drivers

You have to use extra repository, enable it for pacman. Leave X-Server, else pacman cannot finish installation and it will not work! As root, run:

pacman -Sy nvidia (for newer cards)
pacman -Sy nvidia-96xx or pacman -Sy nvidia-71xx (for older cards)

For -beyond users:

pacman -Sy nvidia-beyond
pacman -Sy nvidia-96xx-beyond or pacman -Sy nvidia-71xx-beyond (for older cards)

If you use the -ck, -suspend2 or -mm kernels, adjust the above command appropriately.

See the README from nvidia for details on which card is supported by which driver.
Configuring X-Server

Edit /etc/X11/XF86Config or your /etc/X11/xorg.conf config file: Disable in modules section: GLcore and DRI

Add to modules section:

Load "glx"

Make sure you DON'T have a line

Load "type1"

in the Module section since recent versions of xorg-server does not include the type1 font module (completely replaced by freetype).

Disable Section DRI completely:

#Section "DRI"
# Mode 0666
#EndSection

Change Driver "nv" or Driver "vesa" to Driver "nvidia" If it exists disable Chipset option (only needed for nv driver).

This was for basic setup, if you need more tweaking options have a look at /usr/share/doc/NVIDIA_GLX-1.0/README.txt.

You can also run:

nvidia-xconfig

See installing and configuring xorg.
Enabling Composite in Xorg

Refer to the Composite wiki for detailed instructions.
Modifying Arch rc.conf file

Add nvidia to /etc/rc.conf MODULES section (not needed anymore if you run xorg and udev). Needed for nvidia-71xx and kernel >=2.6.13!
Problems that might occur
Nvidia specific

Xorg7: Please remove your old /usr/X11R6 dir it can cause trouble during installation. Also make sure you've installed pkgconfig. The NVIDIA installer uses pkgconfig to determine where modular Xorg components are installed.

If you experience slow 3D Performance have a look at /usr/lib/libGL.so.1, /usr/lib/libGL.so, /usr/lib/libGLcore.so.1 Perhaps they are wrong linked to mesa or something else. Try reinstalling with pacman -S nvidia.

When you get this message when you try to start an openGL application (for example enemy-territory, or glxgears):

Error: Could not open /dev/nvidiactl because the permissions are too
restrictive. Please see the FREQUENTLY ASKED QUESTIONS
section of /usr/share/doc/NVIDIA_GLX-1.0/README
for steps to correct.

Add yourself to the video group using gpasswd -a yourusername video (don't forget to log out and back in, or type: source /etc/profile).
Arch specific

GCC update: You must compile the module with the compiler that was used for the kernel else it may fail. A simple pacman -S nvidia should do it, if not wait for a new kernel release and stay with old kernel and gcc.

Kernel update: Kernel updates will require reinstalling the driver. A workaround is available.
Driver Config Tool

The new config tool for the nvidia-drivers is included called 'nvidia-settings' You don't have to use it it's only a add-on!
For more information about the use, have a look at the following file:
/usr/share/doc/NVIDIA_GLX-1.0/nvidia-settings-user-guide.txt
Please install gtk2 with "pacman -S gtk2" in order to use this tool.

NOTE: If you experience problems like crashing the X-Server while running the tool you have to delete your .nvidia-settings-rc file in your home directory.
Known Issues

If you experience crashes, try to disable RenderAccel "True" option.

If you have nvidia installer complaining about different versions of gcc between the current one and the one used for compiling the kernel then see on how to install the traditional way but remember to export IGNORE_CC_MISMATCH=1

If you have comments on the package please post it here: http://bbs.archlinux.org/viewtopic.php?t=10692 If you have a problem with the drivers have a look at the nvidia forum: http://www.nvnews.net/vbulletin/forumdi ... forumid=14 For a Changelog please look here: http://www.nvidia.com/object/linux_disp ... -8762.html

Note: please don't change the above part without notifying me.
Bad performance after installing new nvidia-driver

If you experience very slow fps rate in compare with older driver first check if You have Direct Rendering turned on. You can do it by:

glxinfo | grep direct

If You get: direct rendering: No then that's your problem. Next check if You have the same versions of glx for the client and server by this:

glxinfo | egrep "glx (vendor|version)"

And if you see different vendors or versions for the client and server run this:

ln -fs /usr/lib/libGL.so.$VER /usr/X11R6/lib/libGL.so
ln -fs /usr/lib/libGL.so.$VER /usr/X11R6/lib/libGL.so.1
ln -fs /usr/lib/libGL.so.$VER /usr/lib/libGL.so.1.2

Where $VER is the version of nvidia package, that you're using. You can check it by nvidia-settings

That's all. Now restart your Xserver and you should have normal acceleration.
How to install NVIDIA Driver the traditional way

WARNING This will give you a whole new series of problems to deal with, because of libgl being provided by the pacman package, you will have to create an empty dummy libgvl package, and you'll still need nvidia-utils for Mesa OpenGL library, otherwise packages you install will depend on mesa also. Read more here: http://bbs.archlinux.org/viewtopic.php?pid=286530

* Download the latest NVIDIA driver from: http://www.nvidia.com/object/linux.html

File name will look something like this: NVIDIA-Linux-x86-1.0-7167-pkg0.run

The Kernel Steps (the following 4 steps) can be left out if you use at least kernel 2.6.5 because the needed Includes are now in the Kernel package

* Download the kernel source for the kernel version you are using

uname -r will give you kernel version

*
o http://www.kernel.org/pub/linux/kernel/v2.6/ - for the 2.6 series
o http://www.kernel.org/pub/linux/kernel/v2.4/ - for the 2.4 series

* Move the current incomplete kernel source tree to 2.x.x.old:

mv /usr/src/2.x.x /usr/src/2.x.x.old

* Uncompress and unpack your source code in /usr/src:

mv /path/to/linux-2.x.x.tar.bz2 /usr/src
cd /usr/src
tar --bzip2 -xvf linux-2.x.x.tar.bz2

* Copy the old include directory and .config file into new source tree:

cp -rp linux-2.x.x.old/include/ linux-2.x.x/include/
cp linux-2.x.x.old/.config linux-2.x.x/.config

* Go to a non-graphical session
o Use Control-Alt-F5 (or whatever F key you want)
o Login as root
o Go to runlevel 3

init 3

* Run NVIDIA installer

sh /path/to/NVIDIA-Linux-x86-1.0-5336-pkg0.run

You will be asked to accept their license, then hit OK a couple times on informational screens, the driver will then be built and installed

* Edit XFree86Config file
o Use the editor of choice to open /etc/X11/XFree86Config and go to the Device section
o Change your driver from current (probably nv or vesa) to nvidia:
+ Driver "nv" to Driver "nvidia"
o Uncomment the glx load line
+ #Load "glx" to Load "glx"
o Comment or delete the Chipset line if exists

* Edit modules loaded on boot
o Open /etc/rc.conf in editor
o Add nvidia to modules section

MODULES=(... some modules ... nvidia)

* Reboot the machine and enjoy 3D acceleration...and a tainted kernel :)

Tweaking NVIDIA drivers

Open /etc/X11/xorg.conf or /etc/X11/XFree86Config with your editor of choice and try the following options to improve performance. Not all options may work for your system, try them carefully and always backup your configuration file.
Disable NVIDIA Graphics Logo on startup

Under Device section add the "NoLogo" Option

Option "NoLogo" "True"

Enable hardware acceleration

Under Device section add the "RenderAccel" Option.

Option "RenderAccel" "True"

NOTE: The RenderAccel is enabled by default since drivers version 9746.
Override monitor detection

The "ConnectedMonitor" Option under Device section allows to override the monitor detection when X server starts. This may save a bunch of seconds at start up. The available options are: "CRT" (cathode ray tube), "DFP" (digital flat panel), or "TV" (television).

The following statement force NVIDIA drivers to use DFP monitors.

Option "ConnectedMonitor" "DFP"

NOTE: use "CRT" for all analog 15 pin VGA connections (even if you have a flat panel). "DFP" is intended for DVI digital connections only!
Enable TripleBuffer

Enable the use of triple buffering by adding under Device section the "TripleBuffer" Option.

Option "TripleBuffer" "True"

Use this option if your GPU has plenty of ram (128mb and more) and combined with "Sync to VBlank". You may enable sync to vblank in nvidia-settings.
Enable BackingStore

This option is used to enable the server's support for backing store, a mechanism by which pixel data for occluded window regions is remembered by the server thereby alleviating the need to send expose events to X clients when the data needs to be redisplayed. BackingStore is not bounded to NVIDIA drivers but to X server itself. ATI users would benefit of this option as well.

Under Device section add:

Option "BackingStore" "True"

Use OS-level events

Taken from NVIDIA drivers README file: "Use OS-level events to efficiently notify X when a client has performed direct rendering to a window that needs to be composited." Whatever it means, it may help improve performance. This option is currently incompatible with SLI and Multi-GPU modes.

Under Device section add:

Option "DamageEvents" "True"

This option is enabled by default in newer driver.
Enable power saving

... For a greener planet (not strictly related to NVIDIA drivers). Under Monitor section add:

Option "DPMS" "True"

Further readings

* NVIDIA drivers README file (latest drivers)
* Compiz Fusion wiki

Using TV-out on your NVIDIA card

Good article on the subject can be found from:

http://en.wikibooks.org/wiki/NVidia/TV-OUT

Why is the refresh rate not reported correctly by utilities that use the XRandR X extension (e.g., the GNOME "Screen Resolution Preferences" panel, `xrandr -q`, etc)?

The XRandR X extension is not presently aware of multiple display devices on a single X screen; it only sees the MetaMode bounding box, which may contain one or more actual modes. This means that if multiple MetaModes have the same bounding box, XRandR will not be able to distinguish between them.

In order to support DynamicTwinView, the NVIDIA X driver must make each MetaMode appear to be unique to XRandR. Presently, the NVIDIA X driver accomplishes this by using the refresh rate as a unique identifier.

You can use `nvidia-settings -q RefreshRate` to query the actual refresh rate on each display device.

The XRandR extension is currently being redesigned by the X.Org community, so the refresh rate workaround may be removed at some point in the future.

This workaround can also be disabled by setting the "DynamicTwinView" X configuration option to FALSE, which will disable NV-CONTROL support for manipulating MetaModes, but will cause the XRandR and XF86VidMode visible refresh rate to be accurate.
How to install NVIDIA Driver with custom kernel

It's an advantage to know how the ABS system works by reading some of the other wiki pages about it, first:

* http://wiki.archlinux.org/index.php/ABS
* http://wiki.archlinux.org/index.php/Makepkg
* http://wiki.archlinux.org/index.php/The ... guidelines.


We will create our own pacman package quickly by using ABS, which will compile the module for the currently running kernel:

Make a temporary directory for creating our new package:

mkdir -p /var/abs/local/

Make a copy of the nvidia package directory:

cp -r /var/abs/extra/x11/nvidia/ /var/abs/local/

Go into our temporary nvidia directory:

cd /var/abs/local/nvidia

We need to edit the two files nvidia.install and the PKGBUILD file, so they contain the right kernel version variables, so we don't have to move it from the stock kernel /lib/modules/2.6.xx-ARCH directory.

You can get your kernel version and local version name if you type:

uname -r

* In nvidia.install replace the KERNEL_VERSION="2.6.xx-ARCH" variable with your kernel version, such as KERNEL_VERSION="2.6.22.6" or KERNEL_VERSION"2.6.22.6-custom" depending on what your kernels version is and local version text/number.

* In PKGBUILD change the _kernver='2.6.xx-ARCH' variable to match your kernel version again, like above.
* If you have more than one kernel coexisting in parallel with another, (such as a custom kernel alongside the default -ARCH kernel) change the "pkgname=nvidia" variable in the PKGBUILD to a unique identifier, such as nvidia-2622 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original.

Then do:

makepkg -i -c

.. Now it will automatically build the NVIDIA module for your custom kernel and clean up the leftover files from creating the package. Enjoy!
no security measure is worth anything if an attacker has physical access to the machine
boveyzjb
帖子: 2
注册时间: 2009-05-03 17:38

Re: archlinux中Nvidia 驱动的安装

#2

帖子 boveyzjb » 2009-07-01 18:27

没有中文阿……看不懂的 :em06
头像
yanzilme
帖子: 253
注册时间: 2006-11-01 3:21

Re: archlinux中Nvidia 驅動的安裝

#3

帖子 yanzilme » 2009-07-01 21:24

有沒有這麼麻煩啊?
我都直接sh nvidia-xxxxx.run就裝好了
其他參考wiki配置一下xorg.conf,一點問題都沒有
Ubuntu入門初基;ArchLinux登峰造極!
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: archlinux中Nvidia 驱动的安装

#4

帖子 自由建客 » 2009-07-02 19:50

pacman -Sy nvidia :ema0
头像
想入非非
帖子: 8078
注册时间: 2008-07-14 22:42
来自: Beijing
联系:

Re: archlinux中Nvidia 驱动的安装

#5

帖子 想入非非 » 2009-07-02 20:28

自由建客 写了:pacman -Sy nvidia :ema0
:em06
Ubuntu User
回复