/[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.51 - (show annotations) (download) (as text)
Sun Sep 11 08:43:18 2011 UTC (3 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.50: +5 -10 lines
File MIME type: application/xml
Fix bug #382457 - Update all references to outdated /etc/modules.autoload.d

1 <?xml version='1.0' encoding="UTF-8"?>
2 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/nvidia-guide.xml,v 1.50 2010/07/13 19:55:51 nightmorph Exp $ -->
3 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4
5 <guide>
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>2</version>
32 <date>2011-09-11</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 400, 300, 200, 100, 9, 8, 7, and 6 series should
73 use the latest drivers.
74 </p>
75
76 <p>
77 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 For these cards, you should mask <c>>=x11-drivers/nvidia-drivers-97.00</c> in
87 your <path>/etc/portage/package.mask</path> file.
88 </p>
89
90 <p>
91 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 </p>
96
97 <p>
98 You can check for driver compatibility for your card at to determine which
99 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 </p>
102
103 </body>
104 </section>
105 </chapter>
106
107 <chapter>
108 <title>Configuring your Card</title>
109 <section>
110 <title>Kernel Configuration</title>
111 <body>
112
113 <p>
114 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 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 kernel configuration so that this support is enabled:
119 </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 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 <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 </p>
143
144 <pre caption="Enabling agpgart">
145 Device Drivers --->
146 Graphics Support --->
147 -*- /dev/agpgart (AGP Support) --->
148 </pre>
149
150 <note>
151 On amd64, the IOMMU controls the agpgart setting.
152 </note>
153
154 </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 Device Drivers --->
168 Graphics Support --->
169 &lt;*&gt; Support for frame buffer devices --->
170 &lt; &gt; nVidia Framebuffer Support
171 &lt; &gt; nVidia Riva support
172 </pre>
173
174 <p>
175 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 </p>
180
181 <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 </pre>
187
188
189 <p>
190 Or you can try <c>VESA</c>:
191 </p>
192
193 <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 </pre>
199
200
201 <p>
202 For more information, you can look up the documentation for your chosen
203 framebuffer in <path>/usr/src/linux/Documentation/fb/</path>.
204 </p>
205
206 </body>
207 </section>
208 <section>
209 <title>Continuing with Kernel Configuration</title>
210 <body>
211
212 <p>
213 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 </p>
220
221 <p>
222 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 something like this:
225 </p>
226
227 <pre caption="Check your /usr/src/linux symlink">
228 # <i>eselect kernel list</i>
229 Available kernel symlink targets:
230 [1] linux-2.6.34-gentoo-r1 *
231 [2] linux-2.6.33-gentoo-r2
232 [3] linux-2.6.32.9
233 <comment>(Verify that the right kernel is marked with an asterisk</comment>
234 </pre>
235
236 <p>
237 In the above output, you'll notice that the <c>linux-2.6.34-gentoo-r1</c> kernel
238 is marked with an asterisk (<b>*</b>) to show that it is the symlinked kernel.
239 </p>
240
241 <p>
242 If the symlink is not pointing to the correct sources, you must update the link
243 by selecting the number of your desired kernel sources, as in the example
244 above.
245 </p>
246
247 <pre caption="Create/Update /usr/src/linux symlink">
248 <comment>(Select the correct kernel)</comment>
249 # <i>eselect kernel set 1</i>
250 </pre>
251
252 </body>
253 </section>
254 <section>
255 <title>Installing the Appropriate Drivers</title>
256 <body>
257
258 <p>
259 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 setting <c>VIDEO_CARDS="nvidia"</c> in <path>/etc/make.conf</path>. When you
262 install the X server, it will then install the right version of
263 <c>nvidia-drivers</c> for you.
264 </p>
265
266 <note>
267 The drivers can be installed with the <c>gtk</c> USE flag set in
268 <path>/etc/make.conf</path>. This will install
269 <c>media-video/nvidia-settings</c>, a handy graphical tool for monitoring and
270 configuring several aspects of your nVidia card.
271 </note>
272
273 <impo>
274 Every time you <uri link="/doc/en/kernel-upgrade.xml">compile a new kernel</uri>
275 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 </impo>
283
284 <p>
285 Once the installation has finished, run <c>modprobe nvidia</c> to load the
286 kernel module into memory. If this is an upgrade, you should remove the
287 previous module first.
288 </p>
289
290 <pre caption="Loading the kernel module">
291 # <i>lsmod | grep nvidia &amp;&amp; rmmod nvidia</i>
292 # <i>modprobe nvidia</i>
293 </pre>
294
295 <p>
296 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 <path>/etc/conf.d/modules</path> and add <c>nvidia</c> to it.
299 </p>
300
301 <impo>
302 If you compiled <c>agpgart</c> as a module, you will need to add it to
303 <path>/etc/conf.d/modules</path> as well.
304 </impo>
305
306 </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 to use the <c>nvidia</c> driver instead of the default <c>nv</c> driver.
315 </p>
316
317 <p>
318 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 section, change the <c>Driver</c> line:
321 </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 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 Next, in section <c>Screen</c>, make sure that either the <c>DefaultDepth</c>
347 directive is set to 16 or 24, or that you only have <c>Display</c> subsections
348 with <c>Depth</c> settings of 16 or 24. Without it, the nVidia GLX extensions
349 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 Run <c>eselect</c> so that the X Server uses the nVidia GLX libraries:
363 </p>
364
365 <pre caption="Running eselect">
366 # <i>eselect opengl set nvidia</i>
367 </pre>
368
369 </body>
370 </section>
371 <section>
372 <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 nVidia device files:
378 </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 This might not be totally necessary if you aren't using <c>udev</c> but it
386 doesn't hurt either and makes your system future-proof.
387 </p>
388
389 </body>
390 </section>
391 <section>
392 <title>Testing your Card</title>
393 <body>
394
395 <p>
396 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 </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 To monitor your FPS, run <c>glxgears</c>.
407 </p>
408
409 </body>
410 </section>
411 <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 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 <path>/etc/make.conf</path> or add it as USE flag to <c>media-video/mplayer</c>
420 and/or <c>media-libs/xine-lib</c> in <path>/etc/portage/package.use</path>.
421 </p>
422
423 <p>
424 There are also some applications that use the <c>nvidia</c> USE flag, so you
425 may want to add it to <path>/etc/make.conf</path>.
426 </p>
427
428 <p>
429 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 <section>
436 <title>Using NVidia Settings Tool</title>
437 <body>
438
439 <p>
440 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 will be pulled in automatically if you install the drivers with the <c>gtk</c>
444 USE flag set in <path>/etc/make.conf</path> or in
445 <path>/etc/portage/package.use</path>.
446 </p>
447
448 </body>
449 </section>
450 </chapter>
451
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 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 </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 <section>
483 <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 </chapter>
502
503 <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 $ <i>less /usr/share/doc/nvidia-drivers-*/README.gz</i>
517 </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 file <c>/etc/modprobe.d/nvidia.conf</c>. Remember to run <c>update-modules</c> after
530 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 <pre caption="Adjusting nvidia options">
535 <comment>(Edit /etc/modprobe.d/nvidia.conf in your favourite editor)</comment>
536 # <i>nano -w /etc/modprobe.d/nvidia.conf</i>
537 <comment>(Update module information)</comment>
538 # <i>update-modules</i>
539 <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 </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 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20