/[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.25 - (hide annotations) (download) (as text)
Sat Jul 30 21:48:32 2005 UTC (9 years, 4 months ago) by neysx
Branch: MAIN
Changes since 1.24: +26 -27 lines
File MIME type: application/xml
#100825 Updated links

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

  ViewVC Help
Powered by ViewVC 1.1.20