标题:在 Fedora Core 5 上体验 Aiglx 和 Xgl & Compiz [2] 出处:ZAPPER'S Blog 时间:Mon, 28 Aug 2006 21:10:51 +0000 作者:zapper 地址:http://www.rnh19.com/gz/read.php/137.htm 内容: 最初是为了好玩,喜欢compiz的效果,再说FC5刚刚发布图新鲜,参照linuxsir的一些帖子装了一把,没想到喷到很多问题,再加上本来就是一个linux菜鸟,一玩就是半个多月,终于搞成功了,总结出一些经验,与大家分享。 好了开始正文: 一、安装显卡驱动 1、下载显卡驱动 首先要安装显卡驱动,打开显卡3D支持。 N系显卡最新驱动是8756,可以到nvidia网站下载(NVIDIA-Linux-x86-1.0-8756-pkg1.run) A系显卡最新驱动是8.24.8,可以到ATI网站下载,ATI显卡不同系列驱动不一样,请选择相应驱动,RADEON的驱动在这ati-driver-installer-8.24.8-x86.run 2、安装驱动 因为我使用的是MX440,所以下面以该显卡为例讲解,其他显卡请自行查找相关文档。 (安装驱动前,先运行以下glxgears,可以测试显卡3D性能,一般只有几百桢每秒。) 运行以下命令: 代码: init 3 切换系统运行级,中止X服务; 代码: chmod 755 NVIDIA-Linux-x86-1.0-8756-pkg1.run ./NVIDIA-Linux-x86-1.0-8756-pkg1.run -n --x-module-path=/usr/lib/xorg/modules 执行驱动安装,因为FC5的X服务转向xorg与X11的目录结构不同,所以要添加x-module-path选项(好像是这个原因,具体我也不太清楚,我是菜鸟),其他系统看具体情况决定是否加改参数。 等驱动安装完,回到提示符下 代码: init 5 这时候再执行一次glxgears,应该比驱动安装前高很多了,这就说明驱动安装成功了。 二、安装 xgl+compiz 声明:CVS代码可能每天都在变,今天的代码能编译,不代表明天的代码就能编译,有什么问题我只能按我碰到的情况帮大家解答,有些问题我没碰到的,可能大家只能自己找解决方法了 1、准备工作:让你的xorg能够direct rendring 首先安装glitz(因为Xgl里面的ChangeLog写了要latest glitz): cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo co glitz进入glitz目录: ./autogen.sh --prefix=/usr make && make install 下载xgl的源码: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co -r xgl-0-0-1 xserver/xorg 下载mesa的源码: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/mesa co Mesa 到我最近一次编译Xgl,需要六个包: 第一个xkbfile: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co lib/xkbfile./autogen.sh --prefix=/usr make && make install 第二个GL: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co proto/GL./autogen.sh --prefix=/usr make && make install 第三个drm: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/dri co drm./autogen.sh --prefix=/usr make && make install 第四个Fixes: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co proto/Fixes./autogen.sh --prefix=/usr make && make install 第五个Composite: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co proto/Composite./autogen.sh --prefix=/usr make && make install 第六个ScrnSaver: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co proto/ScrnSaver./autogen.sh --prefix=/usr make && make install 2、编译、安装Xgl 好了可以开始编译xgl了,在这里需要macros、fontenc、xkbui三个包,他们可以通过FC5的添加删除程序搜索到,这里说到的需要的包一般是指开发包,也就是带devel的,下面说到的编译需要的包一般也是指开发包,不再另外指出。我已开始总是编译不过去就是因为不清楚这一部分,所以这是成功编译的比较关键的地方: 上面的7个包(Mesa在这里先不要编译、安装)编译、安装成功后,进入xorg的目录: ./autogen.sh --prefix=/usr --disable-xorg --disable-dmx --disable-xvfb --disable-xnest --disable-xwin --enable-xgl --enable-xglx --with-mesa-source=/usr/src/Mesa --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --enable-glx-dri --disable-xprint --with-default-font-path=/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/TTF/,/usr/share/X11/fonts/OTF,/usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/CID/,/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/75dpi/ (注意:--with-mesa-source=/XXX,是你下载的mesa代码的目录) make && make install 3、编译compiz前的准备工作: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co app/compiz[code] 在编译compiz之前有一个准备工作,要下载control-center-2.14.0.tar.bz2源码,这里需要gnome-menus和libxklavier包: 解开: [code]tar -jxvf control-center-2.14.0.tar.bz2 进入control-center-2.14.0目录: ./configure --prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --sharedstatedir=/usr/share/com --localstatedir=/var configure完了以后不要直接make,而是进入libwindow-settings目录 cd libwindow-settings make && make install 另外,如果要让compiz支持svg需要安装三个包(libsvg cairo libsvg-cairo),这三个包的安装是有顺序的,也就是说libsvg-cairo必须在另外两个包安装成功后才能被成功编译、安装: 第一个libsvg: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo co libsvg./autogen.sh --prefix=/usr make && make install 第二个cairo: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo co cairo./autogen.sh --prefix=/usr --enable-svg make && make install 第三个libsvg-cairo: cvs -d :pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo co libsvg-cairo./autogen.sh --prefix=/usr make && make install 4、编译compiz: 好了可以编译compiz的代码了(需要pango gtk+ libwnck control-center包): 进入compiz目录: ./autogen.sh --prefix=/usr --enable-libsvg-cairo make && make install 5、剩下最后一步编译mesa的源代码(需要imake包): cd Mesa make linux-dri-x86 make install 程序会询问你将文件装到哪里,这个是包含了GLX_texture_form_pixmap支持的mesa,compiz要用到,所以运行compiz的时候要设置它找 libGL.so的路径, 即:LD_LIBRARY_PATH=/opt/lib compiz XXXXXXXXX 6、配置系统 配置gdm让它默认启动Xgl 用一下代码替换/etc/gdm/custom.conf # GDM Configuration Customization file. # # This file is the appropriate place for specifying your customizations to the # GDM configuration. If you run gdmsetup, it will automatically edit this # file for you and will cause the daemon and any running GDM GUI programs to # automatically update with the new configuration. Not all configuration # options are supported by gdmsetup, so to modify some values it may be # necessary to modify this file directly by hand. # # To hand-edit this file, simply add or modify the key=value combination in # the appropriate section in the template below. Refer to the comments in the # gdm.conf file for information about each option. Also refer to the reference # documentation. # # If you hand edit a GDM configuration file, you should run the following # command to get the GDM daemon to notice the change. Any running GDM GUI # programs will also be notified to update with the new configuration. # # gdmflexiserver --command="UPDATE_CONFIG " # # For example, the "Enable" key in the "[debug]" section would be specified by # "debug/Enable". # # You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and # re-read the new configuration settings. You can also restart GDM by sending # a HUP or USR1 signal to the daemon. HUP behaves like gdm-restart and causes # any user session started by GDM to exit immediately while USR1 behaves like # gdm-safe-restart and will wait until all users log out before restarting GDM. # # For full reference documentation see the gnome help browser under # GNOME|System category. You can also find the docs in HTML form on # http://www.gnome.org/projects/gdm/ # # NOTE: Lines that begin with "#" are considered comments. # # Have fun! [daemon] [security] [xdmcp] [gui] [greeter] [chooser] [debug] [servers] 0=Xgl [server-Xgl] name=Xgl server command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo flexible=true chooser=false handled=true priority=0 用以下代码替换/usr/bin/gnome-wm #!/bin/sh # The user can specify his prefered WM by setting the WINDOW_MANAGER # environment variable. # # If this is not set, we search a list of known windowmanagers and use # the first one that is found in the users's PATH # # sm-client-id value SMID= # default-wm value DEFWM= #read in the arguments GET= for n in "$@" ; do case "$GET" in smid) SMID=$n GET= ;; defwm) DEFWM=$n GET= ;; *) case "$n" in --sm-client-id) GET=smid ;; --default-wm) GET=defwm ;; esac ;; esac done # WINDOW_MANAGER overrides all OLDIFS=$IFS IFS=":" if [ -z "$WINDOW_MANAGER" ] ; then if [ -z "$DEFWM" -o "x$DEFWM" = "xgnome-wm" ]; then for wm in compiz metacity sawfish sawmill enlightenment icewm wmaker fvwm2 qvwm fvwm twm kwm ; do for dir in $PATH ; do if [ -x "$dir/$wm" ] ; then WINDOW_MANAGER="$dir/$wm" break 2 fi done done else WINDOW_MANAGER=$DEFWM fi fi IFS=$OLDIFS # If no window manager can be found, we default to xterm if [ -z "$WINDOW_MANAGER" ] ; then echo "WARNING: No window manager can be found." WINDOW_MANAGER=xterm fi # Now create options OPT1 and OPT2 based on the windowmanager used OPT1= OPT2= if [ ! -z "$SMID" ] ; then case `basename $WINDOW_MANAGER` in sawfish|sawmill|metacity) OPT1=--sm-client-id=$SMID ;; openbox) OPT1=--sm-client-id OPT2=$SMID ;; enlightenment|twm) OPT1=-clientId OPT2=$SMID ;; lwm) OPT1=-s OPT2=$SMID ;; compiz) OPT1="--sm-client-id $SMID" OPT2="gconf decoration wobbly fade minimize cube rotate zoom scale move resize place switcher water" ;; #FIXME: add all other windowmanagers here with their proper options esac fi LD_LIBRARY_PATH=/usr/local/lib exec $WINDOW_MANAGER $OPT1 $OPT2 echo "ERROR: No window manager could run!" 注意:这里的LD_LIBRARY_PATH=/usr/local/lib就是前面Mesa的安装目录,确省目录是这一个,如果你做了修改,请自行改成相应目录。 配置gnome会话,让gnome启动的时候运行gnome-window-decorator 注意事项: 如果是使用ATI显卡的fglrx驱动的话,记得Xgl要从DISPLAY 1启动,即 1=Xgl /usr/bin/Xgl :1 -fullscreen -ac -accel glx:pbuffer -accel xv:pbuffer 而不是 0=Xgl /usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo 好了,现在可以重新启动Xserver,看看绚丽的桌面了。 这里有一些Xgl+compiz的Howto,大家可以参考一下。 声明:以上环境是在FC5+2080内核+gnome下完成的,不同环境也许有不同的问题,大家提出来我会尽我所能回答,不过我也是菜鸟,能力有限。 引用自: CCF精品技术论坛 Generated by Bo-blog 2.0.3 sp1