/[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.44 - (show annotations) (download) (as text)
Mon Nov 30 20:19:35 2009 UTC (4 years, 9 months ago) by nightmorph
Branch: MAIN
Changes since 1.43: +13 -123 lines
File MIME type: application/xml
strip out all that nice AGP fastwrite stuff I wrote awhile ago. problem is it's not used on very many chipsets (only r200 and older Radeons, for example), and it is kinda risky. and it's for AGP chipsets, which are positively ancient. also made some misc. edits elsewhere.

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

  ViewVC Help
Powered by ViewVC 1.1.20