/[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.40 - (show annotations) (download) (as text)
Mon Apr 16 05:39:54 2007 UTC (7 years, 4 months ago) by nightmorph
Branch: MAIN
Changes since 1.39: +8 -8 lines
File MIME type: application/xml
changed modules-update command to update-modules, per the runtime warning about modules-update being deprecated. weird. seems update-modules used to be the name anyway years ago, see lpi 101 part 2.

1 <?xml version='1.0' encoding="UTF-8"?>
2 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/nvidia-guide.xml,v 1.39 2007/03/24 01:04:16 nightmorph Exp $ -->
3 <!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 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
10 </author>
11 <author title="Editor">
12 <mail link="curtis119@gentoo.org">M Curtis Napier</mail>
13 </author>
14 <author title="Editor">
15 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
16 </author>
17 <author title="Editor">
18 <mail link="wolf31o2@gentoo.org">Chris Gianelloni</mail>
19 </author>
20
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 <!-- The content of this document is licensed under the CC-BY-SA license -->
28 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
29 <license/>
30
31 <version>1.31</version>
32 <date>2007-04-15</date>
33
34 <chapter>
35 <title>Introduction</title>
36 <section>
37 <body>
38
39 <p>
40 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 install the drivers. Currently, there are two driver packages in the tree. The
46 first, <c>nvidia-drivers</c>, is the latest drivers from nVidia and includes
47 support for the latest cards. The second, <c>nvidia-legacy-drivers</c>, supports
48 older cards, from the original TNT through the GeForce 6800. However, this
49 driver does not support the latest features of the newer cards. You should only
50 use <c>nvidia-legacy-drivers</c> if your cards is not supported in the
51 <c>nvidia-drivers</c> package.
52 </p>
53
54 <note>
55 Previously, Gentoo provided separate ebuilds for the nVidia kernel module
56 (<c>nvidia-kernel</c>) and the X11 GLX libraries (<c>nvidia-glx</c>). These
57 ebuilds have since been removed from the Portage tree in favor of
58 <c>nvidia-drivers</c> and <c>nvidia-legacy-drivers</c>. If you use
59 <c>nvidia-kernel</c> and <c>nvidia-glx</c>, then you should migrate to the
60 newer packages.
61 </note>
62
63 </body>
64 </section>
65 </chapter>
66
67 <chapter>
68 <title>Driver compatibility</title>
69 <section>
70 <title>nvidia-legacy-drivers</title>
71 <body>
72
73 <p>
74 The <c>nvidia-legacy-drivers</c> branch supports older nVidia cards which are no
75 longer supported in the latest driver releases. This branch is based on an older
76 code base of the nVidia drivers, and supports the latest kernels and X.Org
77 versions. You should use this driver if you have a TNT, TNT2, GeForce, or
78 GeForce 2 series card. The driver compatibility information can be found in
79 Appendix A of
80 <uri>http://download.nvidia.com/XFree86/Linux-x86/1.0-7184/README/readme.txt</uri>.
81 </p>
82
83 </body>
84 </section>
85 <section>
86 <title>nvidia-drivers</title>
87 <body>
88
89 <p>
90 The <c>nvidia-drivers</c> branch supports the features in newer nVidia cards.
91 The latest version of these drivers has dropped support for the NV2x based
92 cards. If you have a GeForce 3 or GeForce 4 series card, you should mask
93 <c>>=x11-drivers/nvidia-drivers-1.0.9700</c> in your
94 <path>/etc/portage/package.mask</path> file. This will prevent newer versions of
95 the driver which are incompatible with your card from being installed. You can
96 check for driver compatibility for your card at to determine if it is supported
97 on the newer drivers at
98 <uri>http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9746/README/appendix-a.html</uri>.
99 </p>
100
101 </body>
102 </section>
103 </chapter>
104
105 <chapter>
106 <title>Configuring your Card</title>
107 <section>
108 <title>Kernel Configuration</title>
109 <body>
110
111 <p>
112 As mentioned above, the nVidia kernel driver installs and runs against your
113 current kernel. It builds as a module, so it makes sense that your kernel must
114 support the loading of kernel modules. If you used <c>genkernel all</c> to
115 configure the kernel for you, then you're all set. If not, double check your
116 kernel configuration so that this support is enabled:
117 </p>
118
119 <pre caption="Enabling the Loading of Kernel Modules">
120 Loadable module support ---&gt;
121 [*] Enable loadable module support
122 </pre>
123
124 <p>
125 You also need to enable <e>Memory Type Range Register</e> in your kernel:
126 </p>
127
128 <pre caption="Enabling MTRR">
129 Processor and Features ---&gt;
130 [*] MTRR (Memory Type Range Register) support
131 </pre>
132
133 <p> Also, if you have an AGP graphics card, you can optionally enable
134 <c>agpgart</c> support to your kernel, either compiled in or as a module. If
135 you do not use the in-kernel agpgart, then the drivers will use their own
136 <c>agpgart</c> implementation, called <c>NvAGP</c>. On certain systems, this
137 performs better than the in-kernel agpgart, and on others, it performs worse.
138 You will need to evaluate this on your own system to get the best performance.
139 If you are unsure what to do, use the in-kernel agpgart:
140 </p>
141
142 <pre caption="Enabling agpgart">
143 Device Drivers ---&gt;
144 Character devices ---&gt;
145 &lt;*&gt; /dev/agpgart (AGP Support)
146 </pre>
147
148 <note>
149 On amd64, the IOMMU controls the agpgart setting.
150 </note>
151
152 </body>
153 </section>
154 <section>
155 <title>Arch-specific notes</title>
156 <body>
157
158 <impo>
159 For x86 and AMD64 processors, the in-kernel driver conflicts with the binary
160 driver provided by nVidia. If you will be compiling your kernel for these CPUs,
161 you must completely remove support for the in-kernel driver as shown:
162 </impo>
163
164 <pre caption="Remove the in-kernel driver">
165 Device Drivers ---&gt;
166 Graphics Support ---&gt;
167 &lt; &gt; nVidia Framebuffer Support
168 &lt; &gt; nVidia Riva support
169 </pre>
170
171 <p>
172 A good framebuffer alternative is <c>VESA</c>:
173 </p>
174
175 <pre caption="Enable VESA support">
176 Device Drivers ---&gt;
177 Graphics Support ---&gt;
178 &lt;*&gt; VESA VGA graphics support
179 </pre>
180
181 <p>
182 Then, under "VESA driver type" select either <c>vesafb</c> or
183 <c>vesafb-tng</c>. If you are using an AMD64 processor, you should select
184 <c>vesafb</c> rather than <c>vesafb-tng</c>:
185 </p>
186
187 <pre caption="Select framebuffer type">
188 (X) vesafb
189 ( ) vesafb-tng
190 </pre>
191
192 <p>
193 For more information, you can read up
194 <path>/usr/src/linux/Documentation/fb/vesafb.txt</path> if you are using
195 <c>vesafb</c> or look for your framebuffer documentation under
196 <path>/usr/src/linux/Documentation/fb/</path>.
197 </p>
198
199 </body>
200 </section>
201 <section>
202 <title>Continuing with Kernel Configuration</title>
203 <body>
204
205 <p>
206 The <c>nvidia-drivers</c> and <c>nvidia-legacy-drivers</c> ebuilds automatically
207 discover your kernel version based on the <path>/usr/src/linux</path> symlink.
208 Please ensure that you have this symlink pointing to the correct sources and
209 that your kernel is correctly configured. Please refer to the "Configuring the
210 Kernel" section of the <uri link="/doc/en/handbook/">Installation Handbook</uri>
211 for details on configuring your kernel.
212 </p>
213
214 <p>
215 If you are using gentoo-sources-2.6.11-r6, your <path>/usr/src</path> directory
216 might look something like this:
217 </p>
218
219 <pre caption="Check your /usr/src/linux symlink">
220 # <i>cd /usr/src</i>
221 # <i>ls -l</i>
222 <comment>(Check that linux points to the right directory)</comment>
223 lrwxrwxrwx 1 root root 22 Apr 23 18:33 linux -&gt; linux-2.6.11-gentoo-r6
224 drwxr-xr-x 4 root root 120 Apr 8 18:56 linux-2.4.26-gentoo-r4
225 drwxr-xr-x 18 root root 664 Dec 31 16:09 linux-2.6.10
226 drwxr-xr-x 18 root root 632 Mar 3 12:27 linux-2.6.11
227 drwxr-xr-x 19 root root 4096 Mar 16 22:00 linux-2.6.11-gentoo-r6
228 </pre>
229
230 <p>
231 In the above output, you'll notice that the <c>linux</c> symlink is pointing
232 to the <c>linux-2.6.11-gentoo-r6</c> kernel.
233 </p>
234
235 <p>
236 If the symlink is not pointing to the correct sources, you must update the link
237 like this:
238 </p>
239
240 <pre caption="Create/Update /usr/src/linux symlink">
241 # <i>cd /usr/src</i>
242 # <i>ln -snf linux-2.6.11-gentoo-r6 linux</i>
243 </pre>
244
245 </body>
246 </section>
247 <section>
248 <title>Optional: Check for Legacy Card Support</title>
249 <body>
250
251 <note>
252 Unfortunately, certain legacy video cards are not supported by the newer
253 versions of <c>nvidia-drivers</c>.
254 nVidia provides a <uri link="http://www.nvidia.com/object/IO_18897.html">list
255 of supported cards</uri>. Please check the list before installing the drivers.
256 </note>
257
258 <p>
259 The following is a list of <b>unsupported</b> legacy video cards:
260 </p>
261
262 <pre caption="Unsupported cards">
263 TNT
264 TNT2
265 TNT2 Pro
266 TNT2 Ultra
267 TNT2 Model 64 (M64)
268 TNT2 Model 64 (M64) Pro
269 Vanta
270 Vanta LT
271 GeForce 256
272 GeForce DDR
273 GeForce2 GTS
274 GeForce2 Pro
275 GeForce2 Ti
276 GeForce2 Ultra
277 GeForce2 MX Integrated graphics
278 Quadro
279 Quadro2 Pro
280 Quadro2 EX
281 </pre>
282
283 <p>
284 If your card is listed in the legacy list, then you will be required to install
285 the <c>nvidia-legacy-drivers</c> package to get 3D support.
286 </p>
287
288 </body>
289 </section>
290 <section>
291 <title>Installing the Appropriate Drivers</title>
292 <body>
293
294 <p>
295 Now it's time to install the drivers.
296 </p>
297
298 <pre caption="Installing the nVidia drivers">
299 <comment>(If you have a card not listed in the legacy list above)</comment>
300 # <i>emerge nvidia-drivers</i>
301 <comment>(If your card is listed in the legacy list)</comment>
302 # <i>emerge nvidia-legacy-drivers</i>
303 </pre>
304
305 <impo>
306 Every time you <uri link="/doc/en/kernel-upgrade.xml">compile a new
307 kernel</uri> or recompile the current one, you will need to run <c>emerge
308 nvidia-drivers</c> or <c>emerge nvidia-legacy-drivers</c> to reinstall the
309 nVidia modules.
310 </impo>
311
312 <p>
313 Once the installation has finished, run <c>modprobe nvidia</c> to load the
314 kernel module into memory. If this is an upgrade, you should remove the
315 previous module first.
316 </p>
317
318 <pre caption="Loading the kernel module">
319 # <i>lsmod | grep nvidia &amp;&amp; rmmod nvidia</i>
320 # <i>modprobe nvidia</i>
321 </pre>
322
323 <p>
324 To prevent you having to manually load the module on every bootup, you probably
325 want to have this done automatically each time you boot your system, so edit
326 <path>/etc/modules.autoload.d/kernel-2.6</path> (or <path>kernel-2.4</path>,
327 depending on which kernel version you use) and add <c>nvidia</c> to it. Don't
328 forget to run <c>update-modules</c> afterwards.
329 </p>
330
331 <impo>
332 If you compiled <c>agpgart</c> as a module, you will need to add it to
333 <path>/etc/modules.autoload.d/kernel-2.6</path> (or <path>kernel-2.4</path>
334 depending on your kernel version).
335 </impo>
336
337 <pre caption="Running update-modules">
338 # <i>update-modules</i>
339 </pre>
340
341 </body>
342 </section>
343 <section>
344 <title>Configuring the X Server</title>
345 <body>
346
347 <p>
348 Once the appropriate drivers are installed you need to configure your X Server
349 to use the <c>nvidia</c> driver instead of the default <c>nv</c> driver.
350 </p>
351
352 <p>
353 Open <path>/etc/X11/xorg.conf</path> with your favorite editor (such as
354 <c>nano</c> or <c>vim</c>) and go to the <c>Device</c> section. In that
355 section, change the <c>Driver</c> line:
356 </p>
357
358 <pre caption="Changing nv to nvidia in the X Server configuration">
359 Section "Device"
360 Identifier "nVidia Inc. GeForce2"
361 <i>Driver "nvidia"</i>
362 VideoRam 65536
363 EndSection
364 </pre>
365
366 <p>
367 Then go to the <c>Module</c> section and make sure the <c>glx</c> module gets
368 loaded while the <c>dri</c> module doesn't:
369 </p>
370
371 <pre caption="Updating the Module section">
372 Section "Module"
373 <comment>(...)</comment>
374 <i># Load "dri"
375 Load "glx"</i>
376 <comment>(...)</comment>
377 EndSection
378 </pre>
379
380 <p>
381 Next, in section <c>Screen</c>, make sure that either the <c>DefaultDepth</c>
382 directive is set to 16 or 24, or that you only have <c>Display</c> subsections
383 with <c>Depth</c> settings of 16 or 24. Without it, the nVidia GLX extensions
384 will not start.
385 </p>
386
387 <pre caption="Updating the Screen section">
388 Section "Screen"
389 <comment>(...)</comment>
390 <i>DefaultDepth 16</i>
391 Subsection "Display"
392 <comment>(...)</comment>
393 EndSection
394 </pre>
395
396 <p>
397 Run <c>eselect</c> so that the X Server uses the nVidia GLX libraries:
398 </p>
399
400 <pre caption="Running eselect">
401 # <i>eselect opengl set nvidia</i>
402 </pre>
403
404 </body>
405 </section>
406 <section>
407 <title>Adding your Users to the video Group</title>
408 <body>
409
410 <p>
411 You have to add your user to the <c>video</c> group so he has access to the
412 nvidia device files:
413 </p>
414
415 <pre caption="Adding your user to the video group">
416 # <i>gpasswd -a youruser video</i>
417 </pre>
418
419 <p>
420 This might not be totally necessary if you aren't using <c>udev</c> but it
421 doesn't hurt either and makes your system future-proof.
422 </p>
423
424 </body>
425 </section>
426 <section>
427 <title>Testing your Card</title>
428 <body>
429
430 <p>
431 To test your nVidia card, fire up X and run <c>glxinfo</c>, which is part of the
432 <c>mesa-progs</c> package. It should say that direct rendering is activated:
433 </p>
434
435 <pre caption="Checking the direct rendering status">
436 $ <i>glxinfo | grep direct</i>
437 direct rendering: Yes
438 </pre>
439
440 <p>
441 To monitor your FPS, run <c>glxgears</c>.
442 </p>
443
444 </body>
445 </section>
446 <section>
447 <title>Enabling nvidia Support</title>
448 <body>
449
450 <p>
451 Some tools, such as <c>mplayer</c> and <c>xine-lib</c>, use a local USE flag
452 called "nvidia" which enables XvMCNVIDIA support, useful when watching high
453 resolution movies. Add in "nvidia" in your USE variable in
454 <path>/etc/make.conf</path> or add it as USE flag to <c>media-video/mplayer</c>
455 and/or <c>media-libs/xine-lib</c> in <path>/etc/portage/package.use</path>.
456 </p>
457
458 <p>
459 Then, run <c>emerge -uD --newuse world</c> to rebuild the applications that
460 benefit from the USE flag change.
461 </p>
462
463 </body>
464 </section>
465 <section>
466 <title>Using NVidia Settings Tool</title>
467 <body>
468
469 <p>
470 Since nVidia released version 1.0.6106 it also provides you with a settings
471 tool. This tool allows you to change graphical settings without restarting the
472 X server and is available through Portage as
473 <c>media-video/nvidia-settings</c>.
474 </p>
475
476 </body>
477 </section>
478 </chapter>
479
480 <chapter>
481 <title>Troubleshooting</title>
482 <section>
483 <title>Getting 2D to work on machines with 4Gb or more memory</title>
484 <body>
485
486 <p>
487 If you are having troubles with the nVidia 2D acceleration it is likely that
488 you are unable to set up a write-combining range with MTRR. To verify, check
489 the contents of <path>/proc/mtrr</path>:
490 </p>
491
492 <pre caption="Checking if you have write-combining enabled">
493 # <i>cat /proc/mtrr</i>
494 </pre>
495
496 <p>
497 Every line should contain "write-back" or "write-combining". If you see a line
498 with "uncachable" in it you will need to change a BIOS setting to fix this.
499 </p>
500
501 <p>
502 Reboot and enter the BIOS, then find the MTRR settings (probably under "CPU
503 Settings"). Change the setting from "continuous" to "discrete" and boot back
504 into Linux. You will now find out that there is no "uncachable" entry anymore
505 and 2D acceleration now works without any glitches.
506 </p>
507
508 </body>
509 </section>
510 <section>
511 <title>
512 When I attempt to load the kernel module I receive a "no such device"
513 </title>
514 <body>
515
516 <p>
517 This usually occurs when you don't have a matching video card. Make sure that
518 you have an nVidia-powered graphical card (you can double-check this using
519 <c>lspci</c>).
520 </p>
521
522 <p>
523 If you are confident that you have an nVidia card, check your BIOS and see if
524 the directive <e>Assign IRQ to VGA</e> is set.
525 </p>
526
527 </body>
528 </section>
529 </chapter>
530
531 <chapter>
532 <title>Expert Configuration</title>
533 <section>
534 <title>Documentation</title>
535 <body>
536
537 <p>
538 The nVidia driver package also comes with comprehensive documentation. This is
539 installed into <c>/usr/share/doc</c> and can be viewed with the following
540 command:
541 </p>
542
543 <pre caption="Viewing the NVIDIA documentation">
544 <comment>(for nvidia-drivers)</comment>
545 $ <i>less /usr/share/doc/nvidia-drivers-*/README.gz</i>
546 <comment>(for nvidia-legacy-drivers)</comment>
547 $ <i>less /usr/share/doc/nvidia-legacy-drivers-*/README.gz</i>
548 </pre>
549
550 </body>
551 </section>
552 <section>
553 <title>Kernel module parameters</title>
554 <body>
555
556 <p>
557 The <c>nvidia</c> kernel module accepts a number of parameters (options) which
558 you can use to tweak the behaviour of the driver. Most of these are mentioned in
559 the documentation. To add or change the values of these parameters, edit the
560 file <c>/etc/modules.d/nvidia</c>. Remember to run <c>update-modules</c> after
561 modifying this file, and bear in mind that you will need to reload the
562 <c>nvidia</c> module before the new settings take effect.
563 </p>
564
565 <pre caption="Adjusting nvidia options">
566 <comment>(Edit /etc/modules.d/nvidia in your favourite editor)</comment>
567 # <i>nano -w /etc/modules.d/nvidia</i>
568 <comment>(Update module information)</comment>
569 # <i>update-modules</i>
570 <comment>(Unload the nvidia module...)</comment>
571 # <i>modprobe -r nvidia</i>
572 <comment>(...and load it once again)</comment>
573 # <i>modprobe nvidia</i>
574 </pre>
575
576 </body>
577 </section>
578 <section>
579 <title>Advanced X configuration</title>
580 <body>
581
582 <p>
583 The GLX layer also has a plethora of options which can be configured. These
584 control the configuration of TV out, dual displays, monitor frequency detection,
585 etc. Again, all of the available options are detailed in the documentation.
586 </p>
587
588 <p>
589 If you wish to use any of these options, you need to list them in the relevant
590 Device section of your X config file (usually <c>/etc/X11/xorg.conf</c>). For
591 example, suppose I wanted to disable the splash logo:
592 </p>
593
594 <pre caption="Advanced nvidia configuration in the X configuration">
595 Section "Device"
596 Identifier "nVidia Inc. GeForce2"
597 Driver "nvidia"
598 <i>Option "NoLogo" "true"</i>
599 VideoRam 65536
600 EndSection
601 </pre>
602
603 </body>
604 </section>
605 </chapter>
606
607 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20