/[gentoo]/xml/htdocs/doc/en/nvidia-guide.xml
Gentoo

Contents of /xml/htdocs/doc/en/nvidia-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.52 - (hide annotations) (download) (as text)
Tue Jul 24 12:12:51 2012 UTC (2 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.51: +8 -8 lines
File MIME type: application/xml
Fix bug #427860 - Use /etc/portage for make.conf and make.profile. Old location (/etc) is still supported, this is a heads up (new default)

1 swift 1.1 <?xml version='1.0' encoding="UTF-8"?>
2 swift 1.52 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/nvidia-guide.xml,v 1.51 2011/09/11 08:43:18 swift Exp $ -->
3 swift 1.1 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4    
5 nightmorph 1.49 <guide>
6 swift 1.1 <title>Gentoo Linux nVidia Guide</title>
7    
8     <author title="Author">
9 nightmorph 1.35 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
10 swift 1.1 </author>
11 nightmorph 1.41 <author title="Author">
12     <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
13     </author>
14 neysx 1.13 <author title="Editor">
15 fox2mike 1.15 <mail link="curtis119@gentoo.org">M Curtis Napier</mail>
16 neysx 1.13 </author>
17 neysx 1.21 <author title="Editor">
18 nightmorph 1.31 <mail link="wolf31o2@gentoo.org">Chris Gianelloni</mail>
19     </author>
20 swift 1.1
21     <abstract>
22     Many Gentooists have an nVidia chipset on their system. nVidia provides specific
23     Linux drivers to boost the performance of your card. This guide informs you how
24     to install and configure these drivers.
25     </abstract>
26    
27 fox2mike 1.15 <!-- The content of this document is licensed under the CC-BY-SA license -->
28     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
29 swift 1.1 <license/>
30    
31 swift 1.52 <version>3</version>
32     <date>2012-07-24</date>
33 swift 1.1
34     <chapter>
35 neysx 1.14 <title>Introduction</title>
36     <section>
37     <body>
38    
39     <p>
40 diox 1.36 The nVidia drivers in the tree are released by nVidia and are built against the
41     Linux kernel. They contain a binary blob that does the heavy lifting for talking
42     to the card. The drivers consist of two parts, a kernel module, and an X11
43     driver. Both parts are included in a single package. Due to the way nVidia has
44     been packaging their drivers, you will need to make some choices before you
45 nightmorph 1.41 install the drivers.
46     </p>
47    
48     <p>
49 nightmorph 1.42 The <c>nvidia-drivers</c> package contains the latest drivers from nVidia with
50     support for <e>all</e> cards, with several versions available depending on how
51     old your card is. It uses an eclass to detect what kind of card you're running
52     so that it installs the proper version.
53 nightmorph 1.31 </p>
54    
55 neysx 1.14 </body>
56     </section>
57     </chapter>
58    
59     <chapter>
60 diox 1.36 <title>Driver compatibility</title>
61     <section>
62 nightmorph 1.41 <title>Which version?</title>
63 diox 1.36 <body>
64    
65     <p>
66 nightmorph 1.41 The <c>nvidia-drivers</c> package supports the full range of available nVidia
67     cards. Multiple versions are available for installation, depending on the
68     card(s) you have.
69 diox 1.36 </p>
70    
71 nightmorph 1.41 <p>
72 nightmorph 1.49 Newer cards such as the GeForce 400, 300, 200, 100, 9, 8, 7, and 6 series should
73     use the latest drivers.
74 nightmorph 1.41 </p>
75 diox 1.36
76     <p>
77 nightmorph 1.47 Older cards such as the GeForce FX 5 series should use the 173.x drivers, such
78     as <c>nvidia-drivers-173.14.15</c>. For these cards, you should mask
79     <c>>=x11-drivers/nvidia-drivers-174.00</c> in your
80     <path>/etc/portage/package.mask</path> file. This will prevent newer versions of
81     the driver which are incompatible with your card from being installed.
82     </p>
83    
84     <p>
85     Old cards such as the GeForce 3 or GeForce 4 series require the 96.x drivers.
86 nightmorph 1.44 For these cards, you should mask <c>>=x11-drivers/nvidia-drivers-97.00</c> in
87 nightmorph 1.47 your <path>/etc/portage/package.mask</path> file.
88 nightmorph 1.41 </p>
89    
90     <p>
91 nightmorph 1.49 The oldest NV2x-based cards (such as TNT, TNT2, GeForce, and GeForce 2) are no
92     longer supported by <c>nvidia-drivers</c>. Instead, use an open-source driver:
93     <c>xf86-video-nouveau</c> (recommended) or <c>xf86-video-nv</c> (old,
94     deprecated).
95 diox 1.36 </p>
96    
97 nightmorph 1.41 <p>
98     You can check for driver compatibility for your card at to determine which
99 nightmorph 1.44 driver supports it by viewing the README at its appropriate x86 or x86-64
100     <uri link="http://www.nvidia.com/object/unix.html">release page</uri>.
101 nightmorph 1.41 </p>
102    
103 diox 1.36 </body>
104     </section>
105     </chapter>
106    
107     <chapter>
108 swift 1.1 <title>Configuring your Card</title>
109     <section>
110 neysx 1.21 <title>Kernel Configuration</title>
111 swift 1.1 <body>
112    
113     <p>
114 neysx 1.14 As mentioned above, the nVidia kernel driver installs and runs against your
115     current kernel. It builds as a module, so it makes sense that your kernel must
116 diox 1.36 support the loading of kernel modules. If you used <c>genkernel all</c> to
117     configure the kernel for you, then you're all set. If not, double check your
118 nightmorph 1.31 kernel configuration so that this support is enabled:
119 swift 1.1 </p>
120    
121     <pre caption="Enabling the Loading of Kernel Modules">
122     Loadable module support ---&gt;
123     [*] Enable loadable module support
124     </pre>
125    
126     <p>
127 swift 1.5 You also need to enable <e>Memory Type Range Register</e> in your kernel:
128     </p>
129    
130     <pre caption="Enabling MTRR">
131     Processor and Features ---&gt;
132     [*] MTRR (Memory Type Range Register) support
133     </pre>
134    
135 nightmorph 1.33 <p> Also, if you have an AGP graphics card, you can optionally enable
136     <c>agpgart</c> support to your kernel, either compiled in or as a module. If
137     you do not use the in-kernel agpgart, then the drivers will use their own
138     <c>agpgart</c> implementation, called <c>NvAGP</c>. On certain systems, this
139     performs better than the in-kernel agpgart, and on others, it performs worse.
140     You will need to evaluate this on your own system to get the best performance.
141     If you are unsure what to do, use the in-kernel agpgart:
142 nightmorph 1.29 </p>
143    
144     <pre caption="Enabling agpgart">
145 nightmorph 1.46 Device Drivers --->
146     Graphics Support --->
147     -*- /dev/agpgart (AGP Support) --->
148 nightmorph 1.29 </pre>
149    
150 diox 1.36 <note>
151     On amd64, the IOMMU controls the agpgart setting.
152     </note>
153    
154 fox2mike 1.25 </body>
155     </section>
156     <section>
157     <title>Arch-specific notes</title>
158     <body>
159    
160     <impo>
161     For x86 and AMD64 processors, the in-kernel driver conflicts with the binary
162     driver provided by nVidia. If you will be compiling your kernel for these CPUs,
163     you must completely remove support for the in-kernel driver as shown:
164     </impo>
165    
166     <pre caption="Remove the in-kernel driver">
167 nightmorph 1.46 Device Drivers --->
168     Graphics Support --->
169     &lt;*&gt; Support for frame buffer devices --->
170 fox2mike 1.25 &lt; &gt; nVidia Framebuffer Support
171     &lt; &gt; nVidia Riva support
172     </pre>
173    
174     <p>
175 nightmorph 1.46 A framebuffer alternative is <c>uvesafb</c>, an <uri
176     link="http://dev.gentoo.org/~spock/projects/uvesafb/">advanced
177     framebuffer</uri>. Note that you can choose to compile it into your kernel, or
178     as a module. The following example compiles uvesafb into the kernel.
179 fox2mike 1.25 </p>
180    
181 nightmorph 1.46 <pre caption="Enable uvesafb support">
182     Device Drivers --->
183     Graphics Support --->
184     &lt;*&gt; Support for frame buffer devices --->
185     &lt;*&gt; Userspace VESA VGA graphics support
186 fox2mike 1.25 </pre>
187    
188 nightmorph 1.46
189 fox2mike 1.25 <p>
190 nightmorph 1.46 Or you can try <c>VESA</c>:
191 fox2mike 1.25 </p>
192    
193 nightmorph 1.46 <pre caption="Enable VESA support">
194     Device Drivers --->
195     Graphics Support --->
196     &lt;*&gt; Support for frame buffer devices --->
197     [*] VESA VGA graphics support
198 fox2mike 1.25 </pre>
199    
200 nightmorph 1.46
201 fox2mike 1.25 <p>
202 nightmorph 1.45 For more information, you can look up the documentation for your chosen
203     framebuffer in <path>/usr/src/linux/Documentation/fb/</path>.
204 fox2mike 1.25 </p>
205    
206     </body>
207     </section>
208     <section>
209     <title>Continuing with Kernel Configuration</title>
210     <body>
211    
212 swift 1.5 <p>
213 nightmorph 1.41 The <c>nvidia-drivers</c> ebuild automatically discovers your kernel version
214     based on the <path>/usr/src/linux</path> symlink. Please ensure that you have
215     this symlink pointing to the correct sources and that your kernel is correctly
216     configured. Please refer to the "Configuring the Kernel" section of the <uri
217     link="/doc/en/handbook/">Installation Handbook</uri> for details on configuring
218     your kernel.
219 neysx 1.13 </p>
220    
221     <p>
222 nightmorph 1.50 First, you'll need to choose the right kernel source using <c>eselect</c>. If
223     you are using <c>gentoo-sources-2.6.34-r1</c>, your kernel listing might look
224 nightmorph 1.41 something like this:
225 neysx 1.13 </p>
226    
227     <pre caption="Check your /usr/src/linux symlink">
228 nightmorph 1.41 # <i>eselect kernel list</i>
229     Available kernel symlink targets:
230 nightmorph 1.50 [1] linux-2.6.34-gentoo-r1 *
231     [2] linux-2.6.33-gentoo-r2
232     [3] linux-2.6.32.9
233 nightmorph 1.41 <comment>(Verify that the right kernel is marked with an asterisk</comment>
234 neysx 1.13 </pre>
235    
236     <p>
237 nightmorph 1.50 In the above output, you'll notice that the <c>linux-2.6.34-gentoo-r1</c> kernel
238 nightmorph 1.41 is marked with an asterisk (<b>*</b>) to show that it is the symlinked kernel.
239 neysx 1.14 </p>
240    
241     <p>
242     If the symlink is not pointing to the correct sources, you must update the link
243 nightmorph 1.41 by selecting the number of your desired kernel sources, as in the example
244     above.
245 neysx 1.13 </p>
246    
247 neysx 1.14 <pre caption="Create/Update /usr/src/linux symlink">
248 nightmorph 1.41 <comment>(Select the correct kernel)</comment>
249     # <i>eselect kernel set 1</i>
250 neysx 1.13 </pre>
251    
252 neysx 1.21 </body>
253     </section>
254     <section>
255     <title>Installing the Appropriate Drivers</title>
256     <body>
257    
258 neysx 1.13 <p>
259 nightmorph 1.50 Now it's time to install the drivers. You can do this by first following the
260     <uri link="/doc/en/xorg-config.xml">X Server Configuration HOWTO</uri> and
261 swift 1.52 setting <c>VIDEO_CARDS="nvidia"</c> in <path>/etc/portage/make.conf</path>. When you
262 nightmorph 1.50 install the X server, it will then install the right version of
263     <c>nvidia-drivers</c> for you.
264 swift 1.1 </p>
265    
266 nightmorph 1.41 <note>
267 nightmorph 1.50 The drivers can be installed with the <c>gtk</c> USE flag set in
268 swift 1.52 <path>/etc/portage/make.conf</path>. This will install
269 nightmorph 1.44 <c>media-video/nvidia-settings</c>, a handy graphical tool for monitoring and
270     configuring several aspects of your nVidia card.
271 nightmorph 1.41 </note>
272    
273 neysx 1.13 <impo>
274 nightmorph 1.41 Every time you <uri link="/doc/en/kernel-upgrade.xml">compile a new kernel</uri>
275 nightmorph 1.50 or recompile the current one, you will need to reinstall the nVidia kernel
276     modules. An easy way to keep track of modules installed by ebuilds (such as
277     <c>nvidia-drivers</c>) is to install <c>sys-kernel/module-rebuild</c>. Once
278     you've installed it, simply run <c>module-rebuild populate</c> to populate its
279     database with a list of packages to be rebuilt. Once you've finished compiling
280     or recompiling a kernel, just run <c>module-rebuild rebuild</c> to rebuild the
281     drivers for your new kernel.
282 neysx 1.13 </impo>
283    
284 swift 1.1 <p>
285     Once the installation has finished, run <c>modprobe nvidia</c> to load the
286 nightmorph 1.31 kernel module into memory. If this is an upgrade, you should remove the
287     previous module first.
288 swift 1.1 </p>
289    
290     <pre caption="Loading the kernel module">
291 nightmorph 1.31 # <i>lsmod | grep nvidia &amp;&amp; rmmod nvidia</i>
292 swift 1.1 # <i>modprobe nvidia</i>
293     </pre>
294    
295     <p>
296 neysx 1.14 To prevent you having to manually load the module on every bootup, you probably
297     want to have this done automatically each time you boot your system, so edit
298 swift 1.51 <path>/etc/conf.d/modules</path> and add <c>nvidia</c> to it.
299 swift 1.1 </p>
300    
301 nightmorph 1.29 <impo>
302     If you compiled <c>agpgart</c> as a module, you will need to add it to
303 swift 1.51 <path>/etc/conf.d/modules</path> as well.
304 nightmorph 1.29 </impo>
305    
306 swift 1.1 </body>
307     </section>
308     <section>
309     <title>Configuring the X Server</title>
310     <body>
311    
312     <p>
313     Once the appropriate drivers are installed you need to configure your X Server
314 nightmorph 1.31 to use the <c>nvidia</c> driver instead of the default <c>nv</c> driver.
315 swift 1.1 </p>
316    
317     <p>
318 nightmorph 1.33 Open <path>/etc/X11/xorg.conf</path> with your favorite editor (such as
319     <c>nano</c> or <c>vim</c>) and go to the <c>Device</c> section. In that
320 neysx 1.14 section, change the <c>Driver</c> line:
321 swift 1.1 </p>
322    
323     <pre caption="Changing nv to nvidia in the X Server configuration">
324     Section "Device"
325     Identifier "nVidia Inc. GeForce2"
326     <i>Driver "nvidia"</i>
327     VideoRam 65536
328     EndSection
329     </pre>
330    
331     <p>
332 swift 1.4 Then go to the <c>Module</c> section and make sure the <c>glx</c> module gets
333     loaded while the <c>dri</c> module doesn't:
334     </p>
335    
336     <pre caption="Updating the Module section">
337     Section "Module"
338     <comment>(...)</comment>
339     <i># Load "dri"
340     Load "glx"</i>
341     <comment>(...)</comment>
342     EndSection
343     </pre>
344    
345     <p>
346 swift 1.12 Next, in section <c>Screen</c>, make sure that either the <c>DefaultDepth</c>
347 neysx 1.21 directive is set to 16 or 24, or that you only have <c>Display</c> subsections
348 nightmorph 1.33 with <c>Depth</c> settings of 16 or 24. Without it, the nVidia GLX extensions
349 swift 1.12 will not start.
350     </p>
351    
352     <pre caption="Updating the Screen section">
353     Section "Screen"
354     <comment>(...)</comment>
355     <i>DefaultDepth 16</i>
356     Subsection "Display"
357     <comment>(...)</comment>
358     EndSection
359     </pre>
360    
361     <p>
362 nightmorph 1.28 Run <c>eselect</c> so that the X Server uses the nVidia GLX libraries:
363 swift 1.1 </p>
364    
365 nightmorph 1.28 <pre caption="Running eselect">
366     # <i>eselect opengl set nvidia</i>
367 swift 1.1 </pre>
368    
369     </body>
370     </section>
371     <section>
372 swift 1.10 <title>Adding your Users to the video Group</title>
373     <body>
374    
375     <p>
376     You have to add your user to the <c>video</c> group so he has access to the
377 nightmorph 1.41 nVidia device files:
378 swift 1.10 </p>
379    
380     <pre caption="Adding your user to the video group">
381     # <i>gpasswd -a youruser video</i>
382     </pre>
383    
384     <p>
385 fox2mike 1.16 This might not be totally necessary if you aren't using <c>udev</c> but it
386 nightmorph 1.33 doesn't hurt either and makes your system future-proof.
387 swift 1.10 </p>
388    
389     </body>
390     </section>
391     <section>
392 swift 1.1 <title>Testing your Card</title>
393     <body>
394    
395     <p>
396 nightmorph 1.39 To test your nVidia card, fire up X and run <c>glxinfo</c>, which is part of the
397     <c>mesa-progs</c> package. It should say that direct rendering is activated:
398 swift 1.1 </p>
399    
400     <pre caption="Checking the direct rendering status">
401     $ <i>glxinfo | grep direct</i>
402     direct rendering: Yes
403     </pre>
404    
405     <p>
406 neysx 1.21 To monitor your FPS, run <c>glxgears</c>.
407 swift 1.1 </p>
408    
409     </body>
410     </section>
411 swift 1.11 <section>
412     <title>Enabling nvidia Support</title>
413     <body>
414    
415     <p>
416     Some tools, such as <c>mplayer</c> and <c>xine-lib</c>, use a local USE flag
417 nightmorph 1.41 called <c>xvmc</c> which enables XvMCNVIDIA support, useful when watching high
418     resolution movies. Add in <c>xvmc</c> in your USE variable in
419 swift 1.52 <path>/etc/portage/make.conf</path> or add it as USE flag to <c>media-video/mplayer</c>
420 swift 1.11 and/or <c>media-libs/xine-lib</c> in <path>/etc/portage/package.use</path>.
421     </p>
422    
423     <p>
424 nightmorph 1.41 There are also some applications that use the <c>nvidia</c> USE flag, so you
425 swift 1.52 may want to add it to <path>/etc/portage/make.conf</path>.
426 nightmorph 1.41 </p>
427    
428     <p>
429 swift 1.11 Then, run <c>emerge -uD --newuse world</c> to rebuild the applications that
430     benefit from the USE flag change.
431     </p>
432    
433     </body>
434     </section>
435 swift 1.19 <section>
436     <title>Using NVidia Settings Tool</title>
437     <body>
438    
439     <p>
440 nightmorph 1.41 nVidia also provides you with a settings tool. This tool allows you to monitor
441     and change graphical settings without restarting the X server and is available
442     through Portage as <c>media-video/nvidia-settings</c>. As mentioned earlier, it
443 nightmorph 1.44 will be pulled in automatically if you install the drivers with the <c>gtk</c>
444 swift 1.52 USE flag set in <path>/etc/portage/make.conf</path> or in
445 nightmorph 1.44 <path>/etc/portage/package.use</path>.
446 swift 1.19 </p>
447    
448     </body>
449     </section>
450 swift 1.1 </chapter>
451 swift 1.6
452     <chapter>
453     <title>Troubleshooting</title>
454     <section>
455     <title>Getting 2D to work on machines with 4Gb or more memory</title>
456     <body>
457    
458     <p>
459 nightmorph 1.31 If you are having troubles with the nVidia 2D acceleration it is likely that
460     you are unable to set up a write-combining range with MTRR. To verify, check
461     the contents of <path>/proc/mtrr</path>:
462 swift 1.6 </p>
463    
464     <pre caption="Checking if you have write-combining enabled">
465     # <i>cat /proc/mtrr</i>
466     </pre>
467    
468     <p>
469     Every line should contain "write-back" or "write-combining". If you see a line
470     with "uncachable" in it you will need to change a BIOS setting to fix this.
471     </p>
472    
473     <p>
474     Reboot and enter the BIOS, then find the MTRR settings (probably under "CPU
475     Settings"). Change the setting from "continuous" to "discrete" and boot back
476     into Linux. You will now find out that there is no "uncachable" entry anymore
477     and 2D acceleration now works without any glitches.
478     </p>
479    
480     </body>
481     </section>
482 swift 1.7 <section>
483 swift 1.20 <title>
484     When I attempt to load the kernel module I receive a "no such device"
485     </title>
486     <body>
487    
488     <p>
489     This usually occurs when you don't have a matching video card. Make sure that
490     you have an nVidia-powered graphical card (you can double-check this using
491     <c>lspci</c>).
492     </p>
493    
494     <p>
495     If you are confident that you have an nVidia card, check your BIOS and see if
496     the directive <e>Assign IRQ to VGA</e> is set.
497     </p>
498    
499     </body>
500     </section>
501 swift 1.6 </chapter>
502    
503 neysx 1.14 <chapter>
504     <title>Expert Configuration</title>
505     <section>
506     <title>Documentation</title>
507     <body>
508    
509     <p>
510     The nVidia driver package also comes with comprehensive documentation. This is
511     installed into <c>/usr/share/doc</c> and can be viewed with the following
512     command:
513     </p>
514    
515     <pre caption="Viewing the NVIDIA documentation">
516 nightmorph 1.31 $ <i>less /usr/share/doc/nvidia-drivers-*/README.gz</i>
517 neysx 1.14 </pre>
518    
519     </body>
520     </section>
521     <section>
522     <title>Kernel module parameters</title>
523     <body>
524    
525     <p>
526     The <c>nvidia</c> kernel module accepts a number of parameters (options) which
527     you can use to tweak the behaviour of the driver. Most of these are mentioned in
528     the documentation. To add or change the values of these parameters, edit the
529 nightmorph 1.48 file <c>/etc/modprobe.d/nvidia.conf</c>. Remember to run <c>update-modules</c> after
530 neysx 1.14 modifying this file, and bear in mind that you will need to reload the
531     <c>nvidia</c> module before the new settings take effect.
532     </p>
533    
534 jkt 1.17 <pre caption="Adjusting nvidia options">
535 nightmorph 1.48 <comment>(Edit /etc/modprobe.d/nvidia.conf in your favourite editor)</comment>
536     # <i>nano -w /etc/modprobe.d/nvidia.conf</i>
537 jkt 1.17 <comment>(Update module information)</comment>
538 nightmorph 1.40 # <i>update-modules</i>
539 jkt 1.17 <comment>(Unload the nvidia module...)</comment>
540     # <i>modprobe -r nvidia</i>
541     <comment>(...and load it once again)</comment>
542     # <i>modprobe nvidia</i>
543     </pre>
544    
545 neysx 1.14 </body>
546     </section>
547     <section>
548     <title>Advanced X configuration</title>
549     <body>
550    
551     <p>
552     The GLX layer also has a plethora of options which can be configured. These
553     control the configuration of TV out, dual displays, monitor frequency detection,
554     etc. Again, all of the available options are detailed in the documentation.
555     </p>
556    
557     <p>
558     If you wish to use any of these options, you need to list them in the relevant
559     Device section of your X config file (usually <c>/etc/X11/xorg.conf</c>). For
560     example, suppose I wanted to disable the splash logo:
561     </p>
562    
563     <pre caption="Advanced nvidia configuration in the X configuration">
564     Section "Device"
565     Identifier "nVidia Inc. GeForce2"
566     Driver "nvidia"
567     <i>Option "NoLogo" "true"</i>
568     VideoRam 65536
569     EndSection
570     </pre>
571    
572     </body>
573     </section>
574     </chapter>
575 swift 1.1 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20