Intel graphics (简体中文)
由于Intel对X.Org开源驱动的支持,现在所需做的基本上是即插即用。
Intel显卡和相应芯片组、cpu的完整型号参考this comparison on wikipedia。
安装
先安装 Xorg,然后安装位于官方软件仓库的 xf86-video-intel 软件包。它提供了用于2D加速的DDX驱动和旧显卡的XvMC视频解码驱动。它依赖于3D加速的DRI驱动 mesa。
启用OpenGL支持, 安装 mesa-libgl.64位系统需要安装lib32-mesa-libgl 才能在 32 位程序中使用加速功能。
要使用新 GPU 的硬件编解码功能,请按装官方软件仓库中的libva-intel-driver和libva软件包,它提供了VA-API驱动。
配置
没必要做任何形式的配置来运行X.ORG(不需要xorg.conf
,但若有则要正确配置)。
However, to take advantage of some driver options, you will need to create a Xorg configuration file similar to the one below:
/etc/X11/xorg.conf.d/20-intel.conf
Section "Device" Identifier "Intel Graphics" Driver "intel" EndSection
Additional options are added by the user on new lines below Driver
.
查看完整选项,输入man intel
。
加载
英特尔内核模块在系统启动时自动加载. 如果它不启动,则:
- Make sure you do not have
nomodeset
orvga=
as a kernel parameter, since Intel requires kernel mode-setting. - Also, check that you have not disabled Intel by using any modprobe blacklisting within
/etc/modprobe.d/
or/usr/lib/modprobe.d/
.
启用 early KMS
Kernel mode setting (KMS)的支持,使用的的i915 DRM驱动程序英特尔芯片组和是强制性的,默认情况下启用。
KMS之后,通常初始化initramfs stage,这是可能的,但是,要在initramfs的阶段启用KMS。添加i915
模块到/etc/mkinitcpio.conf
的MODULES
行:
MODULES="i915"
如果您使用的是自定义的 EDID 文件, you should embed it into initramfs as well:
/etc/mkinitcpio.conf
FILES="/lib/firmware/edid/your_edid.bin"
然后,重新生成initramfs
mkinitcpio -p linux
重启系统,一切搞定!
Module-based Powersaving Options
The i915
kernel module allows for configuration via module options. Some of the module options impact power saving.
A list of all options along with short descriptions and default values can be generated with the following command:
$ modinfo -p i915
To check which options are currently enabled, run
# systool -m i915 -av
You will note that the i915.powersave
option which "enable[s] powersavings, fbc, downclocking, etc." is enabled by default, resulting in per-chip powersaving defaults. It is however possible to configure more aggressive powersaving by using module options.
The following set of options should be generally safe to enable:
/etc/modprobe.d/i915.conf
options i915 enable_rc6=1 enable_fbc=1 lvds_downclock=1 semaphores=1
You can experiment with higher values for enable_rc6
, but your GPU may not support them or the activation of the other options [1].
Framebuffer compression, for example, may be unreliable or unavailable on Intel GPU generations before Sandy Bridge (generation 6). This results in messages logged to the system journal similar to this one:
kernel: drm: not enough stolen space for compressed buffer, disabling.
技巧
选择加速方式
- UXA - (Unified Acceleration Architecture) 是支持GEM驱动模型(GEM driver model)的成熟后端(backend)
- SNA - (Sandybridge's New Acceleration) 在有硬件支持下比UXA更快
现在默认的加速方式为SNA(截至 2013-08-05[2]),比UXA更快,但是稳定性比UXA稍差
DDX驱动可重设你需要的加速方式。Phoronix的基准测试在 [3].Sandy Bridge为[4],Ivy Bridge为[5]. 若使用SNA有问题,UXA仍为稳妥的选择.
要使用旧的UXA加速方式, 创建包含下列内容的/etc/X11/xorg.conf.d/20-intel.conf
就可使用UXA:
/etc/X11/xorg.conf.d/20-intel.conf
Section "Device" Identifier "Intel Graphics" Driver "intel" Option "AccelMethod" "uxa" EndSection
设置自动缩放模式
在一些全屏应用中此方法适用:
$ xrandr --output LVDS1 --set PANEL_FITTING param
param
可以是:
-
center
: 使用自定义分辨率,不缩放; -
full
: 使用全屏; -
full_aspect
: 在长宽比不变的情况下使用最大可用分辨率。
若无效,可尝试:
$ xrandr --output LVDS1 --set "scaling mode" param
param
可以是"Full"
、"Center"
或 "Full aspect"
.
KMS 问题: 终端面积很小
在启动阶段,启用了低分辨率的接口会导致终端面积很小。通过i915模块设置可解决此问题,具体在加载器的内核参数添加 video=SVIDEO-1:d
。内核参数的更多信息参考 Kernel parameters .
若无效,可试着禁用 TV1 或 VGA1 接口。
在 GMA 4500 硬解 H.264
GMA 4500 平台上,libva-intel-driver 只能硬解 MPEG-2。 H.264 的硬解为另一分支——g45-h264, 在 Arch User Repository 中安装 libva-driver-intel-g45-h264AUR[broken link: archived in aur-mirror] 就OK。 但注意 g45-h264 目前仍处于试验阶段,且开发不活跃。通过 VA-API 会减轻cpu的负载但不如使用非加速方式流畅。 mplayer的测试表明 使用vaapi 播放H.264 编码的 1080p 视频会让cpu的负载减半 (与XV相比) ,但播放很不稳定, 而 720p 则很到位 [6]。其他一些用户也提到这点[7]。
设置伽马和亮度
Intel没有提供在驱动层面设置这些值的途径,幸运的是,可通过 xgamma
和 xrandr
来设置。
设置伽马:
$ xgamma -gamma 1.0
或:
$ xrandr --output VGA1 --gamma 1.0:1.0:1.0
设置亮度:
$ xrandr --output VGA1 --brightness 1.0
疑难解答
Glxgears 显示性能低下
若运行 glxgears
来获取显卡性能参数, 你会发现结果都在 60 FPS 左右, 如:
[...] 311 frames in 5.0 seconds = 61.973 FPS 311 frames in 5.0 seconds = 62.064 FPS 311 frames in 5.0 seconds = 62.026 FPS [...]
这不是性能低下的表现, 这是因为显卡使用了 vertical synchronization, 也就是显示器的原生帧频.
禁用 VSYNC
在/etc/X11/xorg.conf.d/20-intel.conf
的 Section "Device"
段添加 Option "SwapbuffersWait" "false"
可禁用 VSYNC.
在 ~/.drirc
中将 vblank_mode
设为 0
并且将 driver
设为 dri2
也可达到上述效果:
~/.drirc
<device screen="0" driver="dri2"> <application name="Default"> <option name="vblank_mode" value="0"/> </application> </device>
在启动阶段,当 "Loading modules" 时黑屏
若使用 "late start" KMS ,当 "Loading modules" 时黑屏, 在 initramfs 中添加 i915
和 intel_agp
可能有帮助. 查看 the above 的 KMS 节.
在尾部添加下面 kernel parameter 可能也会有效果:
video=SVIDEO-1:d
播放视频时屏幕撕裂
若使用 SNA,将下列内容添加到 /etc/X11/xorg.conf.d/20-intel.conf
的 Device
段可杜绝屏幕撕裂问题。
Option "TearFree" "true"
X 冻结/崩溃
使用 NoAccel
选项可能对 X 冻结/崩溃或显卡停止工作有效。
/etc/X11/xorg.conf.d/20-intel.conf
Section "Device" Identifier "Intel Graphics" Driver "intel" Option "NoAccel" "True" EndSection
此外, 也可尝试 DRI
选项来禁用 3D 加速:
/etc/X11/xorg.conf.d/20-intel.conf
Section "Device" Identifier "Intel Graphics" Driver "intel" Option "DRI" "False" EndSection
添加未识别分辨率
Xrandr page 讲到了此问题。
更新到 libGL 9 和 Intel-DRI 9 后,系统变慢
降级软件包 到 Intel-DRI 8 和 libGL 8.
视频游戏时出现黑色纹理
启用 S3TC 纹理压缩支持可能会解决此问题。 通过 driconf 或安装 libtxc_dxtn 都可启用。
此问题很快会得到解决,参考 newer drivers
更多 S3TC 信息参考: http://dri.freedesktop.org/wiki/S3TC wikipedia:S3_Texture_Compression
受此影响的其中一个游戏是 Oil Rush
更多信息
- http://intellinuxgraphics.org/documentation.html (includes a list of supported hardware)
- KMS — Arch wiki article on kernel mode setting
- Xrandr — If you have problems setting the resolution
- Arch Linux forums: Intel 945GM, Xorg, Kernel - performance