/[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.42 - (hide annotations) (download) (as text)
Tue Jul 31 21:07:35 2007 UTC (6 years, 8 months ago) by nightmorph
Branch: MAIN
Changes since 1.41: +8 -29 lines
File MIME type: application/xml
removed stuff about legacy-drivers and nvidia-glx, as cardoe has kicked the first out of portage and the second has been gone more than a year

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

  ViewVC Help
Powered by ViewVC 1.1.20