Saturday, January 27, 2007

ubuntu(edgy) xgl安装日记

先是试了好多方法都没能让显卡的3D加速跑起来,然后在ubuntu主页上的一篇文章下随便试了下,本想失败就放弃的,没想到成了~:
http://www.ubuntuforums.org/showthread.php?t=291464
以 deb http://www.beerorkid.com/compiz edgy main-edgy 资源为主

我的显卡是Radeon 9200。
第一步是安装ubuntu给ati显卡配的驱动fglrx:
$ sudo aptitude update
$ sudo aptitude dist-upgrade
$ sudo aptitude install xorg-driver-fglrx
# You will have to do this for every kernel update
$ sudo aptitude install linux-restricted-modules-`uname -r`
$ sudo cp /lib/modules/`uname -r`/volatile/fglrx.ko /lib/modules/`uname -r`/misc/fglrx.ko
$ sudo aptitude remove linux-restricted-modules-`uname -r`
$ sudo depmod -a
# If you know what you are doing, you can just edit xorg.conf manually to use fglrx
$ sudo aticonfig --initial
$ sudo aticonfig --overlay-type=Xv

$ sudo gedit /etx/X11/xorg.conf在xorg.conf添加:
Section "Extensions"
Option "Composite" "0"
EndSection

(补充一条自动检测显卡的命令 "sudo dpkg-reconfigure xserver-xorg")
选择一 重启
选择二 登出到控制台stop gdm, rmmod radeon and modprobe fglrx, 然后start gdm.

用 $ fglrxinfo 查看:
display: :0.0  screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: MOBILITY/RADEON 9000 DDR Generic
OpenGL version string: 1.3.1091 (X4.3.0-8.28.8)

或者还有一个很好用的命令
$glxinfo | grep rendering
确定verdering string是ati而不是mesa!我起初就是这里错了。

第二步是安装xgl及一个用于OpenGL的管理工具(compiz或者beryl):
beryl可以从
deb http://ubuntu.beryl-project.org edgy main-edgy 获得
使用apt工具下载并安装其中一个。

第三步是配置:
先配置xgl运行脚本,创建"/usr/bin/startxgl"并添加内容

#!/bin/sh
Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
DISPLAY=:1
exec dbus-launch --exit-with-session gnome-session

命令 "$ sudo chmod +x /usr/bin/startxgl" 使其可执行
再给xgl创建一个启动session,创建"/usr/share/xsessions/xgl.desktop":
[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Comment=Start an Xgl Session
Exec=/usr/bin/startxgl
Icon=
Type=Application

随后登出,再用xgl的会话登入,然后开启安装的compiz-manager或beryl-manager就可以看到效果了。

郁闷啊,装了半天居然只能看两个效果,而且还时不时crack掉 -_-b。
显卡不行呀,虽然我几乎就是白装了,但希望这篇文章能对正在尝试给ubuntu装xgl的读者有所帮助。
个人觉得两个地方特别要花时间,一个是启动显卡的3D加速(可能NVIDIA会好一点),另一个是找compiz或者beryl的源。

No comments: