source: x/installing/xorg-config.xml@ 88902ba7

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 88902ba7 was d43c7a1, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Archive gtk-xfce-engine and xfce4-kbd-plugin.
Move libwnck2 to lxde.
Tag lxde dependencies.

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

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