Open DRI in Linux (Reprinted from Minzhu's pickles)

Source: Internet
Author: User
Open DRI in Linux (Reprinted from Minzhu's pickles)-Linux general technology-Linux technology and application information. The following is a detailed description. Author: Minzhu's pickles

This post is a process I have experienced when installing Compiz today (a 3D desktop environment similar to Bery, but may be replaced by Bery in the future. The content described here is currently only for my own work environment: X24 + Fedora6 + gnome

Compiz is included in Fedora6, but the Compiz version that comes with the original installation disk is too low. You need to update it. I am used to deleting it before installing it and running it as root:
Yum remove compiz

Yum install-y compiz

Remember to connect to the Internet at this stage.

Enable Compiz in Gnome:
System> preferences> desktop Effect
Click "enable desktop effect", but an error is reported, indicating that the desktop cannot be run.

Since Compiz is based on XGL, I run the following command line:

Glxgears

Normal, the gear is active, but the speed is very slow.
Because OpenGL on linux is Mesa, it relies heavily on the underlying DirectRenderInterface (DRI) and graphics card driver.

Run the following command:
Lsmod

See
DRM: Radeon

It indicates that the video card driver is normal, and DRI is faulty.
View
/Var/log/Xorg.0.log

The following information is found:

....
(=) RADEON (0): Using 24 bit depth buffer
(EE) RADEON (0): Static buffer allocation failed. Disabling DRI.
(EE) RADEON (0): At least 9216 kB of video memory needed at this resolution and depth.

....
(WW) RADEON (0): Direct rendering disabled
....

The 3rd line clearly shows that the X24 graphics card's built-in memory (8 Mb) is not enough, and the demand for video memory is determined by the resolution and color number set on the desktop, my current is:
1024x768 24 bit color
I changed the 24-bit color to 16-bit, restarted the XWindow, and solved the problem.
(Please note that you can manually add the following content at the end of the/etc/X11/xorg. conf file as root:
Section "DRI"
Group "video"
Mode 0660
EndSection

To ensure that all users can use DRI.

Because DRI is normal, this is a test
Glxgears
It's much faster.
System> preferences> desktop Effect
Everything is normal. You can rotate the desktop in 3D mode, and the effect of dragging the window is much more vivid.

I'm so glad that I finally knew where the problem was.
I made the following attempts:
1. [root @ localhost/] # ln-s/usr/lib/dri/r300_dri.so/usr/lib/xorg/modules/dri/r300_dri.so

According to the above statement, it may be that my dri is not configured, but when I connect with the above command, the prompt file already exists, so this should not be the problem. In addition, I checked the relevant files under/var/log and checked the error information. The dri part was successfully loaded. If it does not exist, the path cannot be loaded because it is incorrect.

2. [root @ localhost luyaotang] # LIBGL_DEBUG = verbose glxinfo
Name of display: 0.0
LibGL: XF86DRIGetClientDriverName: 5.2.0 r300 (screen 0)
LibGL: OpenDriver: trying/usr/lib/dri/r300_dri.so
LibGL error: dlopen/usr/lib/dri/r300_dri.so failed (/usr/lib/dri/r300_dri.so: undefined symbol: _ glapi_get_dispatch)
LibGL error: unable to find driver: r300_dri.so
LibGL: XF86DRIGetClientDriverName: 5.2.0 r300 (screen 0)
LibGL: OpenDriver: trying/usr/lib/dri/r300_dri.so
LibGL error: dlopen/usr/lib/dri/r300_dri.so failed (/usr/lib/dri/r300_dri.so: undefined symbol: _ glapi_get_dispatch)
LibGL error: unable to find driver: r300_dri.so
Display: 0 screen: 0
Direct rendering: No
Server glx vendor string: SGI
Server glx version string: 1.2.

There are still problems with loading the library files, but it is not because the path does not exist. Baidu does not find the file, but GOOGLE does find it. In fact, Google is necessary to use Linux. The fglrx configuration, or the driver itself conflicts with our radeon and needs to be uninstalled.

3. [root @ localhost luyaotang] # yum remove kmod-fglrx xorg-x11-drv-fglrx
After this step, the problem persists.

4. Take a try and remove the configuration related to fglrx from/etc/profile. d.
[Root @ localhost luyaotang] # mv/etc/profile. d/ati-fglrx.sh/btdown/

5. Try again.
[Luyaotang @ localhost ~] $ Glxinfo | grep direct
LibGL warning: 3D driver claims to not support visual 0x4b
Direct rendering: Yes
3D acceleration has been successfully enabled.

6. Test the acceleration score. I don't know if I do not test it. I smiled at the test and found that there were more than 3 K. I didn't configure more than 1 K before:
[Luyaotang @ localhost ~] $ Glxgears
LibGL warning: 3D driver claims to not support visual 0x4b
15743 frames in 5.0 seconds = 3148.550 FPS
16727 frames in 5.0 seconds = 3345.365 FPS
16730 frames in 5.0 seconds = 3345.780 FPS
16725 frames in 5.0 seconds = 3344.950 FPS
16719 frames in 5.0 seconds = 3343.772 FPS
16729 frames in 5.0 seconds = 3345.648 FPS
16730 frames in 5.0 seconds = 3345.866 FPS
16711 frames in 5.0 seconds = 3342.129 FPS
16729 frames in 5.0 seconds = 3345.748 FPS
/=====================================/

/Etc/X11/xorg. conf configuration file
Xorg configuration created by system-config-display

Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Module"
Load "dri"
Load "glx"
Load "drm"
Load "type1"
Load "extmod"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "Monitor"
Identifier "Monitor0"
HorizSync 30.0-80.1
VertRefresh 80.5-90.5
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "radeon"
Option "AGPMode" "8"
Option "EnablePageFlip" "on"
Option "XAANoOffscreenPixmaps" "true"
Option "XaaNoScanlineImageWriteRect"
Option "XaaNoScanlineCPUToScreenColorExpandFill"
BusID "PCI: 1: 0: 0"
Screen 0
Option "define topsetup" "single"
Option "VideoOverlay" "on"
Option "OpenGLOverlay" "off"
Option "AddARGBGLXVisuals" "True"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768" "1024x768" "800x600" "800x600" "640x480" "640x480"
EndSubSection
Monitor "Monitor0"
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

Section "DRI"
Mode 0666
EndSection


After installation is correct, modify xorg. conf:
Section "Module"
# Load "GLcore"
Load "bitmap"
Load "ddc"
Load "dbe"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "type1"
Load "vbe"
EndSection
----------------------------
Section "Device"
Identifier "Intel Corporation Intel Default Card"
Driver "i810"
Option "XAANoOffscreenPixmaps"
BusID "PCI: 0: 2: 0"
EndSection
-------------------------
Section "ServerLayout"
Option "AIGLX" "true"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
EndSection

Then modify/etc/TPD. conf-custom:
[Servers]
0 = aiglx

[Server-aiglx]
Name = aiglx server
Command =/usr/bin/Xorg-air: 0
Flexible = true

Exit and restart the system.
Sudo/etc/init. d/MCM restart

OK! No surprise, you can see a 3D desktop as dazzling as XGL!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.