/[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.45 - (show annotations) (download) (as text)
Mon Dec 14 21:26:40 2009 UTC (5 years ago) by nightmorph
Branch: MAIN
Changes since 1.44: +5 -7 lines
File MIME type: application/xml
Update some links that have been redirected, bug 296922

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/dri-howto.xml,v 1.44 2009/11/30 20:19:35 nightmorph Exp $ -->
3 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4
5 <guide>
6 <title>Hardware 3D Acceleration Guide</title>
7
8 <author title="Author">
9 <mail link="dberkholz"/>
10 </author>
11 <author title="Editor">
12 <mail link="peesh"/>
13 </author>
14 <author title="Editor">
15 <mail link="nightmorph"/>
16 </author>
17
18 <abstract>
19 This document is a guide to getting 3D acceleration working using the DRM with
20 Xorg in Gentoo Linux.
21 </abstract>
22
23 <!-- The content of this document is licensed under the CC-BY-SA license -->
24 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
25 <license/>
26
27 <version>1.13</version>
28 <date>2009-12-14</date>
29
30 <chapter>
31 <title>Introduction</title>
32 <section>
33 <title>What is hardware 3D acceleration and why do I want it?</title>
34 <body>
35
36 <p>
37 With hardware 3D acceleration, three-dimensional rendering uses the graphics
38 processor on your video card instead of taking up valuable CPU resources
39 drawing 3D images. It's also referred to as "hardware acceleration" instead of
40 "software acceleration" because without this 3D acceleration your CPU is forced
41 to draw everything itself using the Mesa software rendering libraries, which
42 takes up quite a bit of processing power. While Xorg typically supports 2D
43 hardware acceleration, it often lacks hardware 3D acceleration.
44 Three-dimensional hardware acceleration is valuable in situations requiring
45 rendering of 3D objects such as games, 3D CAD and modeling.
46 </p>
47
48 </body>
49 </section>
50 <section>
51 <title>How do I get hardware 3D acceleration?</title>
52 <body>
53
54 <p>
55 In many cases, both binary and open-source drivers exist. Open-source drivers
56 are preferable since we're using Linux and open source is one of its underlying
57 principles. Sometimes, binary drivers are the only option, like with nVidia's
58 cards. Binary drivers include <c>x11-drivers/nvidia-drivers</c> for nVidia cards
59 and <c>x11-drivers/ati-drivers</c> for ATI cards.
60 </p>
61
62 </body>
63 </section>
64 <section>
65 <title>What is DRI?</title>
66 <body>
67
68 <p>
69 The <uri link="http://dri.freedesktop.org/wiki/">Direct Rendering
70 Infrastructure</uri>, also known as the DRI, is a framework for allowing direct
71 access to graphics hardware in a safe and efficient manner. It includes changes
72 to the X server, to several client libraries and to the kernel. The first major
73 use for the DRI is to create fast OpenGL implementations.
74 </p>
75
76 </body>
77 </section>
78 <section>
79 <title>What is the DRM and how does it relate to regular Xorg?</title>
80 <body>
81
82 <p>
83 The DRM (Direct Rendering Manager) is an <e>enhancement</e> to Xorg that adds 3D
84 acceleration for cards by adding the kernel module necessary for direct
85 rendering.
86 </p>
87
88 </body>
89 </section>
90 <section>
91 <title>Purpose</title>
92 <body>
93
94 <p>
95 This guide is for people who can't get direct rendering working with just Xorg.
96 The DRM works for the following drivers:
97 </p>
98
99 <ul>
100 <li>3dfx</li>
101 <li>intel</li>
102 <li>matrox</li>
103 <li>rage128</li>
104 <li>radeon</li>
105 <li>mach64</li>
106 <li>sis300</li>
107 <li>via</li>
108 </ul>
109
110 <p>
111 See the <uri link="http://dri.freedesktop.org/">DRI homepage</uri> for more info
112 and documentation.
113 </p>
114
115 </body>
116 </section>
117 <section>
118 <title>Feedback</title>
119 <body>
120
121 <p>
122 With suggestions, questions, etc., e-mail <mail
123 link="dberkholz@gentoo.org">Donnie Berkholz</mail>.
124 </p>
125
126 </body>
127 </section>
128 </chapter>
129
130 <chapter>
131 <title>Install Xorg and configure your kernel</title>
132 <section>
133 <title>Install Xorg</title>
134 <body>
135
136 <p>
137 Please read our <uri link="/doc/en/xorg-config.xml">Xorg Configuration
138 Guide</uri> to get Xorg up and running.
139 </p>
140
141 </body>
142 </section>
143 <section>
144 <title>Configure your kernel</title>
145 <body>
146
147 <p>
148 Probe for your chipset and enable just that one.
149 </p>
150
151 <pre caption="Checking your AGP chipset">
152 # <i>emerge pciutils; lspci | grep AGP</i>
153 # <i>00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)</i>
154 <comment>(Your output may not match the above due to different hardware.)</comment>
155 </pre>
156
157 <p>
158 If your chipset is not supported by the kernel you might have some succes by
159 passing <c>agp=try_unsupported</c> as a kernel parameter. This will use Intel's
160 generic routines for AGP support. To add this parameter, edit your bootloader
161 configuration file!
162 </p>
163
164 <p>
165 Most, if not all, kernels should have these options. This was configured using a
166 standard <c>gentoo-sources</c> kernel.
167 </p>
168
169 <pre caption="Configuring the kernel">
170 # <i>ls -l /usr/src/linux </i>
171 lrwxrwxrwx 1 root root 22 2007-02-14 20:12 /usr/src/linux -> linux-2.6.18-gentoo-r4
172 <comment>(Make sure /usr/src/linux links to your current kernel.)</comment>
173 # <i>cd /usr/src/linux</i>
174 # <i>make menuconfig</i>
175 </pre>
176
177 <pre caption="make menuconfig options">
178 Processor type and features --->
179 &lt;*&gt; MTRR (Memory Type Range Register) support
180 Device drivers --->
181 Graphics support --->
182 &lt;M&gt; /dev/agpgart (AGP Support) --->
183 <comment>(The agpgart option is not present on 64-bit kernels; just choose your chipset support.)</comment>
184 &lt;M&gt; Intel 440LX/BX/GX, I8xx and E7x05 support
185 <comment>(Enable your chipset instead of the above.)</comment>
186 &lt;M&gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
187 &lt;M&gt; <comment>(Select your graphics card from the list)</comment>
188 </pre>
189
190 </body>
191 </section>
192 <section>
193 <title>Compile and install your kernel</title>
194 <body>
195
196 <pre caption="Compiling and installing kernel">
197 # <i>make &amp;&amp; make modules_install</i>
198 </pre>
199
200 <p>
201 Don't forget to set up <path>grub.conf</path> or <path>lilo.conf</path> and run
202 <c>/sbin/lilo</c> if you use LILO.
203 </p>
204
205 </body>
206 </section>
207 </chapter>
208
209 <chapter>
210 <title>Configure direct rendering</title>
211 <section id="configure_xorg">
212 <title>Configure Xorg.conf</title>
213 <body>
214
215 <p>
216 Open <path>/etc/X11/xorg.conf</path> with your favorite text editor and edit
217 it to enable DRI and GLX.
218 </p>
219
220 <pre caption="xorg.conf">
221 ...
222 Section "Module"
223 Load "dri"
224 Load "glx"
225 ...
226 EndSection
227 ...
228 Section "Device"
229 Driver "radeon"
230 <comment>(Replace radeon with the name of your driver.)</comment>
231 ...
232 EndSection
233 ...
234 Section "dri"
235 Mode 0666
236 EndSection
237 </pre>
238
239 </body>
240 </section>
241 <section>
242 <title>Changes to modules.autoload.d</title>
243 <body>
244
245 <p>
246 You will need to add the module name that your card uses to
247 <path>/etc/modules.autoload.d/kernel-2.6</path> to ensure that the module is
248 loaded automatically when the system starts up.
249 </p>
250
251 <pre caption="Editing /etc/modules.autoload.d/kernel-2.6">
252 <comment>(Change module name as required.)</comment>
253 intel-agp
254 </pre>
255
256 <note>
257 If you compiled <c>agpgart</c> as a module, you will also need to add it to
258 <path>/etc/modules.autoload.d/kernel-2.6</path>.
259 </note>
260
261 </body>
262 </section>
263 </chapter>
264
265 <chapter>
266 <title>Test 3D acceleration</title>
267 <section>
268 <title>Reboot to the new kernel</title>
269 <body>
270
271 <p>
272 Reboot your computer to your new kernel and login as a normal user. It's time to
273 see if you have direct rendering and how good it is. <c>glxinfo</c> and
274 <c>glxgears</c> are part of the <c>mesa-progs</c> package, so make sure it is
275 installed before you attempt to run these commands.
276 </p>
277
278 <pre caption="Testing rendering">
279 $ <i>startx</i>
280 <comment>(No need to load modules for your driver or agpgart, even if you compiled them as a module.)</comment>
281 <comment>(They will be loaded automatically.)</comment>
282 $ <i>glxinfo | grep rendering</i>
283 direct rendering: Yes
284 <comment>(If it says "No", you don't have 3D acceleration.)</comment>
285 $ <i>glxgears</i>
286 <comment>(Test your frames per second (FPS) at the default size. The number should be
287 significantly higher than before configuring DRM. Do this while the CPU is as idle as
288 possible.)</comment>
289 </pre>
290
291 <note>
292 FPS may be limited by your screen's refresh rate, so keep this in mind if
293 <c>glxgears</c> reports only about 70-100 FPS. <c>games-fps/ut2004-demo</c> or
294 other 3D games are better benchmarking tools, as they give you real-world
295 performance results.
296 </note>
297
298 </body>
299 </section>
300 <section>
301 <title>Get the most out of direct rendering</title>
302 <body>
303
304 <p>
305 If you want to set more features, for performance or other reasons, check out
306 the <uri link="http://dri.freedesktop.org/wiki/FeatureMatrix">feature
307 matrix</uri> on the DRI web site or the <uri
308 link="http://dri.sourceforge.net/doc/dri_driver_features.phtml">features
309 listing</uri> on Sourceforge.
310 </p>
311
312 </body>
313 </section>
314 </chapter>
315
316 <chapter>
317 <title>Troubleshooting</title>
318 <section>
319 <title>It doesn't work. I don't have rendering, and I can't tell why.</title>
320 <body>
321
322 <p>
323 Try <c>modprobe radeon</c> before you start the X server (replace <c>radeon</c>
324 with the name of your driver). Also, try building agpgart into the kernel
325 instead of as a module.
326 </p>
327
328 </body>
329 </section>
330 <section>
331 <title>When I startx, I get this error: "[drm] failed to load kernel module agpgart"</title>
332 <body>
333
334 <p>
335 That's because you compiled agpgart into the kernel instead of as a module.
336 Ignore it unless you're having problems.
337 </p>
338
339 </body>
340 </section>
341 <section>
342 <title>I have a Radeon, and I want TV-Out.</title>
343 <body>
344
345 <p>
346 The drivers originally developed by the <uri
347 link="http://gatos.sf.net">GATOS</uri> project have been merged into Xorg's
348 codebase. You don't need anything special for TV-Out;
349 <c>x11-drivers/xf86-video-ati</c> will work just fine.
350 </p>
351
352 </body>
353 </section>
354 <section>
355 <title>
356 It doesn't work. My card is so incredibly new and cool that it isn't supported
357 at all.
358 </title>
359 <body>
360
361 <p>
362 Try out the binary drivers. For <c>ati-drivers</c>, a listing is at
363 <uri>http://support.amd.com/us/gpudownload/Pages/index.aspx</uri>. If those
364 don't support it, use fbdev. It's slow, but it works.
365 </p>
366
367 </body>
368 </section>
369 <section>
370 <title>I have a PCI card and it doesn't work. Help!</title>
371 <body>
372
373 <p>
374 Edit <path>/etc/X11/xorg.conf</path>. In section "Device" enable ForcePCIMode.
375 </p>
376
377 <pre caption="Enabling ForcePCIMode">
378 Option "ForcePCIMode" "True"
379 </pre>
380
381 </body>
382 </section>
383 </chapter>
384
385 <chapter>
386 <title>References</title>
387 <section>
388 <body>
389
390 <ol>
391 <li><uri>http://forums.gentoo.org/viewtopic.php?t=46681</uri></li>
392 <li><uri>http://forums.gentoo.org/viewtopic.php?t=29264</uri></li>
393 <li><uri>http://dri.freedesktop.org/</uri></li>
394 <li><uri>http://www.retinalburn.net/linux/dri_status.html</uri></li>
395 </ol>
396
397 </body>
398 </section>
399 </chapter>
400 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20