/[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.46 - (show annotations) (download) (as text)
Sun Sep 14 05:12:23 2008 UTC (6 years, 1 month ago) by nightmorph
Branch: MAIN
Changes since 1.45: +26 -21 lines
File MIME type: application/xml
updated kernel options, bug 237585

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

  ViewVC Help
Powered by ViewVC 1.1.20