清北服务网站-QuickBest's Archiver

chinakr 发表于 2007-3-19 10:40

gentoo ATi(Radeon 9000)显卡双显示器安装配置手记 2006-12-21

<P>来源: <A href="http://www.xxlinux.com/linux/article/accidence/install/20061221/6548.html" target=_blank>点击进入</A><BR>作者: xxlinux(转载)  日期: 2006-12-21(转载日期)</P>
<P> </P>
<P>有两个选择:一是用 ATI 自己提供的驱动(<A href="http://gentoo-wiki.com/HOWTO_ATI_Drivers" target=_blank><FONT color=#0000ff>参考链接</FONT></A>);二是利用开源驱动(<A href="http://gentoo-wiki.com/HOWTO_DRI_with_ATi_Open-Source_Drivers" target=_blank><FONT color=#0000ff>参考链接</FONT></A>)。他们的配置方式有些不同,安装的包自然是不一样的。<BR><BR>我首先采用的是 开源驱动 来安装的,当时有些问题没有处理好以失败告终,后来利用 ATI 的驱动时才有所体会。开源驱动肯定是可以用的。但本文还是以 ATI 提供的驱动做实例。基本上是按照 how to 来说明的。<BR><BR style="COLOR: rgb(0,153,2)"><FONT style="COLOR: rgb(0,153,2)" size=3>1. 内核配置</FONT> (针对 2.6, 我采用的版本是 2.6.17-gentoo-r8)<BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># cd /usr/src/linux <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># make menuconfig</P></TD></TR></TBODY></TABLE>按照 how to 来作就好了。<BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">General setup ---&gt;</P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">() Local version - append to kernel release (Currently, ati-drivers won't fully compile if you append anything to your version) <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">Loadable Module Support ---&gt; <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">[*] Enable loadable module support <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">[*] Module unloading <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">Processor type and features ---&gt; <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">[*] MTRR (Memory Type Range Register) support <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">Device Drivers ---&gt; <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">Character Devices ---&gt; <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">&lt;M&gt; /dev/agpgart (AGP Support) <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">&lt;M&gt; Your_AGP_Chipset_Here <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">&lt; &gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">Graphics support ---&gt; <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">[ ] Support for framebuffer devices <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">Kernel Hacking ---&gt; <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">[ ] Kernel debugging </P></TD></TR></TBODY></TABLE><BR>但这里有一点要指出的是,也是很容易搞错的地方。在选项<BR>&lt;M&gt; /dev/agpgart (AGP Support) 的子项中不要想当然地认为自己显卡是 ATI 的就选了<BR>&lt;M&gt;   ATI chipset support<BR>我开始就是犯了这个错误。(我想,这里应该是指主板的芯片类型支持)你可以这样来确定:<BR>
<TABLE style="WIDTH: 557px; BORDER-COLLAPSE: collapse; HEIGHT: 31px" borderColor=#999999 cellSpacing=0 cellPadding=0 bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># lspci | grep AGP</P></TD></TR></TBODY></TABLE><BR>比如我的机器是:<BR>00:01.0 PCI bridge: Intel Corporation 82845G/GL[Brookdale-G]/GE/PE Host-to-AGP Bridge (rev 03)<BR>所以我这里应该是:<BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">&lt;M&gt; /dev/agpgart (AGP Support) <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">&lt; &gt; ATI chipset support <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">&lt;M&gt; Intel 440LX/BX/GX, I8xx and E7x05 chipset support</P></TD></TR></TBODY></TABLE><BR>注意:别忘了编译、安装新内核,并以新的内核来引导系统。<BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># make && make modules_install <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># cp arch/i386/boot/bzImage /boot/kernel-2.6.17-gentoo-r8</P></TD></TR></TBODY></TABLE><BR>在启动引导菜单中加入新的引导选项,我的机器采用 grub,<BR>/boot 分区在 /dev/hda8, / 分区在/dev/hda10,所以:<BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># vim /boot/grub/grub.conf <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">title Gentoo Linux 2.6.17-r8 (ATI Radeon 9000 driver) <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">    root (hd0,7) <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">    kernel /kenerl-2.6.17-gentoo-r8 root=/dev/hda10 <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># reboot </P></TD></TR></TBODY></TABLE><BR><FONT style="COLOR: rgb(0,153,2)" size=3>2. 安装驱动</FONT><BR>你用新的内核启动后,通常没法进入登录窗口,因为新的显卡驱动还没有安装,你的 X 配置没有更改。。。<BR>你可以在 reboot 前将默认启动登录窗口禁止。<BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># rc-update del xdm default <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">或者 在无法启动登录界面时,按 CTRL-ALT-F1 然后在文字终端登录,并且运行 <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># /etc/init.d/xdm stop </P></TD></TR></TBODY></TABLE><BR>现在安装驱动了。<BR>howto 上讲了一下关于去掉 dlloader 的选择的问题,如果你的 xorg-x11 安装时用了这个选项的话,那你要重新编译 xorg-x11 了。<BR>你大概也不用做那些 umask 的设置了,默认选项里面是直接可以安装的。<BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># emerge -av x11-drivers/ati-drivers x11-apps/ati-drivers-extra <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># env-update && source /etc/profile <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># modprobe fglrx <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># eselect opengl set ati </P></TD></TR></TBODY></TABLE><BR>你需要 copy 一些文件到指定的目录<BR># find /usr -iname fglrx_dri.so<BR>通常在 /usr/lib/dri/ 目录下<BR># ls /usr/lib/dri <BR>atiogl_a_dri.so  fglrx_dri.so  r200_dri.so  r300_dri.so  radeon_dri.so<BR>HowTo 里面说只用 copy fglrx_dri.so 就行了,但后来发现 atiogl_a_dri.so 这个文件也要用的,就都 cp 过去好了。<BR>HowTo 里面描述的目标目录是 /usr/X11R6/lib/modules/dri/ 也就是 /usr/lib/modules/dri/ 但后来发现链接库找的目录是 /usr/lib/dri, 所以你要是防止出现问题的话不妨多做几个链接,或者根据错误信息来定位目录。<BR># cp /usr/lib/dri/* /usr/X11R6/lib/modules/dri/<BR>别忘了做这一步,在别的系统上应该是 ldconfig, 但在gentoo 上做ldconfig 是不够的。<BR># env-update <BR><BR><FONT style="COLOR: rgb(0,153,2)" size=3>3. 配置 X</FONT><BR># /opt/ati/bin/aticonfig --initial --input=/etc/X11/xorg.conf<BR>不过,我觉得在<A href="http://www.linuxsir.org/bbs/showthread.php?t=271537" target=_blank><FONT color=#0000ff>链接</FONT></A>里面的描述来配置更好。<BR><BR>我单个屏幕的设置是 1024x768,做水平扩展后的就是 2048x768 了。<BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># export PATH=/opt/ati/bin:$PATH <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># aticonfig --initial=dual-head --screen-layout=right <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># aticonfig --dtop=horizontal --overlay-on=1 <BR></P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># aticonfig --resolution=0,2048x768,1024x768 </P></TD></TR></TBODY></TABLE>现在去你的 X 配置文件看看,里面有一些选项已经添加或者更改了。<BR># vim /etc/X11/xorg.conf<BR>如果你启动 X 后,发现了错误,你可能要修改里面的配置了。<BR></P>
<P>可以启动 X 了。<BR># startx<BR>不过我大都选用登录窗口来启动新的会话<BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%"># /etc/init.d/xdm start</P></TD></TR></TBODY></TABLE><BR>看看启动后桌面有什么不同吗?如果你的 gdm 登录窗口没有象预期的那样扩展到两个显示器上面,或者你的桌面没有扩展,我只能说你很幸运,因为你可以在解决这些问题的同时来提升自己对系统的了解。;-)<BR><BR>我碰到的一些问题。<BR><SPAN style="COLOR: rgb(0,1,2)">1) $ /opt/ati/bin/fglrxinfo</SPAN><BR>display: :0.0 screen: 0<BR>OpenGL vendor string: Mesa project: [url]www.mesa3d.org[/url]<BR>OpenGL renderer string: Mesa GLX Indirect<BR>OpenGL version string: 1.2 (1.5 Mesa 6.2.1)<BR>我被这个问题磨练了好久,正确的显示结果应该是<BR>display: :0.0  screen: 0<BR>OpenGL vendor string: ATI Technologies Inc.<BR>OpenGL renderer string: MOBILITY/RADEON 9000 DDR Generic<BR>OpenGL version string: 1.3.1091 (X4.3.0-8.27.6)<BR>你首先应该做这些:<BR>(1)确认你的驱动模块已经启动<BR># lsmod <BR>fglrx                 392300  8<BR>intel_agp              23708  1<BR>agpgart                35532  2 fglrx,intel_agp<BR>如果没有,用 modprobe 来加载模块<BR>并编辑自动模块加载文件,例如我的机器:<BR># vim /etc/modules.autoload.d/kernel-2.6.17-gentoo-r8<BR>fglx<BR>intel_agp<BR>agpgart<BR>以让下次启动时这些模块自动加载。<BR># modules-update<BR><BR>(2) 编辑 /etc/X11/xorg.conf 文件确认<BR><BR>Section "Extensions"<BR>        Option      "Composite" "false"<BR>EndSection<BR><BR>(3) 如果你上面都确认了,你这时重启系统比较好。<BR><BR>(4) 如果你还要往下看的话。这里有一些建议:如果你开始也像我一样尝试了 开源驱动 的话,并且按照开源驱动做了相应的配置了,你要尝试一下去卸载那些包或者更改那些相关配置文件。如果你采用手动删除那些包的话(并不推荐),别忘了做 env-update 。<BR><BR>2) 每个人的机器可能配置不一样,所以解决方法可能有区别。但有一种解决方式是一致的,那就是 google your problems 了,有做广告的嫌疑了 ;-)<BR><BR>3) 消除日志文件 /var/log/Xorg.0.log 用(EE)标识的每一个错误后,通常你就成功了。本文最后列出我的 /etc/X11/xorg.conf 文件内容,我觉得这个参考价值比较大一些。<BR><FONT style="COLOR: rgb(0,153,2)" size=3><BR>4. 最后的提醒</FONT> (你一定要看的,我在这上面浪费了不少时间,绝对是浪费)<BR><BR>如果你的以前系统屏幕的分辨率是 1024x768(我想这种情况的比较多), 并且你平时都是用普通用户登录的(不推荐用root来登录系统),那么咱俩的情形就相同了。<BR>我的情况:gdm 登录屏幕是扩展的,但登录后,桌面是那种 clone 模式,也就是两个桌面显示相同的内容,但明明在 /etc/X11/xorg.conf 里面设置的是水平扩展,于是我就比较郁闷了,在用 root 登录看看,发现桌面是按照预期扩展的,我就纳闷了,难道是用户的问题?但我确认了自己的用户在 video 组里面,并且在xorg.conf文件里也有对应的设置。我非常困惑了。又 google 了好久,不抖包袱了,但确实是里面的某一文章说到了一下分辨率的问题,我被触动了,一看分辨率,当前的还是 1024x768,于是我改了一下,选用 2048x768,大功告成!!<BR><FONT size=3><BR style="COLOR: rgb(0,153,2)"><SPAN style="COLOR: rgb(0,153,2)">5. 一些应用程序相关的问题</SPAN></FONT><BR>目前只发现 acroread 有些问题<BR>(1) 关于 Adobe Reader (7.0.8 chs) 的字体变得超宽,可读性极差。几经试探,发现可以这样解决:<BR><BR><SPAN style="FONT-STYLE: italic; TEXT-DECORATION: underline">菜单==&gt;&gt;编辑==&gt;&gt;首选项==&gt;&gt;分辨率</SPAN> <BR><BR>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1>
<TBODY>
<TR>
<TD>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">( )使用系统分辨率 当前显示: 158 像素/英寸</P>
<P style="MARGIN: 5px; LINE-HEIGHT: 150%">(*)自定义分辨率: 158 像素/英寸</P></TD></TR></TBODY></TABLE><BR>很奇怪,这样设置就 Ok 了。有些晕。不管它了。<BR></P>
<P><SPAN style="FONT-STYLE: italic; TEXT-DECORATION: underline"><FONT color=#ff9902>后记</FONT></SPAN>:<BR>双显示器的好处还是显而易见的,你一边写代码一看文档,不用来回使 Atl+tab Ctrl+c Ctrl+v 了;你可以对照两篇文章来看,等等。一句话,好不好,用了才知道。<BR><BR>/etc/X11/xorg.conf<BR>#########################################################<BR>Section "ServerLayout"<BR>    Identifier     "X.org Configured"<BR>    Screen      0  "aticonfig-Screen[0]" 0 0<BR>    InputDevice    "Mouse0" "CorePointer"<BR>    InputDevice    "Keyboard0" "CoreKeyboard"<BR>EndSection<BR><BR>Section "Files"<BR><BR>    # FontPath     "/usr/share/fonts/CID/"<BR>    RgbPath      "/usr/share/X11/rgb"<BR>    ModulePath   "/usr/lib/xorg/modules"<BR>    FontPath     "/usr/share/fonts/misc/"<BR>    FontPath     "/usr/share/fonts/TTF/"<BR>    FontPath     "/usr/share/fonts/OTF"<BR>    FontPath     "/usr/share/fonts/Type1/"<BR>    FontPath     "/usr/share/fonts/100dpi/"<BR>    FontPath     "/usr/share/fonts/75dpi/"<BR>EndSection<BR><BR>Section "Module"<BR>    Load  "glx"<BR>    Load  "extmod"<BR>    Load  "vnc"<BR>    Load  "xtrap"<BR>    Load  "record"<BR>    Load  "dbe"<BR>    Load  "dri"<BR>    Load  "drm"<BR>    Load  "freetype"<BR>    Load  "type1"<BR>EndSection<BR><BR>Section "InputDevice"<BR>    Identifier  "Keyboard0"<BR>    Driver      "kbd"<BR>EndSection<BR><BR>Section "InputDevice"<BR>    Identifier  "Mouse0"<BR>    Driver      "mouse"<BR>    Option        "Protocol" "IMPS/2"<BR>    Option        "ZAxisMapping" "4 5"<BR>    Option        "Device" "/dev/input/mice"<BR>    Option        "Name" "USB Mouse"<BR>EndSection<BR><BR>Section "Monitor"<BR>    Identifier   "aticonfig-Monitor[0]"<BR>    Option        "VendorName" "ATI Proprietary Driver"<BR>    Option        "ModelName" "Generic Autodetecting Monitor"<BR>    Option        "DPMS" "true"<BR>EndSection<BR><BR>Section "Monitor"<BR>    Identifier   "aticonfig-Monitor[1]"<BR>    Option        "VendorName" "ATI Proprietary Driver"<BR>    Option        "ModelName" "Generic Autodetecting Monitor"<BR>    Option        "DPMS" "true"<BR>EndSection<BR><BR>Section "Device"<BR>    Identifier  "aticonfig-Device[0]"<BR>    Driver      "fglrx"<BR>    Option        "UseInternalAGPGART" "no"<BR>    Option        "DesktopSetup" "horizontal"<BR>    Option        "VideoOverlay" "on"<BR>    Option        "UseFastTLS" "2"<BR>    Option         "EnablePrivateBackZ" "on"<BR>    Option        "OverlayOnCRTC2" "1"<BR>    BusID       "PCI:1:0:0"<BR>EndSection<BR><BR>Section "Device"<BR>    Identifier  "aticonfig-Device[1]"<BR>    Driver      "fglrx"<BR>    BusID       "PCI:1:0:0"<BR>    Screen      1<BR>EndSection<BR><BR>Section "Monitor"<BR><BR>    #DisplaySize      300   230    # mm<BR> ### Comment all HorizSync and VertSync values to use DDC:<BR>        # These are the DDC-probed settings reported by your monitor.<BR>        # 1280x1024, 75.0Hz; hfreq=79.98, vfreq=75.03<BR>    Identifier   "Default_Monitor"<BR>    VendorName   "GSM"<BR>    ModelName    "S"<BR>    HorizSync    30.0 - 63.0<BR>    VertRefresh  56.0 - 75.0<BR>    ModeLine     "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync<BR>    ModeLine     "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync<BR>    ModeLine     "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync<BR>    ModeLine     "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -hsync -vsync<BR>    ModeLine     "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync<BR>    ModeLine     "800x600" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync<BR>    ModeLine     "800x600" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync<BR>    Option        "DPMS"<BR>EndSection<BR><BR>Section "Screen"<BR>    Identifier "aticonfig-Screen[0]"<BR>    Device     "aticonfig-Device[0]"<BR>    Monitor    "aticonfig-Monitor[0]"<BR>    DefaultDepth     24<BR>    SubSection "Display"<BR>        Viewport   0 0<BR>        Depth     24<BR>        Modes    "2048x768" "1024x768"<BR>    EndSubSection<BR>EndSection<BR><BR>Section "Screen"<BR>    Identifier "aticonfig-Screen[1]"<BR>    Device     "aticonfig-Device[1]"<BR>    Monitor    "aticonfig-Monitor[1]"<BR>    DefaultDepth     24<BR>    SubSection "Display"<BR>        Viewport   0 0<BR>        Depth     24<BR>    EndSubSection<BR>EndSection<BR><BR>Section "DRI"<BR>    Group        "video"<BR>    Mode         0666<BR>EndSection<BR><BR>Section "Extensions"<BR>    Option        "Composite" "false" # "Enable"<BR>    Option        "XVideo" "Enable"<BR>EndSection<BR><BR>Section "ServerFlags"<BR>    Option        "AIGLX" "off"<BR>EndSection<BR></P>

chinakr 发表于 2008-11-30 12:51

温故知新

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.