HOWTO ATI Drivers

出自Gentoo Linux Wiki

跳转到: 导航, 搜索
这篇文章属于 HOWTO 系列的一部分。
安装方法 架构/平台 内核 & 硬件 Portage 系统相关 网络 & 服务器 X服务器 软件 游戏 非x86平台

目录

[编辑] 介绍

这个指南可以帮助你安装和配置 ATI 的闭源显卡驱动。对应所有 8.8.25(05年1月发行)版以前的 fglrx ,其实对于其他版本一样有效。

  • 注意: Nvidia 的显卡驱动对 Linux 的支持要比 ATI 好的多。
  • 注意: 对 ATI X850 以上的显卡,已经有自由的 DRI 驱动可用。对于 Radeon 9250 以上的显卡已经很稳定了,并支持很多特性。但是 9500 到 X850 的显卡还不能象ATI的闭源驱动那样支持全部的特性。自由驱动 DRI 的 wiki 里有更多的信息 http://dri.freedesktop.org/wiki/

[编辑] 内核配置

进入 menuconfig (cd /usr/src/your-kernel && make menuconfig) 然后检查下面的内容:

Linux Kernel Configuration: ATI Drivers
Loadable Module Support --->
 [*] Enable loadable module support
   [*]   Module unloading 

Processor type and features  --->
 [*] MTRR (Memory Type Range Register) support

Device Drivers --->
 Character Devices ---> 
  <M> /dev/agpgart (AGP Support)  
    <M> Your_AGP_Chipset_Here
  [ ] Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

 Graphics support --->
  [ ]  Support for framebuffer devices

Kernel Hacking --->
  [ ] Kernel debugging

按照上面列出的内容修改你的内核配置。

要知道 -mm 和 -rc(1,2,3,4,...) 系列的内核经常由于意外的语法变更导致 fglrx 被破坏。如果你想使用 ati-drivers,请安装 gentoo-sources 或者最新稳定版的 2.4 或 2.6 内核!

别忘了编译、安装,然后重新启动系统来使用新的内核。如果对于重新编译内核有困难,请看 如何手工编译内核.

我有一块 Radeon 9500/9600(不确定是哪个) 的显卡,电脑是 Dell Inspiron 8600,可以编译进 framebuffer 设备的支持。我使用 vesa-tng framebuffer 设备来让 fbsplash 工作。我的内核版本是 2.6.14-gentoo-r2。 运行程序 'fglrxinfo' 显示我的 3D 硬件加速已经打开。

[编辑] 安装驱动

退出 X 到命令行下来安装比较容易。使用你的窗口管理器来做这件事:注销,然后按 CTRL-ALT-F1 来到控制台,用 root 登陆,并停止 xdm 。

# /etc/init.d/xdm stop

确保 xorg-x11 没有使用 USE 标志 dlloader 来编译。

# equery uses xorg-x11

(注意:equery是gentoolkit package的一部分。也许你需要安装它 code: # emerge gentoolkit)


  • 重新编译 xorg-x11 使用 -dlloader ,如果原来使用了 dlloader 标志。

安装驱动:

$ su -
# emerge -av x11-drivers/ati-drivers 
  • 如果需要的话,Unmask 驱动以及它所依赖的包。

可选的: 安装 x11-apps/ati-drivers-extra,它是 ATI 驱动的控制面板

echo "x11-apps/ati-drivers-extra -arch" >> /etc/portage/package.keywords

更新环境

env-update && source /etc/profile

加载内核模块并切换到 ATI 的 OpenGL 子系统

# modprobe fglrx
# eselect opengl set ati
警告: 非常重要: 反对使用 opengl-update 来切换 OpenGL,千万不要用!

[编辑] 配置 X

[编辑] 选项 1: 比较新的驱动(8.21.7 或者更新的版本)

8.35.5以前:

 # /opt/ati/bin/aticonfig --initial --input=/etc/X11/xorg.conf

8.35.5 以后:

 # /opt/bin/aticonfig --initial --input=/etc/X11/xorg.conf

(如果此命令没有创建一个有效Xorg环境,打开你的xorg.conf文件,找到标记为 "Device"段的区域,修改driver "fglrx" 为 "radeon"。这将切换Xorg使用 opensource driver)

  • 显示 aticonfig 额外的选项,输入:

8.35.5以前:

# /opt/ati/bin/aticonfig --help | less

8.35.5 以后:

 # /opt/bin/aticonfig --help | less


[编辑] 选项 2: 比较旧的驱动 ( 8.21.7 以前的版本)

# fglrxconfig

[编辑] 测试刚才生成的配置

现在,让我们回到 X。

$ startx

打开一个虚拟终端,然后运行:

$ /opt/ati/bin/fglrxinfo or $ /opt/bin/fglrxinfo

如果 OpenGL 供应商字符那里显示 "ATI Technologies," 祝贺你! 你已经成功安装上驱动并且打开了硬件加速。如果没有的话,接着往下看吧……

[编辑] 故障解决

[编辑] 配置文件

默认情况下,驱动程序使用内部 AGPGART。不过有时侯内部的可能没用,那我们就需要使用内核提供的。在你的 xorg.conf 文件里搜索选项 "UseInternalAGPGART." 直接把 "yes" 改成 "no."

如果你没找到那个选项,那就自己添加了,把它加到 "Device" 小节里 Driver "fglrx" 的下面:

文件: xorg.conf
Option "UseInternalAGPGART" "no"


现在直接把模块名添加到 /etc/modules.autoload.d/kernel-2.x x 是你内核的版本。

添加以下内容 (顺序非常重要):

文件: /etc/modules.autoload.d/kernel-2.x
agpgart
intel-agp # 把 intel-agp 改成你的芯片组。例如: via-agp, nvidia-agp, sis-agp。
fglrx

最后,运行:

modules-update

然后重新启动,应该就没问题了。如果还是不行,请查看 dmesg 和 /var/log/Xorg.0.log里的信息。

如果你在使用 mplayer 时无法全屏,在 Device 小节里设置

文件: xorg.conf

Option "VideoOverlay" "on"

[编辑] 无法加载模块 fglrx

如果模块无法加载(“operation not permitted”),检查一下内核中的 Direct Rendendering Manager (Device Drivers -> Character devices -> Direct Rendering Manager) 是否被开启,如果是开启的,请禁用它,然后重新编译内核:-)

[编辑] startx 后黑屏或者显示器关闭

版本大于等于 8.16.20 的 ati-driver 会有这个问题,其实只要简单的插入一句:

文件: xorg.conf
    Option "ForceMonitors" "notv"

到 xorg.conf 的 device 小节里就搞定了 (相关讨论: http://bugs.gentoo.org/show_bug.cgi?id=103028)

检查一下你的是不是非DDC显示器,并通过 VGA/HD15 接口连接的。如果是,修改你的 xorg.conf:

文件: xorg.conf
#   Option "DesktopSetup"               "0x00000000"
    Option "MonitorLayout"              "NONE, CRT"
    Option "IgnoreEDID"                 "off"
    Option "HSync2"                     "30-85"
    Option "VRefresh2"                  "50-160"
#   Option "ScreenOverlap"              "0"

显示器的参数 HSync2 和 VRefresh2 所在位置。

同样的,可以试试改变 MonitorLayout 选项。默认的参数是 "AUTO, AUTO",意思是说 X 会自动的探测第一和第二显示器的类型。有时侯这样会失败(比如在我的 Compaq Presario 笔记本上)。试着改一点。例如,如果你只有一个液晶显示器,而没有第二显示器,那么照下面的改:

文件: xorg.conf
    Option "MonitorLayout"              "TMDS, NONE"

如果你是 CRT 显示器,只要把 "TMDS" 替换成 "CRT" 就可以了。

[编辑] 不是来自原始作者

Issue with DRI; Compaq Presario R4000 Series (R4146EA) and HP Pavilion dv5000 with ATI XPRESS 200M PCIe

These laptops both appear to have the same problem:

On startup, the X process hangs with a blank screen, using 99%, however SSH access is possible. The "NoDRI" option in xorg.conf prevents the lockup, but has its obvious drawbacks. Rolando Zappacosta originally reported that lspci -v was incorrectly reporting the video memory size regardless of the actual value configured in the system BIOS, however this was not the case on the dv5000.

Workaround:

In the system BIOS the "SidePort+UMA" option must be selected, and an additional 128M of system memory must be assigned to the VGA. It is unknown whether this is a bug in the HP's BIOS, in the Linux PCI code, or the fglrx driver.

Please don't hesitate to contact me if more info is required. rzappacosta_at_rstn_dot_net.

Rolando Zappacosta

Craig Shelley

[编辑] 启动时崩溃

If you are unable to use any 3d applications and get this error instead:

FGLTexMgr: open of shared memory object failed (Function not implemented)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!
fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!
FGLTexMgr: open of shared memory object failed (Function not implemented)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!
fglX11AllocateManagedSurface: __FGLTexMgrCreateObject failed!!
FGLTexMgr: open of shared memory object failed (Function not implemented)
__FGLTexMgrCreateObject: __FGLTexMgrSHMmalloc failed!!!

Then you do not have tmpfs mounted on /dev/shm, which the driver requires. To mount this, add to following line to /etc/fstab (if it isn't there already):

文件: /etc/fstab
tmpfs     /dev/shm           tmpfs        defaults            0 0

Then just do a:

mount /dev/shm

If the drivers still crap out on you, or for example you get a black screen on X init, try going into your system BIOS and change graphics-related stuff around. Believe it or not, for me my 9800 gives a black screen on X init if I have the AGP Aperture set at anything other than 128MB. I don't know what causes this, and I don't care; I'm just relating to you how I overcame my problem ;)

Also, whenever you update your compiler, you must recompile your kernel otherwise you won't be able to insert the fglrx module. Note that recompiling your kernel means you must also unmerge/emerge ati-drivers!


[编辑] libGL error: failed to open DRM - 普通用户下很低的 FPS

如果你碰到这个错误: libGL error: failed to open DRM (例如你使用 glxgears)当时你正以一个普通用户去运行它,而普通用户是不能使用 DRI的(默认情况下只有 root 才行)。为了让所有用户都可以使用 DRI ,添加如下小节到你的 /etc/X11/xorg.conf :

文件: xorg.conf
Section "dri"
   Mode 0666
EndSection

大多数时候该小节已经存在,你只要把它前面的注释删掉就好了。

[编辑] AMD64 的问题

如果你碰到如下的错误: fglrx: Unknown symbol register_ioctl32_conversion fglrx: Unknown symbol unregister_ioctl32_conversion

可以打上这个补丁: http://www.credibleinstitution.org/matt/firegl_public.patch

这是论坛中贴出这个问题的帖子: http://forums.gentoo.org/viewtopic-t-397969-highlight-ati+rc300.html

[编辑] 相关东西

个人工具
其它语言