source: x/installing/xorg-config.xml@ ba4e992

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.4 9.0 9.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ba4e992 was 6039a39, checked in by Pierre Labastie <pieere@…>, 7 years ago

Remove PRIME patch, augment Hybrid graphics instructions
+ one unrelated tag

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19111 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 12.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="xorg-config">
9 <?dbhtml filename="xorg-config.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>Xorg-&xorg-version; Testing and Configuration</title>
17
18 <indexterm zone="xorg-config">
19 <primary sortas="g-configuring-xorg">Configuring Xorg</primary>
20 </indexterm>
21
22 <sect2 id='X11-testing' xreflabel="Testing Xorg">
23 <title>Testing Xorg</title>
24
25 <note>
26 <para>
27 Before starting Xorg for the first time, is is useful to
28 rebuild the library cache by running <userinput>ldconfig</userinput>
29 as the <systemitem class="username">root</systemitem> user.
30 </para>
31 </note>
32
33 <para>
34 To test the <application>Xorg</application> installation, issue
35 <command>startx</command>. This command brings up a rudimentary window
36 manager called <emphasis>twm</emphasis> with three xterm windows and one
37 xclock window. The xterm window in the upper left is a login terminal and
38 running <emphasis>exit</emphasis> from this terminal will exit the
39 <application>X Window</application> session. The third xterm window may
40 be obscured on your system by the other two xterms.
41 </para>
42
43 <note>
44 <para>
45 When testing <application>Xorg</application> with the
46 <application>twm</application> window manager, there will be several
47 warnings in the Xorg log file, <filename revision="sysv">
48 /var/log/Xorg.0.log</filename><filename revision="systemd">
49 $HOME/.local/share/xorg/Xorg.0.log</filename>, about missing font
50 files. In addition, there will be several warnings on the text mode
51 terminal (usually tty1) about missing fonts. These warnings do not
52 affect functionality, but can be removed if desired by installing
53 the <xref linkend="xorg7-legacy"/>.
54 </para>
55 </note>
56
57 <para>
58 Generally, there is no specific configuration required for
59 <application>Xorg</application>, but customization is possible. For
60 details, see <xref linkend='xconfig'/> below.
61 </para>
62
63 </sect2>
64
65 <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI
66 installation">
67 <title>Checking the Direct Rendering Infrastructure (DRI)
68 Installation</title>
69
70 <para>
71 DRI is a framework for allowing software to access graphics hardware in
72 a safe and efficient manner. It is installed in
73 <application>X</application> by default (using
74 <application>Mesa</application>) if you have a supported video card.
75 </para>
76
77 <para>
78 To check if DRI drivers are installed properly, check the log file
79 <filename revision="sysv">/var/log/Xorg.0.log</filename><filename
80 revision="systemd">$HOME/.local/share/xorg/Xorg.0.log</filename> for
81 statements such as:
82 </para>
83
84<screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
85
86 <para>or</para>
87
88<screen><literal>(II) NOUVEAU(0): Loaded DRI module</literal></screen>
89
90 <note>
91 <para>
92 DRI configuration may differ if you are using alternate drivers, such
93 as those from
94 <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
95 <ulink url="http://www.amd.com/">AMD</ulink>.
96 </para>
97 </note>
98
99 <para>
100 Although all users can use software acceleration, any hardware
101 acceleration (DRI2) is only available to <systemitem
102 class="username">root</systemitem> and members of the <systemitem
103 class="groupname">video</systemitem> group, but
104 <phrase revision="sysv"><emphasis>ConsoleKit2</emphasis></phrase>
105 <phrase revision="systemd"><emphasis>systemd-logind</emphasis></phrase>
106 takes care of adding any logged in user to the user ACL's of
107 <filename>/dev/dri/card*</filename>, the special file(s) allowing access
108 to hardware acceleration.<phrase revision="systemd"> So, no further
109 configuration is needed.</phrase>
110 </para>
111
112 <para revision="sysv">
113 If your driver is supported and <emphasis>ConsoleKit2</emphasis> is not
114 installed, add any users that might use X to the <systemitem
115 class="groupname">video</systemitem> group:
116 </para>
117
118<screen role="root" revision="sysv"><userinput>usermod -a -G video <replaceable>&lt;username&gt;</replaceable></userinput></screen>
119
120 <para>
121 Another way to determine if DRI is working properly is to use one of the
122 two optionally installed OpenGL demo programs in <xref
123 linkend="mesa"/>. From an X terminal, run <command>glxinfo</command>
124 and look for the phrase:
125 </para>
126
127<screen><computeroutput>name of display: :0
128display: :0 screen: 0
129direct rendering: Yes</computeroutput></screen>
130
131 <para>
132 If direct rendering is enabled, you can add verbosity by running
133 <command>LIBGL_DEBUG=verbose glxinfo</command>. This will show the
134 drivers, device nodes and files used by the DRI system.
135 </para>
136
137 <para>
138 To confirm that DRI2 hardware acceleration is working, you can (still in
139 the X terminal) run the command <command>glxinfo | egrep "(OpenGL
140 vendor|OpenGL renderer|OpenGL version)"</command>.
141 If that reports something <emphasis>other than</emphasis>
142 <literal>Software Rasterizer</literal> then you have working
143 acceleration for the user who ran the command.
144 </para>
145
146 <para>
147 If your hardware does not have any DRI2 driver available, it will use a
148 Software Rasterizer for Direct Rendering. In such cases, you can use a
149 new, LLVM-accelerated, Software Rasterizer called LLVMPipe. In order to
150 build LLVMPipe just make sure that <xref linkend="llvm"/> is present at
151 Mesa build time. Note that all decoding is done on the CPU instead of
152 the GPU, so the display will run slower than with hardware acceleration.
153 To check if you are using LLVMpipe, review the output of the glxinfo
154 command above. An example of the output using the Software Rasterizer
155 is shown below:
156 </para>
157
158<screen><computeroutput>OpenGL vendor string: VMware, Inc.
159OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
160OpenGL version string: 3.0 Mesa 10.4.5</computeroutput></screen>
161
162 <para>
163 You can also force LLVMPipe by exporting the
164 <envar>LIBGL_ALWAYS_SOFTWARE=1</envar> environment variable when
165 starting Xorg.
166 </para>
167
168 <para>
169 Again, if you have built the Mesa OpenGL demos, you can also run the test
170 program <command>glxgears</command>. This program brings up a window with
171 three gears turning. The X terminal will display how many frames were
172 drawn every five seconds, so this will give a rough benchmark. The window
173 is scalable, and the frames drawn per second is highly dependent on the
174 size of the window. On some hardware, <command>glxgears</command> will
175 run synchronized with the vertical refresh signal and the frame rate will
176 be approximately the same as the monitor refresh rate.
177 </para>
178
179 </sect2>
180
181 <sect2 role="configuration" id="hybrid-graphics" xreflabel="Hybrid Graphics">
182 <title>Hybrid Graphics</title>
183
184 <para>
185 Hybrid Graphics is still in experimental state for Linux. Xorg Developers
186 have developed a technology called PRIME that can be used for switching
187 between integrated and muxless discrete GPU at will. Automatic switching
188 is not possible at the moment.
189 </para>
190
191 <para>
192 In order to use PRIME for GPU switching, make sure that you are using
193 Linux Kernel 3.4 or later (recommended). You will need latest DRI and
194 DDX drivers for your hardware and <application>Xorg Server</application>
195 1.13 or later.
196 </para>
197
198 <para>
199 <application>Xorg Server</application> should load both GPU drivers
200 automaticaly. You can check that by running:
201 </para>
202
203<screen><userinput>xrandr --listproviders</userinput></screen>
204
205 <para>
206 There should be two (or more) providers listed, for example:
207 </para>
208
209<screen><computeroutput>Providers: number : 2
210Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:Intel
211Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 1 name:radeon</computeroutput></screen>
212
213 <para>
214 In order to be able to run a GLX application on a discrete GPU, you will
215 need to run the following command, where &lt;provider&gt; is the more
216 powerful discrete card, and &lt;sink&gt; is the card which has a display
217 connected:
218 </para>
219
220<screen><userinput>xrandr --setprovideroffloadsink <replaceable>&lt;provider&gt; &lt;sink&gt;</replaceable></userinput></screen>
221
222 <note>
223 <para>
224 With newer <application>Xorg</application> drivers, such as modesetting
225 or intel, which are DRI3 capable, the above command is no longer
226 necessary. It does no harm however.
227 </para>
228 </note>
229
230 <para>
231 Then, you will need to export the <envar>DRI_PRIME=1</envar> environment
232 variable each time you want the powerful GPU to be used. For example,
233
234<screen><userinput>DRI_PRIME=1 glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</userinput></screen>
235
236 will show OpenGL vendor, renderer and version for the discrete GPU.
237 </para>
238
239 <para>
240 If the last command reports same OpenGL renderer with and without
241 <envar>DRI_PRIME=1</envar>, you will need to check your installation.
242 </para>
243
244 </sect2>
245
246 <sect2 role="configuration" id='xconfig'>
247 <title>Setting up Xorg Devices</title>
248
249 <para>
250 For most hardware configurations, modern Xorg will automatically
251 get the server configuration correct without any user intervention. There
252 are, however, some cases where auto-configuration will be incorrect.
253 Following are some example manual configuration items that may be of use
254 in these instances.
255 </para>
256
257 <sect3 id="xinput">
258 <title>Setting up X Input Devices</title>
259 <para>
260 For most input devices, no additional configuration will be
261 necessary. This section is provided for informational purposes only.
262 </para>
263
264 <para>
265 A sample default XKB setup could look like the following (executed as
266 the <systemitem class="username">root</systemitem> user):
267 </para>
268
269<screen role="root"><userinput>cat &gt; /etc/X11/xorg.conf.d/xkb-defaults.conf &lt;&lt; "EOF"
270Section "InputClass"
271 Identifier "XKB Defaults"
272 MatchIsKeyboard "yes"
273 Option "XkbLayout" "fr"
274 Option "XkbOptions" "terminate:ctrl_alt_bksp"
275EndSection
276EOF</userinput></screen>
277
278 <para>
279 The <quote>XkbLayout</quote> line is an example for a French (AZERTY)
280 keyboard. Change it to your keyboard model. That line is not needed for
281 a QWERTY (US) keyboard.
282 </para>
283 </sect3>
284
285 <sect3 id="xdisplay">
286 <title>Fine Tuning Display Settings</title>
287
288 <para>
289 Again, with modern Xorg, little or no additional configuration is
290 necessary. If you should need extra options passed to your video driver,
291 for instance, you could use something like the following (again,
292 executed as the <systemitem class="username">root</systemitem> user):
293 </para>
294
295<screen role="root"><userinput>cat &gt; /etc/X11/xorg.conf.d/videocard-0.conf &lt;&lt; "EOF"
296Section "Device"
297 Identifier "Videocard0"
298 Driver "radeon"
299 VendorName "Videocard vendor"
300 BoardName "ATI Radeon 7500"
301 Option "NoAccel" "true"
302EndSection
303EOF</userinput></screen>
304
305 <para>
306 Another common setup is having multiple server layouts for use in
307 different environments. Though the server will automatically detect the
308 presence of another monitor, it may get the order incorrect:
309 </para>
310
311<screen role="root"><userinput>cat &gt; /etc/X11/xorg.conf.d/server-layout.conf &lt;&lt; "EOF"
312Section "ServerLayout"
313 Identifier "DefaultLayout"
314 Screen 0 "Screen0" 0 0
315 Screen 1 "Screen1" LeftOf "Screen0"
316 Option "Xinerama"
317EndSection
318EOF</userinput></screen>
319
320 </sect3>
321 </sect2>
322</sect1>
Note: See TracBrowser for help on using the repository browser.