/[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.22 - (hide annotations) (download) (as text)
Wed Jul 13 12:57:52 2005 UTC (9 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.21: +19 -3 lines
File MIME type: application/xml
#98034 - Use the insecure-drivers USE flag for certain kinds of chipsets

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

  ViewVC Help
Powered by ViewVC 1.1.20