/[gentoo]/xml/htdocs/doc/en/dri-howto.xml
Gentoo

Contents of /xml/htdocs/doc/en/dri-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download) (as text)
Sat Aug 7 13:44:12 2004 UTC (9 years, 11 months ago) by swift
Branch: MAIN
Changes since 1.15: +10 -3 lines
File MIME type: application/xml
#59294 - Add hint about agp=try_unsupported

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.15 2004/08/01 10:25:10 swift Exp $ -->
3 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4
5 <guide link="/doc/en/dri-howto.xml">
6 <title>Hardware 3D Acceleration Guide</title>
7 <author title="Author">
8 <mail link="spyderous@gentoo.org">Donnie Berkholz</mail>
9 </author>
10 <author title="Editor">
11 <mail link="peesh@gentoo.org">Jorge Paulo</mail>
12 </author>
13
14 <abstract>
15 This document is a guide to getting 3D acceleration working using XFree-DRM
16 with XFree86 in Gentoo Linux.
17 </abstract>
18
19 <license/>
20
21 <version>1.0.5</version>
22 <date>August 07, 2004</date>
23
24 <chapter>
25 <title>Introduction</title>
26 <section>
27 <title>What is hardware 3D acceleration and why do I want it?</title>
28 <body>
29
30 <p>
31 With hardware 3D acceleration, three-dimensional rendering uses the graphics
32 processor on your video card instead of taking up valuable CPU resources
33 drawing 3D images. It's also referred to as "hardware acceleration" instead of
34 "software acceleration" because without this 3D acceleration your CPU is forced
35 to draw everything itself using the Mesa software rendering libraries, which
36 takes up quite a bit of processing power. While XFree86 typically supports 2D
37 hardware acceleration, it often lacks hardware 3D acceleration.
38 Three-dimensional hardware acceleration is valuable in situations requiring
39 rendering of 3D objects such as games, 3D CAD and modeling.
40 </p>
41
42 </body>
43 </section>
44 <section>
45 <title>How do I get hardware 3D acceleration?</title>
46 <body>
47
48 <p>
49 In many cases, both binary and open-source drivers exist. Open-source drivers
50 are preferable since we're using Linux and open source is one of its underlying
51 principles. Sometimes, binary drivers are the only option, like with nVidia's
52 cards. Binary drivers include media-video/nvidia-kernel and
53 media-video/nvidia-glx for nVidia cards, media-video/mgavideo for Matrox cards
54 and media-video/ati-drivers for ATI cards. Other open-source drivers include
55 media-video/kyro-kernel for KyroII cards and media-video/ati-gatos for ATI
56 cards, which aim to support ATI's video capabilities more fully.
57 </p>
58
59 </body>
60 </section>
61 <section>
62 <title>What is DRI?</title>
63 <body>
64
65 <p>
66 The Direct Rendering Infrastructure (<uri
67 link="http://dri.sourceforge.net">dri.sourceforge.net</uri>), also known as the
68 DRI, is a framework for allowing direct access to graphics hardware in a safe
69 and efficient manner. It includes changes to the X server, to several client
70 libraries and to the kernel. The first major use for the DRI is to create fast
71 OpenGL implementations.
72 </p>
73
74 </body>
75 </section>
76 <section>
77 <title>What is XFree-DRM and how does it relate to regular XFree86?</title>
78 <body>
79
80 <p>
81 XFree-DRM is an <e>enhancement</e> to XFree86 that adds 3D acceleration for
82 cards by adding the kernel module necessary for direct rendering.
83 </p>
84
85 </body>
86 </section>
87 <section>
88 <title>Purpose</title>
89 <body>
90
91 <p>
92 This guide is for people who can't get direct rendering working with just
93 XFree. XFree-DRM works for 3dfx, gamma, i8x0, matrox, rage128, radeon, mach64
94 (as of xfree-drm-4.3.0-r7) and sis300 series drivers. Since the 2.4 kernels'
95 Direct Rendering Manager (DRM) doesn't support XFree 4.3, the xfree-drm package
96 is needed. If you're using a 2.6 kernel, its DRM supports XFree 4.3; Gentoo's
97 XFree-DRM package is not yet working on 2.6 kernels. See the <uri
98 link="http://dri.sourceforge.net">DRI homepage</uri> for more info and
99 documentation.
100 </p>
101
102 </body>
103 </section>
104 <section>
105 <title>Feedback</title>
106 <body>
107
108 <p>
109 With suggestions, questions, etc., e-mail <mail
110 link="spyderous@gentoo.org">Donnie Berkholz</mail>.
111 </p>
112
113 </body>
114 </section>
115 </chapter>
116
117 <chapter>
118 <title>Install XFree86 and configure your kernel</title>
119 <section>
120 <title>Install XFree86</title>
121 <body>
122
123 <pre caption="Installing XFree86">
124 # <i>emerge x11-base/xfree</i>
125 </pre>
126
127 </body>
128 </section>
129 <section>
130 <title>Configure your kernel</title>
131 <body>
132
133 <p>
134 Probe for your chipset and enable just that one.
135 </p>
136
137 <pre caption="Checking your AGP chipset">
138 # <i>emerge pciutils; lspci | grep AGP</i>
139 # <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i>
140 <codenote>Your output may not match the above due to different hardware.</codenote>
141 </pre>
142
143 <p>
144 If your chipset is not supported by the kernel you might have some succes by
145 passing <c>agp=try_unsupported</c> as a kernel parameter. This will use Intel's
146 generic routines for AGP support. To add this parameter, edit your bootloader
147 configuration file!
148 </p>
149
150 <p>
151 Most, if not all, kernels should have these options. This was configured using
152 gentoo-sources-2.4.20-r5.
153 </p>
154
155 <pre caption="Configuring the kernel">
156 # <i>ls -l /usr/src/linux </i>
157 lrwxrwxrwx 1 root root 22 May 29 18:20 /usr/src/linux -> linux-2.4.20-gentoo-r5
158 <codenote>Make sure /usr/src/linux links to your current kernel.</codenote>
159 # <i>cd /usr/src/linux</i>
160 # <i>make menuconfig</i>
161 </pre>
162
163 <pre caption="make menuconfig options">
164 Processor type and features ---&gt;
165 &lt;*&gt; MTRR (Memory Type Range Register) support
166 Character devices ---&gt;
167 &lt;M&gt; /dev/agpgart (AGP Support)
168 [*] Intel 440LX/BX/GX and I815/I820/I830M/I830MP/I840/I845/I850/I860 support
169 <codenote>Enable your chipset instead of the above.</codenote>
170 [ ] Direct Rendering Manager (XFree86 DRI support)
171 </pre>
172
173 <p>
174 Make sure the Direct Rendering Manager (DRM) is <e>off</e>. The XFree-DRM
175 package will provide its own. The 2.4 kernel's version is for XFree 4.2.
176 </p>
177
178 </body>
179 </section>
180 <section>
181 <title>Compile and install your kernel</title>
182 <body>
183
184 <pre caption="Compiling and installing kernel">
185 # <i>make dep &amp;&amp; make clean bzImage modules modules_install</i>
186 # <i>mount /boot</i>
187 # <i>cp arch/i386/boot/bzImage /boot</i>
188 </pre>
189
190 <p>
191 If you want your kernel to be named something other than bzImage, be sure to
192 copy to /boot/yourname instead. Don't forget to set up grub.conf or lilo.conf
193 and run /sbin/lilo if you use LILO.
194 </p>
195
196 </body>
197 </section>
198 </chapter>
199
200 <chapter>
201 <title>Install XFree-DRM and configure direct rendering</title>
202 <section>
203 <title>Install XFree-DRM</title>
204 <body>
205
206 <pre caption="Installing XFree-DRM">
207 # <i>ACCEPT_KEYWORDS="~x86" emerge xfree-drm</i>
208 </pre>
209
210 </body>
211 </section>
212 <section>
213 <title>Configure XF86Config</title>
214 <body>
215
216 <p>
217 Open <path>/etc/X11/XF86Config</path> with your favorite text editor and edit
218 it to enable DRI and GLX.
219 </p>
220
221 <pre caption="XF86Config">
222 ...
223 Section "Module"
224 Load "dri"
225 Load "glx"
226 ...
227 EndSection
228 ...
229 Section "Device"
230 Driver "radeon"
231 ...
232 EndSection
233 ...
234 Section "dri"
235 Mode 0666
236 EndSection
237 </pre>
238
239 <p>
240 If you are using a different driver, replace "radeon" with yours.
241 </p>
242
243 </body>
244 </section>
245 </chapter>
246
247 <chapter>
248 <title>Test 3D acceleration</title>
249 <section>
250 <title>Reboot to the new kernel</title>
251 <body>
252
253 <p>
254 Reboot your computer to your new kernel. It's time to see if you have direct
255 rendering and how good it is.
256 </p>
257
258 <pre caption="Testing rendering">
259 # <i>startx</i>
260 <codenote>No need to load modules for your driver or agpgart, if you compiled agpgart as a module.</codenote>
261 <codenote>They will be loaded automatically.</codenote>
262 # <i>glxinfo | grep rendering</i>
263 direct rendering: Yes
264 <codenote>If it says "No," you don't have 3D acceleration.</codenote>
265 # <i>glxgears</i>
266 <codenote>Test your frames per second (FPS) at the default size. The number should be </codenote>
267 <codenote>significantly higher than before installing xfree-drm. Do this while the CPU is as idle as possible.</codenote>
268 </pre>
269
270 </body>
271 </section>
272 </chapter>
273
274 <chapter>
275 <title>Using the CVS sources</title>
276 <section>
277 <body>
278
279 <warn>
280 Don't do this if the package worked.
281 </warn>
282
283 </body>
284 </section>
285 <section>
286 <title>Do you need the CVS?</title>
287 <body>
288
289 <p>
290 First you have to check whether the xfree-drm package works. If it doesn't and
291 you have checked your logs to verify it's not a configuration error, you might
292 want to consider the CVS sources. There are also daily driver snapshots
293 available if you do not wish to build the full CVS.
294 </p>
295
296 </body>
297 </section>
298 <section>
299 <title>Do the CVS sources support your card?</title>
300 <body>
301
302 <p>
303 Check the DRI <uri
304 link="http://dri.sourceforge.net/cgi-bin/moin.cgi/Status">supported cards
305 list</uri> to see if the CVS supports your card. Even if it doesn't, but it
306 supports a similar card, try it.
307 </p>
308
309 <!-- I see a couple of 8x AGP stuff on the Internet about vanilla 2.4 kernels;
310 is this now available or not? I've commented it out for the time being,
311 hoping that this doesn't affect us :)
312
313 <warn>
314 "Linux 2.4 doesn't support agp 8x, so I had to go find a backport. The backport
315 works .... it doesn't patch quite properly, and it requires 2.4.21 (I've only
316 gotten it to work with vanilla, straight from the tarball (not ebuild)). First
317 go get the 2.4.20-2.4.21 patch from kernel.org .... (then get the patch,) It
318 was on a mailing list somewhere. It doesn't patch cleanly - - one file fails,
319 the pci_ids.h file, but if you actually read the file and the reject list, it's
320 very easy to fix. But it does load, and it gives me 1600x1200 with video
321 (although a bit slow b/c of lack of dga) with xfree-drm." (SanityInAnarchy on
322 #gentoo)
323 </warn>
324
325 <impo>
326 The patch is a little tricky to work with but <uri
327 link="http://www.ussg.iu.edu/hypermail/linux/kernel/0302.2/att-1618/01-agp3.diff.bz2">here's
328 the link</uri>. If you can disable 8X AGP in your BIOS, change it to 4X and you
329 may not need the patch.
330 </impo>
331 -->
332
333 </body>
334 </section>
335 <section>
336 <title>Follow the CVS Instructions</title>
337 <body>
338
339 <p>
340 The DRI project has a document about CVS compiling themselves. Please read <uri
341 link="http://dri.sourceforge.net/cgi-bin/moin.cgi/Building">the document</uri>
342 and follow the instructions up to the <e>Installing for XFree86</e> or
343 <e>Installing for X.org</e> part.
344 </p>
345
346 </body>
347 </section>
348 <section>
349 <title>Install the CVS</title>
350 <body>
351
352 <p>
353 Verify that the DRI kernel module(s) for your system were built:
354 </p>
355
356 <pre caption="Verification">
357 # <i>cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel; ls</i>
358 </pre>
359
360 <p>
361 For the 3dfx Voodoo, you should see <path>tdfx.o</path>. For the Matrox
362 G200/G400, you should see <path>mga.o</path>. For the ATI Rage 128, you should
363 see <path>r128.o</path>. For the ATI Radeon, you should see
364 <path>radeon.o</path>. For the Intel i810, you should see <path>i810.o</path>.
365 If the DRI kernel module(s) failed to build, you should verify that you're
366 using the right version of the Linux kernel. The most recent kernels are not
367 always supported.
368 </p>
369
370 <p>
371 Install over your XFree86 or X.org installation. You may wish to back up xfree
372 or xorg-x11.
373 </p>
374
375 <pre caption="Backing up XFree">
376 # <i>quickpkg xfree</i>
377 <codenote>This backs up your XFree86 package.</codenote>
378 # <i>make install</i>
379 </pre>
380
381 <p>
382 Follow the "Configure XF86Config" section above.
383 </p>
384
385 <p>
386 To load the appropriate DRM module in your running kernel, copy the kernel
387 module to <path>/lib/modules/`uname -r`/kernel/drivers/char/drm/</path> then
388 run <c>modules-update</c> and restart your X server. If you're not running the
389 kernel you'll be using it in, instead of <c>`uname -r`,</c> use that kernel's
390 name.
391 </p>
392
393 <warn>
394 Make sure you first unload any older DRI kernel modules that might be already
395 loaded. Note that some DRM modules require that the agpgart module be loaded
396 first.
397 </warn>
398
399 </body>
400 </section>
401 </chapter>
402
403 <chapter>
404 <title>Tweak your performance</title>
405 <section>
406 <title>Get the most out of direct rendering</title>
407 <body>
408
409 <p>
410 A few options may increase performance by up to 30 percent (or more) over the
411 default. Set them in <path>/etc/X11/XF86Config</path>.
412 </p>
413
414 <pre caption="XF86Config">
415 Section "Device"
416 Option "AGPMode" "4"
417 <codenote>This increased FPS from 609 to 618.</codenote>
418 Option "AGPFastWrite" "True"
419 <codenote>This had no measurable effect, but it may increase instability of your computer.</codenote>
420 <codenote>You may also need to set it in your BIOS.</codenote>
421 Option "EnablePageFlip" "True"
422 <codenote>This improved FPS from 618 to 702. It also is "risky" but few people have reported problems.</codenote>
423 ...
424 EndSection
425 </pre>
426
427 <p>
428 If you want to set even more features, check out the <uri
429 link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features
430 listing</uri> on the DRI Web site.
431 </p>
432
433 </body>
434 </section>
435 </chapter>
436
437 <chapter>
438 <title>Troubleshooting</title>
439 <section>
440 <title>It doesn't work. I just recompiled my kernel or switched to a new one.</title>
441 <body>
442
443 <p>
444 Whenever you rebuild your kernel or switch to another kernel, you'll have to
445 rebuild the kernel module. Note that you don't need to remerge xfree, but you
446 will need to remerge xfree-drm.
447 </p>
448
449 </body>
450 </section>
451
452 <section>
453 <title>It doesn't work. I don't have rendering, and I can't tell why.</title>
454 <body>
455
456 <p>
457 Try <c>insmod radeon</c> before you start the X server. Also, try building
458 agpgart into the kernel instead of as a module.
459 </p>
460
461 </body>
462 </section>
463 <section>
464 <title>When I startx, I get this error: "[drm] failed to load kernel module agpgart"</title>
465 <body>
466
467 <p>
468 That's because you compiled agpgart into the kernel instead of as a module.
469 Ignore it unless you're having problems.
470 </p>
471
472 </body>
473 </section>
474 <section>
475 <title>Direct rendering doesn't work, and in /var/log/XFree86.0.log I have an error about driver version too low.</title>
476 <body>
477
478 <p>
479 You aren't using the xfree-drm driver. Check if you compiled DRM and the driver
480 into the kernel; you shouldn't have.
481 </p>
482
483 </body>
484 </section>
485 <section>
486 <title>I have a Radeon, and I want TV-Out.</title>
487 <body>
488
489 <p>
490 Check out ati-gatos drivers. <c>emerge -s gatos</c>.
491 </p>
492
493 </body>
494 </section>
495 <section>
496 <title>It doesn't work. My card is so incredibly new and cool that it isn't supported at all.</title>
497 <body>
498
499 <p>
500 Try out the binary drivers. For ati-drivers, a listing is at
501 <uri>http://www.schneider-digital.de/html/download_ati.html</uri>. If those
502 don't support it, use fbdev. It's slow, but it works.
503 </p>
504
505 </body>
506 </section>
507 <section>
508 <title>I have a PCI card and it doesn't work. Help!</title>
509 <body>
510
511 <p>
512 In section "Device" enable ForcePCIMode.
513 </p>
514
515 <pre caption="Enabling ForcePCIMode">
516 Option "ForcePCIMode" "True"
517 </pre>
518
519 </body>
520 </section>
521 </chapter>
522
523 <chapter>
524 <title>Acknowledgments</title>
525 <section>
526 <body>
527
528 <ol>
529 <li>
530 Christopher Webber for suggesting a troubleshooting question about changing
531 or recompiling kernels
532 </li>
533 <li>
534 Steve, for suggesting consistency between the cases of dri and DRI in
535 XF86Config
536 </li>
537 </ol>
538
539 </body>
540 </section>
541 </chapter>
542
543 <chapter>
544 <title>References</title>
545 <section>
546 <body>
547
548 <ol>
549 <li>http://forums.gentoo.org/viewtopic.php?t=46681</li>
550 <li>http://forums.gentoo.org/viewtopic.php?t=29264</li>
551 <li>http://dri.sourceforge.net/</li>
552 <li>http://www.retinalburn.net/linux/dri_status.html</li>
553 </ol>
554
555 </body>
556 </section>
557 </chapter>
558 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20