| 1 |
<?xml version='1.0' encoding="UTF-8"?> |
| 2 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/nvidia-guide.xml,v 1.15 2005/07/06 08:05:09 fox2mike 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 |
|
| 15 |
<abstract> |
| 16 |
Many Gentooists have an nVidia chipset on their system. nVidia provides specific |
| 17 |
Linux drivers to boost the performance of your card. This guide informs you how |
| 18 |
to install and configure these drivers. |
| 19 |
</abstract> |
| 20 |
|
| 21 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
| 22 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 23 |
<license/> |
| 24 |
|
| 25 |
<version>1.12</version> |
| 26 |
<date>2005-07-15</date> |
| 27 |
|
| 28 |
<chapter> |
| 29 |
<title>Introduction</title> |
| 30 |
<section> |
| 31 |
<body> |
| 32 |
|
| 33 |
<p> |
| 34 |
nVidia release their own Linux drivers which provide good performance and full |
| 35 |
3D acceleration. The driver releases are split up into two parts: |
| 36 |
<c>nvidia-kernel</c> and <c>nvidia-glx</c>. |
| 37 |
</p> |
| 38 |
|
| 39 |
<p> |
| 40 |
<c>nvidia-kernel</c> is a kernel driver which handles the low-level |
| 41 |
communication with your video hardware. This is simply a kernel module, named |
| 42 |
<c>nvidia</c>, which installs against your kernel sources and needs to be loaded |
| 43 |
whenever you want to use the nvidia drivers. |
| 44 |
</p> |
| 45 |
|
| 46 |
<p> |
| 47 |
As well as the kernel driver, you need to install the X11 GLX layer |
| 48 |
(<c>nvidia-glx</c>). This is used by X to render graphics, which internally |
| 49 |
uses the <c>nvidia-kernel</c> kernel driver to interface with the hardware. |
| 50 |
</p> |
| 51 |
|
| 52 |
</body> |
| 53 |
</section> |
| 54 |
</chapter> |
| 55 |
|
| 56 |
<chapter> |
| 57 |
<title>Configuring your Card</title> |
| 58 |
<section> |
| 59 |
<title>Installing the Appropriate Drivers</title> |
| 60 |
<body> |
| 61 |
|
| 62 |
<p> |
| 63 |
As mentioned above, the nVidia kernel driver installs and runs against your |
| 64 |
current kernel. It builds as a module, so it makes sense that your kernel must |
| 65 |
support the loading of kernel modules. If you used <c>genkernel</c> to configure |
| 66 |
the kernel for you then you're all set. If not, double check your kernel |
| 67 |
configuration so that this support is enabled: |
| 68 |
</p> |
| 69 |
|
| 70 |
<pre caption="Enabling the Loading of Kernel Modules"> |
| 71 |
Loadable module support ---> |
| 72 |
[*] Enable loadable module support |
| 73 |
</pre> |
| 74 |
|
| 75 |
<p> |
| 76 |
You also need to enable <e>Memory Type Range Register</e> in your kernel: |
| 77 |
</p> |
| 78 |
|
| 79 |
<pre caption="Enabling MTRR"> |
| 80 |
Processor and Features ---> |
| 81 |
[*] MTRR (Memory Type Range Register) support |
| 82 |
</pre> |
| 83 |
|
| 84 |
<p> |
| 85 |
nVidia's modules and libraries are combined in two packages: <c>nvidia-glx</c> |
| 86 |
and <c>nvidia-kernel</c>. The former are the X11 GLX libraries while the latter |
| 87 |
are the kernel modules. |
| 88 |
</p> |
| 89 |
|
| 90 |
<p> |
| 91 |
The nvidia-kernel ebuild auto discovers your kernel version based on the |
| 92 |
<path>/usr/src/linux</path> symlink. Please ensure that you have this symlink |
| 93 |
pointing to the correct sources and that your kernel is correctly configured. |
| 94 |
Please refer to the Configuring the Kernel section of the <uri |
| 95 |
link="/doc/en/handbook/">Installation Handbook</uri> for details on configuring |
| 96 |
your kernel. |
| 97 |
</p> |
| 98 |
|
| 99 |
<p> |
| 100 |
If you are using gentoo-sources-2.6.11-r6, your /usr/src directory might look |
| 101 |
something like this: |
| 102 |
</p> |
| 103 |
|
| 104 |
<pre caption="Check your /usr/src/linux symlink"> |
| 105 |
# <i>cd /usr/src</i> |
| 106 |
# <i>ls -l</i> |
| 107 |
<comment>(Check that linux points to the right directory)</comment> |
| 108 |
lrwxrwxrwx 1 root root 22 Apr 23 18:33 linux -> linux-2.6.11-gentoo-r6 |
| 109 |
drwxr-xr-x 4 root root 120 Apr 8 18:56 linux-2.4.26-gentoo-r4 |
| 110 |
drwxr-xr-x 18 root root 664 Dec 31 16:09 linux-2.6.10 |
| 111 |
drwxr-xr-x 18 root root 632 Mar 3 12:27 linux-2.6.11 |
| 112 |
drwxr-xr-x 19 root root 4096 Mar 16 22:00 linux-2.6.11-gentoo-r6 |
| 113 |
</pre> |
| 114 |
|
| 115 |
<p> |
| 116 |
In the above output, you'll notice that the <c>linux</c> symlink is pointing |
| 117 |
to the <c>linux-2.6.11-gentoo-r6</c> kernel. |
| 118 |
</p> |
| 119 |
|
| 120 |
<p> |
| 121 |
If the symlink is not pointing to the correct sources, you must update the link |
| 122 |
like this: |
| 123 |
</p> |
| 124 |
|
| 125 |
<pre caption="Create/Update /usr/src/linux symlink"> |
| 126 |
# <i>cd /usr/src</i> |
| 127 |
# <i>ln -snf linux-2.6.11-gentoo-r6 linux</i> |
| 128 |
</pre> |
| 129 |
|
| 130 |
<p> |
| 131 |
Now it's time to install <c>nvidia-kernel</c> and <c>nvidia-glx</c>. Since |
| 132 |
<c>nvidia-glx</c> depends on <c>nvidia-kernel</c>, installing <c>nvidia-glx</c> |
| 133 |
is sufficient: |
| 134 |
</p> |
| 135 |
|
| 136 |
<pre caption="Installing the nVidia modules"> |
| 137 |
# <i>emerge nvidia-glx</i> |
| 138 |
</pre> |
| 139 |
|
| 140 |
<impo> |
| 141 |
Every time you <uri link="/doc/en/kernel-upgrade.xml">compile a new |
| 142 |
kernel</uri> or recompile the current one, you have to run <c>emerge |
| 143 |
nvidia-kernel</c> to reinstall the nVidia modules. nvidia-glx is unaffected by |
| 144 |
a kernel change and doesn't even need to be rebuilt when you recompile/upgrade |
| 145 |
X. |
| 146 |
</impo> |
| 147 |
|
| 148 |
<p> |
| 149 |
Once the installation has finished, run <c>modprobe nvidia</c> to load the |
| 150 |
kernel module into memory. |
| 151 |
</p> |
| 152 |
|
| 153 |
<pre caption="Loading the kernel module"> |
| 154 |
# <i>modprobe nvidia</i> |
| 155 |
</pre> |
| 156 |
|
| 157 |
<p> |
| 158 |
To prevent you having to manually load the module on every bootup, you probably |
| 159 |
want to have this done automatically each time you boot your system, so edit |
| 160 |
<path>/etc/modules.autoload.d/kernel-2.6</path> (or <path>kernel-2.4</path>, |
| 161 |
depending on which kernel version you use) and add <c>nvidia</c> to it. Don't |
| 162 |
forget to run <c>modules-update</c> afterwards. |
| 163 |
</p> |
| 164 |
|
| 165 |
<pre caption="Running modules-update"> |
| 166 |
# <i>modules-update</i> |
| 167 |
</pre> |
| 168 |
|
| 169 |
</body> |
| 170 |
</section> |
| 171 |
<section> |
| 172 |
<title>Configuring the X Server</title> |
| 173 |
<body> |
| 174 |
|
| 175 |
<p> |
| 176 |
Once the appropriate drivers are installed you need to configure your X Server |
| 177 |
(XFree86 or Xorg) to use the <c>nvidia</c> driver instead of the default |
| 178 |
<c>nv</c> driver. |
| 179 |
</p> |
| 180 |
|
| 181 |
<p> |
| 182 |
Open <path>/etc/X11/xorg.conf</path> (or <path>/etc/X11/XF86Config</path> if you |
| 183 |
still use the older configuration file location) with your favorite editor |
| 184 |
(such as <c>nano</c> or <c>vim</c>) and go to the <c>Device</c> section. In that |
| 185 |
section, change the <c>Driver</c> line: |
| 186 |
</p> |
| 187 |
|
| 188 |
<pre caption="Changing nv to nvidia in the X Server configuration"> |
| 189 |
Section "Device" |
| 190 |
Identifier "nVidia Inc. GeForce2" |
| 191 |
<i>Driver "nvidia"</i> |
| 192 |
VideoRam 65536 |
| 193 |
EndSection |
| 194 |
</pre> |
| 195 |
|
| 196 |
<p> |
| 197 |
Then go to the <c>Module</c> section and make sure the <c>glx</c> module gets |
| 198 |
loaded while the <c>dri</c> module doesn't: |
| 199 |
</p> |
| 200 |
|
| 201 |
<pre caption="Updating the Module section"> |
| 202 |
Section "Module" |
| 203 |
<comment>(...)</comment> |
| 204 |
<i># Load "dri" |
| 205 |
Load "glx"</i> |
| 206 |
<comment>(...)</comment> |
| 207 |
EndSection |
| 208 |
</pre> |
| 209 |
|
| 210 |
<p> |
| 211 |
Next, in section <c>Screen</c>, make sure that either the <c>DefaultDepth</c> |
| 212 |
directive is set to 16 or 24, or that you only have <c>Display</c> subsections |
| 213 |
with <c>Depth</c> settings of 16 or 24. Without it, the nvidia-glx extensions |
| 214 |
will not start. |
| 215 |
</p> |
| 216 |
|
| 217 |
<pre caption="Updating the Screen section"> |
| 218 |
Section "Screen" |
| 219 |
<comment>(...)</comment> |
| 220 |
<i>DefaultDepth 16</i> |
| 221 |
Subsection "Display" |
| 222 |
<comment>(...)</comment> |
| 223 |
EndSection |
| 224 |
</pre> |
| 225 |
|
| 226 |
<p> |
| 227 |
Run <c>opengl-update</c> so that the X Server uses the nVidia GLX libraries: |
| 228 |
</p> |
| 229 |
|
| 230 |
<pre caption="Running opengl-update"> |
| 231 |
# <i>opengl-update nvidia</i> |
| 232 |
</pre> |
| 233 |
|
| 234 |
</body> |
| 235 |
</section> |
| 236 |
<section> |
| 237 |
<title>Adding your Users to the video Group</title> |
| 238 |
<body> |
| 239 |
|
| 240 |
<p> |
| 241 |
You have to add your user to the <c>video</c> group so he has access to the |
| 242 |
nvidia device files: |
| 243 |
</p> |
| 244 |
|
| 245 |
<pre caption="Adding your user to the video group"> |
| 246 |
# <i>gpasswd -a youruser video</i> |
| 247 |
</pre> |
| 248 |
|
| 249 |
<p> |
| 250 |
This might not be totally necessary if you aren't using <c>udev</c> but it |
| 251 |
doesn't hurt either and makes your system future-proof :) |
| 252 |
</p> |
| 253 |
|
| 254 |
</body> |
| 255 |
</section> |
| 256 |
<section> |
| 257 |
<title>Testing your Card</title> |
| 258 |
<body> |
| 259 |
|
| 260 |
<p> |
| 261 |
To test your nVidia card, fire up X and run the <c>glxinfo | grep direct</c> |
| 262 |
command. It should say that direct rendering is activated: |
| 263 |
</p> |
| 264 |
|
| 265 |
<pre caption="Checking the direct rendering status"> |
| 266 |
$ <i>glxinfo | grep direct</i> |
| 267 |
direct rendering: Yes |
| 268 |
</pre> |
| 269 |
|
| 270 |
<p> |
| 271 |
To monitor your FPS, run <c>glxgears</c>. |
| 272 |
</p> |
| 273 |
|
| 274 |
</body> |
| 275 |
</section> |
| 276 |
<section> |
| 277 |
<title>Enabling nvidia Support</title> |
| 278 |
<body> |
| 279 |
|
| 280 |
<p> |
| 281 |
Some tools, such as <c>mplayer</c> and <c>xine-lib</c>, use a local USE flag |
| 282 |
called "nvidia" which enables XvMCNVIDIA support, useful when watching high |
| 283 |
resolution movies. Add in "nvidia" in your USE variable in |
| 284 |
<path>/etc/make.conf</path> or add it as USE flag to <c>media-video/mplayer</c> |
| 285 |
and/or <c>media-libs/xine-lib</c> in <path>/etc/portage/package.use</path>. |
| 286 |
</p> |
| 287 |
|
| 288 |
<p> |
| 289 |
Then, run <c>emerge -uD --newuse world</c> to rebuild the applications that |
| 290 |
benefit from the USE flag change. |
| 291 |
</p> |
| 292 |
|
| 293 |
</body> |
| 294 |
</section> |
| 295 |
</chapter> |
| 296 |
|
| 297 |
<chapter> |
| 298 |
<title>Troubleshooting</title> |
| 299 |
<section> |
| 300 |
<title>Getting 2D to work on machines with 4Gb or more memory</title> |
| 301 |
<body> |
| 302 |
|
| 303 |
<p> |
| 304 |
If you are having troubles with the nVidia 2D acceleration it is likely that you |
| 305 |
are unable to set up a write-combining range with MTRR. To verify, check the |
| 306 |
contents of <path>/proc/mtrr</path>: |
| 307 |
</p> |
| 308 |
|
| 309 |
<pre caption="Checking if you have write-combining enabled"> |
| 310 |
# <i>cat /proc/mtrr</i> |
| 311 |
</pre> |
| 312 |
|
| 313 |
<p> |
| 314 |
Every line should contain "write-back" or "write-combining". If you see a line |
| 315 |
with "uncachable" in it you will need to change a BIOS setting to fix this. |
| 316 |
</p> |
| 317 |
|
| 318 |
<p> |
| 319 |
Reboot and enter the BIOS, then find the MTRR settings (probably under "CPU |
| 320 |
Settings"). Change the setting from "continuous" to "discrete" and boot back |
| 321 |
into Linux. You will now find out that there is no "uncachable" entry anymore |
| 322 |
and 2D acceleration now works without any glitches. |
| 323 |
</p> |
| 324 |
|
| 325 |
</body> |
| 326 |
</section> |
| 327 |
<section> |
| 328 |
<title>I receive warnings about unsupported 4K stack sizes</title> |
| 329 |
<body> |
| 330 |
|
| 331 |
<p> |
| 332 |
<c>nvidia-kernel</c> packages older than 1.0.6106 only support kernels using an |
| 333 |
8K stack size. More recent kernels (2.6.6 and higher) have support for 4K stack |
| 334 |
size's as well. Do not select 4K stack size in your kernel configuration if you |
| 335 |
are using such an <c>nvidia-kernel</c> package. You can find this option in the |
| 336 |
section <c>Kernel Hacking</c>. |
| 337 |
</p> |
| 338 |
|
| 339 |
</body> |
| 340 |
</section> |
| 341 |
</chapter> |
| 342 |
|
| 343 |
<chapter> |
| 344 |
<title>Expert Configuration</title> |
| 345 |
<section> |
| 346 |
<title>Documentation</title> |
| 347 |
<body> |
| 348 |
|
| 349 |
<p> |
| 350 |
The nVidia driver package also comes with comprehensive documentation. This is |
| 351 |
installed into <c>/usr/share/doc</c> and can be viewed with the following |
| 352 |
command: |
| 353 |
</p> |
| 354 |
|
| 355 |
<pre caption="Viewing the NVIDIA documentation"> |
| 356 |
# <i>less /usr/share/doc/nvidia-glx-*/README.txt.gz</i> |
| 357 |
</pre> |
| 358 |
|
| 359 |
</body> |
| 360 |
</section> |
| 361 |
<section> |
| 362 |
<title>Kernel module parameters</title> |
| 363 |
<body> |
| 364 |
|
| 365 |
<p> |
| 366 |
The <c>nvidia</c> kernel module accepts a number of parameters (options) which |
| 367 |
you can use to tweak the behaviour of the driver. Most of these are mentioned in |
| 368 |
the documentation. To add or change the values of these parameters, edit the |
| 369 |
file <c>/etc/modules.d/nvidia</c>. Remember to run <c>modules-update</c> after |
| 370 |
modifying this file, and bear in mind that you will need to reload the |
| 371 |
<c>nvidia</c> module before the new settings take effect. |
| 372 |
</p> |
| 373 |
|
| 374 |
</body> |
| 375 |
</section> |
| 376 |
<section> |
| 377 |
<title>Advanced X configuration</title> |
| 378 |
<body> |
| 379 |
|
| 380 |
<p> |
| 381 |
The GLX layer also has a plethora of options which can be configured. These |
| 382 |
control the configuration of TV out, dual displays, monitor frequency detection, |
| 383 |
etc. Again, all of the available options are detailed in the documentation. |
| 384 |
</p> |
| 385 |
|
| 386 |
<p> |
| 387 |
If you wish to use any of these options, you need to list them in the relevant |
| 388 |
Device section of your X config file (usually <c>/etc/X11/xorg.conf</c>). For |
| 389 |
example, suppose I wanted to disable the splash logo: |
| 390 |
</p> |
| 391 |
|
| 392 |
<pre caption="Advanced nvidia configuration in the X configuration"> |
| 393 |
Section "Device" |
| 394 |
Identifier "nVidia Inc. GeForce2" |
| 395 |
Driver "nvidia" |
| 396 |
<i>Option "NoLogo" "true"</i> |
| 397 |
VideoRam 65536 |
| 398 |
EndSection |
| 399 |
</pre> |
| 400 |
|
| 401 |
</body> |
| 402 |
</section> |
| 403 |
</chapter> |
| 404 |
|
| 405 |
</guide> |