https://wiki.archlinux.org/api.php?action=feedcontributions&user=Yafengabc&feedformat=atomArchWiki - User contributions [en]2024-03-29T11:48:32ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Touchpad_Synaptics_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=465628Touchpad Synaptics (简体中文)2017-01-17T11:00:54Z<p>Yafengabc: /* Synaptics触摸板某些功能失效 (比如触击,滚动) */</p>
<hr />
<div>[[Category:Input devices (简体中文)]]<br />
[[de:Synaptics Touchpad Treiber]]<br />
[[en:Touchpad Synaptics]]<br />
[[es:Touchpad Synaptics]]<br />
[[fr:Touchpad Synaptics]]<br />
[[it:Touchpad Synaptics]]<br />
[[ja:Synaptics タッチパッド]]<br />
[[ru:Touchpad Synaptics]]<br />
{{TranslationStatus (简体中文)|Touchpad_Synaptics|2016-08-01|443547}}<br />
{{Related articles start (简体中文)}}<br />
{{Related2|Xorg (简体中文)|Xorg}}<br />
{{Related articles end}}<br />
本文描述了 '''''Synaptics 输入驱动''''' 的安装和配置过程,适用于大多数笔记本电脑上的Synaptics(或ALPS)触摸板<br />
<br />
[[libinput]] 是另外的触摸板驱动选项,这个库使用不同的设备检测和多指触控支持。uch features.如果要通过 GNOME 控制中心配置触摸板,需要使用 [[libinput]] 驱动[https://bugzilla.gnome.org/show_bug.cgi?id=764257#c12]。<br />
<br />
==安装==<br />
[[安装]] 软件包 {{pkg|xf86-input-synaptics}}。<br />
<br />
==配置==<br />
配置的主要方法是通过修改 [[xorg]] Server 配置文件来完成配置。在安装了 {{ic|xf86-input-synaptics}} 之后,一个默认的配置文件位于 {{ic|/usr/share/X11/xorg.conf.d/70-synaptics.conf}}。<br />
<br />
用户可以将此文件复制到 {{ic|/etc/X11/xorg.conf.d/}}然后编辑配置,完整的选项列表请参考synaptics的 {{ic|synaptics(4)}} 手册页。<br />
<br />
=== 常用选项 ===<br />
<br />
下面列举了大多数用户希望进行配置的选项。比如,下面的例子里,我们启用了水平,垂直和环形滚动:<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "VertEdgeScroll" "on"<br />
Option "VertTwoFingerScroll" "on"<br />
Option "HorizEdgeScroll" "on"<br />
Option "HorizTwoFingerScroll" "on"<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "2"<br />
Option "EmulateTwoFingerMinZ" "40"<br />
Option "EmulateTwoFingerMinW" "8"<br />
Option "FingerLow" "30"<br />
Option "FingerHigh" "50"<br />
Option "MaxTapTime" "125"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
; '''TapButton1''': (integer) 配置 “当用一根手指在非角落区域触击时,哪个鼠标键点击事件被上报”<br />
; '''TapButton2''': (integer) 配置 “当用两根手指在非角落区域触击时,哪个鼠标键点击事件被上报”<br />
; '''TapButton3''': (integer) 配置 “当用三根手指在非角落区域触击时,哪个鼠标键点击事件被上报”<br />
; '''RBCornerButton''': (integer) 配置 “当在右下角单指触及时,哪个鼠标键点击事件被上报"(使用{{ic|Option "RBCornerButton" "3"}}来完成Ubuntu式的右键点击设定(右下角轻触代表点击右键))<br />
; '''RTCornerButton''': (integer) 对右上角轻触进行配置,和RBCornerButton类似<br />
; '''VertEdgeScroll''': (boolean) 在触摸板的由边缘滑动时,启用垂直滚动<br />
; '''HorizEdgeScroll''': (boolean) 在触摸板的下边缘滑动时,启用水平滚动<br />
; '''VertTwoFingerScroll''': (boolean) 启用双指垂直滚动<br />
; '''HorizTwoFingerScroll''': (boolean) 启用双指水平滚动<br />
; '''EmulateTwoFingerMinZ/W''': (integer) 使用这两个参数来对双指滚动的精度进行调教<br />
; '''FingerLow''': (integer) 手指压力低于此数值时视为手指移开。<br />
; '''FingerHigh''': (integer) 手指压力高于此数值时视为手指按压.<br />
; '''MaxTapTime''': Determines how "crisp" a tap must be to be considered a real tap. Decrease the value to require a more crisp tap. Properly adjusting this parameter can reduce false positives when the hands hover over or lightly touch the pad.<br />
; '''VertScrollDelta''' and '''HorizScrollDelta''': (integer) configures the speed of scrolling, it is a bit counter-intuitive because higher values produce greater precision and thus slower scrolling. Negative values cause natural scrolling like in OS X.<br />
<br />
这个[[Touchpad_Synaptics/10-synaptics.conf_example|例子]]包含了所有选项的简短介绍. 因为不同计算机的配置一般也不同. 我们推荐使用 [[Touchpad_Synaptics#Synclient|synclient]]来对你的计算机进行针对性调教<br />
<br />
如果你经常因为手掌扫过触摸板而导致TabButton2属性被触发(大多数时候都是"粘贴”动作),而你又不介意关闭掉双指触击功能,请将{{ic|TapButton2}}设置为0.<br />
<br />
Recent versions include a "Coasting" feature, enabled by default, which may have the undesired effect of continuing almost any scrolling until the next tap or click, even if you are no longer touching the touchpad. This means that to scroll just a bit, you need to scroll (by using the edge, or a multitouch option) and then almost immediately tap the touchpad, otherwise scrolling will continue forever. If wish to avoid this, set {{ic|CoastingSpeed}} to 0.<br />
<br />
如果触摸板太敏感,可以使用更高的 {{ic|FingerLow}} 和 {{ic|FingerHigh}} 值,{{ic|FingerLow}} 应该比 {{ic|FingerHigh}} 小。<br />
<br />
=== 实时配置 ===<br />
<br />
除了提供传统的配置方法,Synaptics驱动现在还支持实时配置。这意味着用户能通过软件来进行实时设置而不需要重启X服务器。在你将配置项添加到主配置文件之前,这个特性可以帮助你进行测试。<br />
{{Warning|实时配置是非永久的,当重启,挂起/恢复,或者重启udev后就会失效。所以这个功能只适合用来对配置进行测试和精校。}}<br />
<br />
==== 命令行工具 ====<br />
<br />
{{App|[[Touchpad_Synaptics#Synclient|Synclient]]|Synclient是一个可以对Synaptics驱动进行查询并进行配置的命令行工具,这个工具是由synaptics维护者开发并和synaptics驱动一起提供给用户|http://xorg.freedesktop.org/|{{Pkg|xf86-input-synaptics}}}}<br />
<br />
{{App|[[Touchpad_Synaptics#Using xinput to determine touchpad capabilities|xinput]]|调试设备的小型通用命令行程序|http://xorg.freedesktop.org/|{{Pkg|xorg-xinput}}}}<br />
<br />
==== 图形化工具 ====<br />
<br />
* {{App|GPointing Device Settings|提供对当前系统上的指针设备进行实时配置的图形界面(包括Synaptics触摸板),这个应用替代GSynaptics成为了对Synaptics驱动进行图形化配置的优先程序.|http://live.gnome.org/GPointingDeviceSettings|{{Pkg|gpointing-device-settings}}}}<br />
{{Note|需要安装 {{Pkg|xf86-input-synaptics}} 和 {{Pkg|libsynaptics}} , GPointingDeviceSettings工具才能在Synaptics触摸板上运行!}}<br />
<br />
* {{App|kcm-touchpad|在[[KDE]]的一个新的触摸板配置工具,提供了一个在“系统设置”中的模块。在2014年2月发布,工作于KDE SC 4.12+。这将被作为一个 {{AUR|synaptiks}}{{Broken package link|{{aur-mirror|synaptiks}}}} 和 {{AUR|kcm_touchpad}}{{Broken package link|{{aur-mirror|kcm_touchpad}}}} 的替代品。|https://projects.kde.org/projects/kde/workspace/kcm-touchpad/repository|{{Pkg|kcm-touchpad}}{{Broken package link|{{aur-mirror|kcm-touchpad}}}}}}<br />
<br />
=== 其他选项 ===<br />
<br />
; '''VertScrollDelta''' and '''HorizScrollDelta''': (integer)配置滚动速度, 对它们的配置比较直观,因为值越高滚动精度就越高而速度越低.设置成负值就能实现类似OS X系统的"自然滚动"<br />
<br />
; SHMConfig: (boolean) 是否开启共享内存以支持实时调试. 现在这个选项已经无效,并且它也只能提供针对事件的实时调试<br />
<br />
=== Xfce4/Cinnamon ===<br />
<br />
当在'''XFCE 4'''下想要修改这些设定时:<br />
# 打开 ''System Settings''.<br />
# 点击 ''Mouse and Touchpad''.<br />
# 在 ''Touchpad'' 选项卡里对这些配置进行更改.<br />
<br />
To change these settings in '''Cinnamon''':<br />
<br />
# Open ''Cinnamon System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
=== MATE ===<br />
<br />
在MATE上,可以通过下面方法配置触摸板:<br />
<br />
# 运行 {{ic|dconf-editor}}<br />
# 编辑 {{ic|org.mate.peripherals-touchpad}} 文件夹里面的键<br />
<br />
可以通过下面的方法来阻止Mate配置守护程序改写当前配置:<br />
# 运行 {{ic|dconf-editor}<br />
# 编辑 {{ic|org.mate.SettingsDaemon.plugins.mouse}}<br />
# 取消'''active'''勾选 .<br />
<br />
==高级配置==<br />
=== 使用xinput来检测您的触摸板有什么功能 ===<br />
根据型号不同,Synaptics可能有以下特性:<br />
* 拥有物理左键,物理中键,物理右键<br />
* 能够进行两指检测<br />
* 能够进行三指检测<br />
* 能够配置分辨率<br />
<br />
使用 {{ic|xinput list}}来找到您的synaptics设备名<br />
<br />
首先,找到触摸板的名字<br />
{{bc|$ xinput -list}}<br />
<br />
然后,您可以使用{{ic|xipunt}}来查看您的触摸板有什么特性<br />
$ xinput list-props "SynPS/2 Synaptics TouchPad" | grep Capabilities<br />
<br />
Synaptics Capabillities (309): 1, 0, 1, 0, 0, 1, 1<br />
<br />
从左到右,分别代表:<br />
* (1) 设备有物理左键<br />
* (0) 设备有物理中键<br />
* (1) 设备有物理右键<br />
* (0) 设备支持两指检测<br />
* (0) 设备支持三指检测<br />
* (1) 设备可以配置垂直分辨率<br />
* (1) 设备可以配置水平分辨率<br />
<br />
使用{{ic|xinput list-props "SynPS/2 Synaptics TouchPad"}} 来列出设备的所有属性<br />
<br />
详情请阅读xinput和synaptics的帮助文档<br />
<br />
=== Synclient ===<br />
<br />
在synaptics manpage里面列出的所有参数都可以通过synclient进行配置.下面命令列出了一个完整的用户设置的清单:<br />
{{bc|$ synclient -l}}<br />
<br />
所有列出的参数都可以用synclient进行配置, 比如:<br />
$ synclient PalmDetect=1 (to enable palm detection)<br />
$ synclient TapButton1=1 (configure button events)<br />
$ synclient TouchpadOff=1 (disable the touchpad)<br />
<br />
使用synclient进行成功的设定和测试后,你可以将这些设定添加到{{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}中<br />
{{Out of date |<br />
'''(1.71驱动里,已经取消了SHMConfig设定,随驱动一起发行的synclient工具也不再支持-m参数.所以,下面的描述已经过期.本文的英文版里面已经删除了使用synclient -m进行测试的这一节.考虑到兼容性,我保留了这一段描述)'''<br />
<br />
synclient监视器可以实时地显示触摸板的触摸位置和压力,以提供比默认的Synaptics设置更精细的调整。您需要设置'''SHMConfig'''选项为'''on'''或'''true'''以确保synclient正常工作。<br />
<br />
您可以这样启动synclient:<br />
$ synclient -m 100<br />
-m参数设置了synclient的更新间隔时间,单位为毫秒。<br />
<br />
这个监视器提供了有关于触摸板当前状态的信息。比如,如果您利用触摸板移动了鼠标指针,那么监视器中x和y的值就会随之变化。这样您就可以方便地确定各个边界,以便于设定LeftEdge-,RightEdge-,BottomEdge-和TopEdge-选项。<br />
<br />
下面列出了所有能够监视的状态以及它们的简要描述:<br />
<br />
{| class="wikitable"<br />
|- align="left"<br />
!width="200"|+监视项+<br />
!width="400|+描述+<br />
|-<br />
|'''time'''<br />
|从开始记录起到当前经过的时间,单位是秒。<br />
|-<br />
|'''x, y'''<br />
|手指放在触摸板上的x/y坐标,原点是左上角。<br />
|-<br />
|'''z'''<br />
|手指放在触摸板上的压力。<br />
|-<br />
|'''f'''<br />
|放在触摸板上的手指数。<br />
|-<br />
|'''w'''<br />
|手指的宽度。<br />
|-<br />
|'''l,r,u,d,m,multi'''<br />
|这些值代表了左,右,上,下,中,多功能这6个按键的状态,0代表没有被按下,1代表被按下。<br />
|-<br />
|'''gl,gm,gr'''<br />
|对于有guest device的触摸板,这些值代表了guest device上按键的状态。<br />
|-<br />
|'''gdx, gdy'''<br />
|guest device的x/y坐标。<br />
|}<br />
如果某个值一直是0,那就表明您的触摸板不支持这一项。<br />
<br />
可以利用{{Ic|synclient}}来测试新的值(首先要确保SHMConfig被打开)。例如,要调整最小指针速度: <br />
$ synclient MinSpeed=0.5<br />
<br />
这样做出的改变不是永久的。如果您对这些更改满意并希望它们一直保留,就需要把他们放到 {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} 中。<br />
}}<br />
<br />
=== Evtest ===<br />
<br />
[[evdev|evtest]]工具能够实时的显示触摸板上的压力和位置信息,允许对默认的Synaptics设定进行精校.可以通过如下方式启动evtest<br />
$ evtest /dev/input/event''X''<br />
<br />
''X''代表触摸板的ID,可以通过查看{{ic|cat /proc/bus/input/devices}}的输出来获取它.<br />
evtest需要对设备进行排他访问,因此,evtest不能和X Server的实例共存.你可以通过杀死X Server进程或者在虚拟终端上运行evtest来解决这个问题(例如,通过{{ic|CTRL+ALT+2}}来切换到2号虚拟终端)<br />
<br />
=== xev ===<br />
<br />
工具 {{Pkg|xorg-xev}} 可以实时显示按压、点击、压力、位置和其它检测到的数据,可以更深入的优化 Synaptics 设置。xev 可以通过 "-event" 参数设置报告的事件。<br />
<br />
===环状滚动===<br />
<br />
Synaptics提供和ipod触控方式类似的环状滚动功能。您可以在触摸板上画圈,来代替在边缘上垂直或水平地滑动。有些用户发现这样滚动的更快也更精确. <br />
<br />
添加下面几行到{{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}}中以启用环状滚动:<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputDevice"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
选项'''CircScrollTrigger'''可以设置为下面的值之一,它能够决定环状滚动应该从哪个边缘开始:<br />
0 所有边缘<br />
1 顶部边缘<br />
2 右上角<br />
3 右边缘<br />
4 右下角<br />
5 底部边缘<br />
6 左下角<br />
7 左边缘<br />
8 左上角<br />
<br />
设置一个非0值对于同时使用水平/垂直滚动和环状滚动的用户非常有用.设定后,会根据你开始的边缘决定到底使用哪种滚动.<br />
<br />
如果您想要快速滚动,请在触摸板中部画小圈,相反,如果您想要慢速地且更精确地滚动,请画大圈。<br />
<br />
=== 自然滚动(触摸屏式滚动) ===<br />
<br />
可以在synaptics上启用自然滚动(触摸屏那种滚动).只要将{{ic|VertScrollDelta}}和{{ic|HorizScrollDelta}}的值设定为负就行(翻转滚动方向):<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
===软开关===<br />
<br />
有一个能启用禁用触摸板的软开关会方便许多,可以用 ''xinput'' 脚本绑定到键盘事件,详情参考 [[Extra keyboard keys in Xorg]]。<br />
<br />
{{hc|/usr/local/bin/touchpad_toggle.sh|2=<nowiki><br />
#!/bin/bash<br />
<br />
declare -i ID<br />
ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`<br />
declare -i STATE<br />
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`<br />
if [ $STATE -eq 1 ]<br />
then<br />
xinput disable $ID<br />
# echo "Touchpad disabled."<br />
# notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png<br />
else<br />
xinput enable $ID<br />
# echo "Touchpad enabled."<br />
# notify-send 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png<br />
fi<br />
</nowiki>}}<br />
<br />
{{Tip|使用 [[bumblebee]] 下的外置显示时,可以通过在命令中加入 {{ic|1=DISPLAY=:8}} 设置第二个 X Server.}} <br />
<br />
此外可以使用 {{ic|synclient}} 切换 touchpad. 这个方式仅能禁用触摸事件,无法禁用物理按键的使用:<br />
<br />
{{hc|/sbin/trackpad-toggle.sh|<nowiki><br />
#!/bin/bash<br />
<br />
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')<br />
<br />
</nowiki>}}<br />
<br />
===在打字时禁用触摸板===<br />
<br />
==== 使用驱动的掌压感应 ====<br />
首先,你需要测试您的触摸板是否支持掌压感应,如果支持,需要测试设定是否精确: <br />
$ synclient PalmDetect=1<br />
<br />
试着打字,通过如下方式调整感应精度,PalmMinWidth 用来设定接触面的最小值<br />
<br />
$ synclient PalmMinWidth=8<br />
<br />
PalmMinZ用来设定在什么压力下会启动掌压感应<br />
$ synclient PalmMinZ=100<br />
<br />
{{Tip|可以使用 {{pkg|evtest}} 查看 touchpad 使用时的宽度和 Z 值.}}<br />
<br />
当你找到了合适的设定后,将它们加入 {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}}中.<br />
{{bc|<nowiki><br />
Option "PalmDetect" "1"<br />
Option "PalmMinWidth" "8"<br />
Option "PalmMinZ" "200"<br />
</nowiki>}}<br />
<br />
{{Warning|1=For some touchpads, an [https://bugzilla.kernel.org/show_bug.cgi?id=77161 issue] with the kernel can cause the palm width to always be reported as 0. This breaks palm detection in a majority of cases. Pending an actual fix, you can [https://gist.github.com/silverhammermba/a231c8156ecaa63c86f1 patch] the synaptics package to use only Z for palm detection.}}<br />
<br />
{{Tip|If you experience problems with consistent palm detection for your hardware, an alternative to try is [[libinput]].}}<br />
<br />
==== 使用 syndaemon ====<br />
<br />
{{ic|syndaemon}} 可以监控键盘活动并在打字时禁用触摸板,有多个选项可以控制禁用条件。可以通过下面命令查看帮助:<br />
<br />
$ syndaemon -h<br />
<br />
例如要在打字 0.5 秒后禁用点击和滚动,忽略 Ctrl 等修饰键,使用<br />
<br />
$ syndaemon -i 0.5 -t -K -R<br />
<br />
确定好需要的选项后,在登录管理器或 [[xinitrc]] 中配置为随 X 启动,使用 {{ic|-d}} 选项程序会在后台运行。<br />
<br />
=== 检测到鼠标后禁用触摸板 ===<br />
<br />
在[[udev]]的协助下,可以实现当外置鼠标插入后自动禁用触摸板的功能。可以使用下面规则:<br />
<br />
==== 基本桌面 ====<br />
<br />
非桌面环境额可以使用下面通用规则:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/''username''/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/''username''/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
}}<br />
<br />
==== GDM ====<br />
<br />
{{Accuracy|saying that GDM ''usually'' does something does not make sense}}<br />
<br />
GDM usually stores the Xauthority files inin a randomly-named directory. You should find your actual path to the Xauthority file which can be done using {{ic|ps ax}}. For some reason multiple authority files may appear for a user, so a rule like will be necessary:<br />
<br />
GDM 将 Xauthority 文件存放在 {{ic|/var/run/gdm}} 下随机命名的文件夹中. {{ic|ps ax}} 可以查到 Xauthority 文件的位置,udev规则一般是这样的:<br />
<br />
ACTION=="add", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username* -print -quit", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
ACTION=="remove", KERNEL=="mouse[0-9]", SUBSYSTEM=="input", PROGRAM="/usr/bin/find /var/run/gdm -name *username* -print -quit", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
<br />
Furthermore, you should validate that your udev script is running properly! You can check for the conditions using {{ic| udevadm monitor -p}} which must be run as root.<br />
<br />
===== With syndaemon running =====<br />
<br />
{{ic|syndaemon}} whether started by the [[#Using syndaemon|user]]{{Broken section link}} or the desktop environment can conflict with synclient and will need to be disabled. A rule like this will be needed:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="add", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/bin/sh -c '/usr/bin/synclient TouchpadOff=1 ; sleep 1; /bin/killall syndaemon; '"<br />
}}<br />
<br />
===== touchpad-state =====<br />
<br />
An AUR package {{aur|touchpad-state-git}} has been created around the udev rules above. It includes a udev rule and script:<br />
<br />
touchpad-state [--off] [--on]<br />
<br />
==== GNOME ====<br />
<br />
GNOME users can install GNOME shell extension [https://extensions.gnome.org/extension/131/touchpad-indicator/ Touchpad Indicator], change "Switch Method" to "Synclient" and enable "Automatically switch Touchpad On/Off" in its preferences.<br />
<br />
==== KDE ====<br />
<br />
If using Plasma, the package {{Pkg|plasma-desktop}} can be used to manage the touchpad.<br />
<br />
==== System with multiple X sessions ====<br />
<br />
{{Accuracy|Hard-coded {{ic|DISPLAY}} variable does not work with multiple X sessions.}} <br />
<br />
For an environment where multiple users are present, a slightly different approach is needed to detect the current users X environment. This script will help achieving this:<br />
<br />
{{hc|/usr/bin/mouse-pnp-event-handler.sh|<nowiki><br />
#!/bin/sh<br />
## $1 = "add" / "remove"<br />
## $2 = %k from udev <br />
<br />
## Set TRACKPAD_NAME according to your configuration. <br />
## Check your trackpad name with: <br />
## find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'<br />
TRACKPAD_NAME="SynPS/2 Synaptics TouchPad"<br />
<br />
USERLIST=$(w -h | cut -d' ' -f1 | sort | uniq)<br />
MOUSELIST=$(find /sys/class/input/ -name mouse*)<br />
<br />
for CUR_USER in ${USERLIST}; do<br />
CUR_USER_XAUTH="$(sudo -Hiu ${CUR_USER} env | grep -e "^HOME=" | cut -d'=' -f2)/.Xauthority"<br />
<br />
<br />
## Can't find a way to get another users DISPLAY variable from an isolated root environment. Have to set it manually.<br />
#CUR_USER_DISPL="$(sudo -Hiu ${CUR_USER} env | grep -e "^DISPLAY=" | cut -d'=' -f2)"<br />
CUR_USER_DISPL=":0"<br />
<br />
export XAUTHORITY="${CUR_USER_XAUTH}"<br />
export DISPLAY="${CUR_USER_DISPL}"<br />
<br />
if [ -f "${CUR_USER_XAUTH}" ]; then<br />
case "$1" in<br />
"add")<br />
/usr/bin/synclient TouchpadOff=1<br />
/usr/bin/logger "USB mouse plugged. Disabling touchpad for $CUR_USER. ($XAUTHORITY - $DISPLAY)"<br />
;;<br />
"remove")<br />
## Only execute synclient if there are no external USB mice connected to the system.<br />
EXT_MOUSE_FOUND="0"<br />
for CUR_MOUSE in ${MOUSELIST}; do<br />
if [ "$(cat ${CUR_MOUSE}/device/name)" != "${TRACKPAD_NAME}" ]; then<br />
EXT_MOUSE_FOUND="1"<br />
fi<br />
done<br />
if [ "${EXT_MOUSE_FOUND}" == "0" ]; then<br />
/usr/bin/synclient TouchpadOff=0<br />
/usr/bin/logger "No additional external mice found. Enabling touchpad for $CUR_USER."<br />
else<br />
logger "Additional external mice found. Won't enable touchpad yet for $CUR_USER."<br />
fi<br />
;;<br />
esac<br />
fi<br />
done<br />
</nowiki>}}<br />
<br />
Update the {{ic|TRACKPAD_NAME}} variable for your system configuration.<br />
Run {{ic|<nowiki>find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'</nowiki>}} to get a list of useful mice-names. Choose the one for your trackpad.<br />
<br />
Then have udev run this script when USB mices are plugged in or out, with these udev rules:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", RUN+="/usr/bin/mouse-pnp-event-handler.sh add %k"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", RUN+="/usr/bin/mouse-pnp-event-handler.sh remove %k"<br />
}}<br />
<br />
=== 一体化触摸板 (也被称为 ClickPads) ===<br />
一些笔记本使用按键与触摸板面一体的触摸板.比如HP 4500系列笔记本,ThinkPad X220,X1 系列笔记本.默认情况下所有按键都被识别为左键,这样就不能使用右键中键,Click-Drag手势等功能. 在synaptics 1.6.0版驱动之前,一般使用第三方补丁来支持此类设备.但从1.6.0开始,Synaptics使用''mtdev''库实现了对多点触控的原生支持. 请注意,尽管支持多点触控,但是Synaptics驱动不会识别是不是不同的手指(至少到1.7.1都是这样),这样的话,当使用物理按键或者拖放手势时会有一些奇怪的现象出现.xf86-input-mtrack驱动对多点触控有更好的支持.<br />
<br />
可以修改{{ic|/etc/X11/xorg.conf.d/50-synaptics.conf}}来启用其他按键(或者给自定义的synaptics配置文件赋一个更高的优先级(前缀号更高),比如55-synaptics.conf):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<nowiki><br />
...<br />
Option "ClickPad" "true"<br />
Option "EmulateMidButtonTime" "0"<br />
Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"<br />
...<br />
</nowiki>}}<br />
<br />
这三个选项是开启其他按键的关键,第一个启用多点触控,第二个关闭中键模拟(ClickPad不支持),第三个定义软按键区域<br />
<br />
SoftButtonAreas选项的格式是(请参考{{ic|man 4 synaptics}}):<br />
{{bc|RightButtonAreaLeft RightButtonAreaRight RightButtonAreaTop RightButtonAreaBottom MiddleButtonAreaLeft MiddleButtonAreaRight MiddleButtonAreaTop MiddleButtonAreaBottom}}<br />
<br />
上面的例子一般在synaptics驱动包提供的文档中都能找到,它将触摸板的X坐标50%以右,Y坐标82%以下区域定义为右键.这里没有中键的定义,.定义的时候请注意:<br />
'''将边缘设置为0代表将边缘设置到当前方向的无限远处.'''<br />
<br />
下面的例子将右键定义为X坐标60%以右,Y坐标82%以下;X坐标40%以右,59%以左,Y坐标82%以下被定义为中键<br />
<br />
...<br />
Option "SoftButtonAreas" "60% 0 82% 0 40% 59% 82% 0"<br />
...<br />
<br />
可以使用{{ic|<nowiki>synclient</nowiki>}}来检查新的软按键区域设置:<br />
<br />
{{hc|<nowiki>$ synclient -l | grep -i ButtonArea</nowiki>|<nowiki><br />
RightButtonAreaLeft = 3914<br />
RightButtonAreaRight = 0<br />
RightButtonAreaTop = 3918<br />
RightButtonAreaBottom = 0<br />
MiddleButtonAreaLeft = 3100<br />
MiddleButtonAreaRight = 3873<br />
MiddleButtonAreaTop = 3918<br />
MiddleButtonAreaBottom = 0<br />
</nowiki>}}<br />
<br />
如果发现上述设定失效,请确认是否有其他设置覆盖了您的设置(比如,一些AUR包给其配置档赋予了很高的优先级)<br />
<br />
==== Bottom edge correction ====<br />
<br />
In some cases, for example Toshiba Satellite P50, everything work out of the box except often your click are seen as mouse movement and the cursor will jump away just before registering the click.<br />
This can be easily solved running<br />
<br />
$ synclient -l | grep BottomEdge<br />
<br />
take the BottomEdge value and subtract a the wanted height of your button, then temporary apply with<br />
<br />
$ synclient AreaBottomEdge=4000<br />
<br />
when a good value has been found make it a fixed correction with<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
...<br />
Option "AreaBottomEdge" "4000"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|The area will not act as touchpad if the touch '''begins''' in that area, but it can still be used if the touch has originated outside.}}<br />
<br />
==疑难解答==<br />
<br />
=== Touchpad does not work after resuming from hibernate/suspend ===<br />
Occasionally touchpads will fail to work when the computer resumes from sleep or hibernation. This can often be corrected without rebooting by<br />
* Switching to a console and back again,<br />
* entering sleep mode again, and resuming again, or<br />
* locating the correct kernel module, then removing it and inserting it again. <br />
{{Note|You can use Ctrl-Alt-F1 through F8 to switch to a console without using the mouse.}}<br />
modprobe -r psmouse #psmouse happens to be the kernel module for my touchpad (Alps DualPoint)<br />
modprobe psmouse<br />
Now switch back to the tty that X is running on. If you chose the right module, your touchpad should be working again.<br />
<br />
=== xorg.conf.d/70-synaptics.conf在 MATE 上失效 ===<br />
<br />
[[MATE]] 会覆盖您的个性化设定,包括那些没法在 MATE 下进行图形化设定的选项.这会导致{{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}} 里的设置不起作用了.请参考本文MATE 一节来避免这种情况的发生.<br />
<br />
=== 触摸板无法工作, Xorg.0.log 中显示 "Query no Synaptics: 6003C8" ===<br />
一般这是因为在系统上设置synaptics的方法不对:同时载入了两个synaptics模块.我们可以通过查看xorg log({{ic|/var/log/Xorg.0.log}})来识别这种情况:<br />
{{hc|/var/log/Xorg.0.log|<nowiki><br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"<br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"<br />
</nowiki>}}<br />
这里可以看到两个不同的模块被载入了.在某些情况下,这会导致触摸板不可用.<br />
<br />
我们可以通过将 {{ic|MatchDevicePath "/dev/input/event*"}} 添加到 {{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} 中来防止这种双重载入:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection <br />
</nowiki>}}<br />
<br />
重启X Server,检查Xorg.0.log,这个错误应该会消失,触摸板也应该可用了<br />
<br />
相关bug报告:{{Bug|20830}}<br />
<br />
相关论坛主题:<br />
* https://bbs.archlinux.org/viewtopic.php?id=104769<br />
* https://bbs.archlinux.org/viewtopic.php?pid=825690<br />
<br />
===触摸板被识别为"PS/2 Generic Mouse" 或者 "Logitech PS/2 mouse" ===<br />
<br />
==== Elan Touchpad ====<br />
<br />
某些设备例如 ASUS x53s 使用 Elan touchpad,可能会出现此问题。.安装[[AUR]]包{{AUR|psmouse-alps-driver}}{{Broken package link|{{aur-mirror|psmouse-alps-driver}}}}即可解决这个问题.<br />
<br />
==== Laptops with touchscreen & touchpad ====<br />
There also seems to be a problem with laptops which have both a touchscreen & a touchpad, such as the Dell XPS 12 or Dell XPS 13. To fix this, you can [[blacklisting|blacklist]] the {{ic|i2c_hid}} driver, this does have the side-effect of disabling the touchscreen though.<br />
<br />
This [http://www.spinics.net/lists/linux-input/msg27768.html seems to be a known problem]. Also see [https://bbs.archlinux.org/viewtopic.php?pid=1419078 this thread].<br />
<br />
Post kernel 3.15, having the module blacklisted may cause touchpad to stop working completely. Removing the blacklist should allow this to start working with limited functionality, see {{Bug|40921}}.<br />
<br />
=== Synaptics触摸板某些功能失效 (比如触击,滚动) ===<br />
有些时候Synaptics触摸板会失去某些功能.即使正确配置了也不能使用诸如双指滚动,双指触发中键点击等功能.这个问题可能和上面提到的<br />
<br />
如果阻止了重复加载模块后还有问题,可以尝试将"MatchIsTouchPad"配置项注释掉(这个选项synaptics默认开启)<br />
<br />
If clicking with either 2 or 3 fingers is interpreted as a right-click, so you cannot get a middle click either way regardless of configuration, this bug is probably the culprit: https://bugs.freedesktop.org/show_bug.cgi?id=55365<br />
<br />
<br />
====在一些笔记本的Elantech touchpads触摸板多点触控失效====<br />
在内核启动选项加上"i8042.reset i8042.nomux=1 i8042.nopnp i8042.noloop"等.<br />
在我的联想小新笔记本上我增加了"i8042.reset i8042.nomux=1"两个选项,触摸板正常识别,多点触控可用。<br />
<br />
===指针跳跃===<br />
<br />
某些用户会发现鼠标指针奇怪地在屏幕上“跳跃”,当前没有有效的办法来解决这个问题,但是有开发者正在关注这个BUG.<br />
<br />
另一个可能是你遇到了和i8042控制器有关的''IRQ losses''问题(很多笔记本用这个i8042来控制键盘,触摸板).你有两个选择:<br />
1.重新加载psmouse模组(rmmod&&insmod)<br />
2.将i8042.nomux=1加入到启动行里,然后重启电脑<br />
<br />
===在{{ic|/dev/input/*}}中没有触摸板设备} ===<br />
<br />
如果出现这种情况,您可以利用这条命令来显示您的输入设备信息:<br />
{{bc|$ cat /proc/bus/input/devices}}<br />
<br />
找寻一个名字为"SynPS/2 Synaptics TouchPad"的输入设备。"Handlers"一节就是触摸板设备的正确位置。<br />
<br />
'''样例输出'''<br />
{{hc|$ cat /proc/bus/input/devices|<nowiki><br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1<br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
</nowiki>}}<br />
<br />
在这个例子中 {{ic|Handlers}} 是 {{ic|mouse0}} 和 {{ic|event1}},所以应该使用 {{ic|/dev/input/mouse0}} 作为触摸板设备的位置。<br />
<br />
{{Expansion|TODO: 解释怎么将这点反映到{{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}}中}}<br />
<br />
===Firefox和特殊触摸板事件===<br />
{{Accuracy|至少在我的FireFox version 23.01上面,没有这些设置而且默认设定工作的很好}}<br />
默认的,firefox会设置触摸板上特殊区域完成特殊功能。你可以在地址栏输入'''about:config'''设置这些功能。编辑就是双击这些行,让true变成false,如果是数值你就必须手动改变了。<br />
<br />
==== Firefox 17.0 and later ====<br />
<br />
Horizontal scrolling will now by default scroll through pages and not through your history. To reenable Mac-style forward/backward with two-finger swiping, edit:<br />
<br />
mousewheel.default.action.override_x = 2<br />
<br />
You may encounter accidental forwards/backwards while scrolling vertically. To change Firefox's sensitivity to horizontal swipes, edit:<br />
<br />
mousewheel.default.delta_multiplier_x<br />
<br />
The optimum value will depend on your touchpad and how you use it, try starting with {{ic|10}}. A negative value will reverse the swipe directions.<br />
<br />
===Opera:水平滚动问题===<br />
点击工具 -> 首选项 -> 高级 -> 快捷方式,在这里选择 "Opera Standard" 鼠标属性,点击“编辑”,在“应用程序”部分:<br />
{{Accuracy|这里的描述不是很清晰,请使用Opera的朋友确认以后进行修正}}<br />
* 将 "Button 6" 键赋值给命令 "Scroll left"<br />
* 将 "Button 7" 键赋值给命令 "Scroll right"<br />
<br />
===在LG笔记本上的滚动和多功能===<br />
这些问题可能出现在多种型号的LG笔记本上。 <br />
症状包括:当按下鼠标键1时snaptics误认为同时有ScrollUP操作和一个鼠标键1按下;鼠标键2的情况类似.<br />
<br />
滚动问题可以通过添加下面一行到{{ic|xorg.conf}}中:<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "UpDownScrolling" "0"}}<br />
<br />
注意这会让synaptics对其它键的响应出错。有一个Oskar Sandberg写的补丁[http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html] 能够解决这个问题。<br />
<br />
但是不能为最新版的synaptics驱动打上面的补丁,编译会出错。您可以用GIT包来安装synaptics[http://web.telia.com/~u89404340/touchpad/synaptics/.git] 。<br />
<br />
AUR中也提供了一个相应的包:{{AUR|xf86-input-synaptics-lg}}{{Broken package link|{{aur-mirror|xf86-input-synaptics-lg}}}}<br />
<br />
To build the package after downloading the tarball and unpacking it, execute:<br />
{{bc|$ cd synaptics-git}}<br />
{{bc|$ makepkg}}<br />
<br />
=== 外置鼠标的其他问题 ===<br />
首先,你需要确定你的外部鼠标描述设置里面包含(或者类似)这一行:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "Device" "/dev/input/mice"}}<br />
<br />
如果"Device"行不一样,改成如上的,并且重新启动X。如果没有解决,修改"Server Layout"设置,将'''touchpad'''设置为 CorePointer:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "Touchpad" "CorePointer"}}<br />
<br />
将你的外接鼠标设置为"SendCoreEvents":<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|InputDevice "USB Mouse" "SendCoreEvents"}}<br />
<br />
最后,将这个添加到你的外接鼠标设置里面去:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|Option "SendCoreEvents" "true"}}<br />
<br />
如果还是不行,说不定是鼠标硬件有问题。请检查是不是bug,或者查看论坛,看是否有人有更好的解决方法。<br />
<br />
===触摸板的同步问题===<br />
有些时候指针会没有原因地“卡住”几秒或随机乱动。可以在{{ic|/var/log/messages.log}}中看到出现了如下提示:<br />
<br />
{{hc|/var/log/messages.log|psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away}}<br />
<br />
这个问题没有一个通用的解决办法,但是您可以尝试以下的方法:<br />
*如果您使用CPU频率调节,不要使用"ondemand"模式而是"performance"模式 ,因为触摸板可能会在cpu频率变化时失去同步。<br />
*尝试不要使用ACPI电池监视器。<br />
*尝试用"proto=imps"选项载入pmouse模块,添加下面一行到{{ic|/etc/modprobe.d/modprobe.conf}}中<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|2=options psmouse proto=imps}}<br />
<br />
*尝试其它桌面环境。据某些用户报告,这个问题仅在使用Xfce,GNOME时才出现,不知道什么原因。<br />
<br />
===触击与按键点击之间出现延迟===<br />
如果出现了这种情况,建议启用FastTaps<br />
{{Out of date|<br />
1.7.1版本的synaptics驱动里,已经移除了FastTaps选项<br />
}}<br />
<br />
将'''Option "FastTaps" "1"''' 添加到{{ic|/etc/X11/xorg.conf.d/10-synaptics.conf}} 中:<br />
{{hc|/etc/X11/xorg.conf.d/10-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
...<br />
Option "FastTaps" "1"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
===出现错误:SynPS/2 Synaptics TouchPad cannot grab event device, errno=16===<br />
如果你使用Xorg 7.4,查看Xorg日志(/var/log/Xorg.0.log)时候可能会发现有这么一条警告信息。这是因为当使用linux2.6事件协议,驱动默认会试图独占此设备。失败就会出现此条提示。也就是说其他无论是内核空间还是用户空间的程序都无法获取此设备上的信号。当你的xorg.conf里面还定义了一个/dev/misc输入设备时候,这点很有用。但是如果你想测试设备的信号,那么就很麻烦了。<br />
<br />
开启和关闭这项功能,可以修改你定义的xorg.conf的触摸板部分:<br />
<br />
Section "InputDevice"<br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
EndSection<br />
<br />
''boolean''部分可以是yes或者false,分别代表启用和禁止此功能。<br />
<br />
当然你也可以使用synclient来调整,不过不能马上生效,只有触摸板驱动被禁用然后重新启用才能有效果。你可以通过切换到控制台然后切换回X来实现。<br />
<br />
=== 从Windows系统重启后触摸板失去多点触控的能力 ===<br />
许多驱动都会在电脑启动时将固件载入到内存中.这些固件信息在重启后不一定会被清除,而且有可能和Linux下的驱动不兼容.唯一清除内存中此类信息的方法就是用关机取代重启.在实践中,一般认为不同操作系统的切换最好不要用重启来进行.<br />
<br />
=== Touchpad not recognized after shutdown from Arch ===<br />
Certain touchpads (elantech in particular) will fail to be recognized as a device of any sort after a standard shutdown from Arch linux. There are multiple possible solutions to this problem:<br />
* Boot into a Windows partition/install disk and shutdown from there.<br />
* Wait approximately 1 minute before turning on the computer after shutdown.<br />
* As discussed in https://bugzilla.kernel.org/show_bug.cgi?id=81331#c186 a patch has been merged into the stable kernel that provides a fix for Elantech touchpads. Gigabyte P34, P35v2 and X3 models are supported by default, for others (especially rebranded Gigabyte laptops, like XMG's) {{ic|1=i8042.kbdreset=1}} can be set as kernel parameter.<br />
<br />
=== Trackpoint and Clickpad ===<br />
Newer Thinkpads do not have physical buttons for their Trackpoint anymore and instead use the upper area of the Clickpad for buttons (Left, Middle, Right). <br />
Apart from the ergonomic viewpoint this works quite well with current Xorg. Unfortunately mouse wheel emulation using the middle button is not supported yet. Install {{AUR|xf86-input-evdev-trackpoint}} from the AUR for a patched and properly configured version if you intend to use the Trackpoint.<br />
<br />
=== ASUS Touchpads only recognised as PS/2 FocalTech emulated mouse ===<br />
<br />
# Install the linux header for your kernel<br />
# Install the focaltech-dkms from https://github.com/hanipouspilot/focaltech-dkms<br />
# Restart your computer<br />
# Edit your settings in the "Mouse and Trackpad" settings.<br />
<br />
== 参阅 ==<br />
<br />
* [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/ Synaptics 触摸板驱动]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Touchpad_Synaptics&diff=465627Touchpad Synaptics2017-01-17T10:56:21Z<p>Yafengabc: /* Non-functional Synaptics special abilities (multi-tap, scrolling, etc.) */</p>
<hr />
<div>[[Category:Input devices]]<br />
[[de:Synaptics Touchpad Treiber]]<br />
[[es:Touchpad Synaptics]]<br />
[[fr:Touchpad Synaptics]]<br />
[[it:Touchpad Synaptics]]<br />
[[ja:Synaptics タッチパッド]]<br />
[[ru:Touchpad Synaptics]]<br />
[[zh-hans:Touchpad Synaptics]]<br />
{{Related articles start}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
This article details the installation and configuration process of the '''''Synaptics input driver''''' for Synaptics (and ALPS) touchpads found on most notebooks.<br />
<br />
{{Tip|{{ic|xf86-input-synaptics}} is in maintenance mode and is no longer updated. If possible, use [[libinput]]. It implements a different approach to recognize and process multitouch features.}}<br />
<br />
{{Note|1=If you want to configure touchpad via GNOME control center, you need to use the [[libinput]] driver.[https://bugzilla.gnome.org/show_bug.cgi?id=764257#c12]}}<br />
<br />
== Installation ==<br />
<br />
The Synaptics driver can be [[installed]] with the package {{Pkg|xf86-input-synaptics}}.<br />
<br />
== Configuration ==<br />
<br />
The primary method of configuration for the touchpad is through an [[Xorg]] server configuration file. After installation of {{ic|xf86-input-synaptics}}, a default configuration file is located at {{ic|/usr/share/X11/xorg.conf.d/70-synaptics.conf}}. Users can copy this file to {{ic|/etc/X11/xorg.conf.d/}} and edit it to configure the various driver options available. Refer to the {{man|4|synaptics|url=}} manual page for a complete list of available options. Machine-specific options can be discovered using [[#Synclient|synclient]].<br />
<br />
=== Frequently used options ===<br />
<br />
The following example file configures some common options, including vertical, horizontal and circular scrolling as well as tap-to-click:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "3"<br />
Option "TapButton3" "2"<br />
Option "VertEdgeScroll" "on"<br />
Option "VertTwoFingerScroll" "on"<br />
Option "HorizEdgeScroll" "on"<br />
Option "HorizTwoFingerScroll" "on"<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "2"<br />
Option "EmulateTwoFingerMinZ" "40"<br />
Option "EmulateTwoFingerMinW" "8"<br />
Option "CoastingSpeed" "0"<br />
Option "FingerLow" "30"<br />
Option "FingerHigh" "50"<br />
Option "MaxTapTime" "125"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
; TapButton1: (integer) configures which mouse-button is reported on a non-corner, one finger tap.<br />
; TapButton2: (integer) configures which mouse-button is reported on a non-corner, two finger tap<br />
; TapButton3: (integer) configures which mouse-button is reported on a non-corner, three finger tap<br />
; RBCornerButton: (integer) configures which mouse-button is reported on a right bottom corner, one finger tap (use {{ic|Option "RBCornerButton" "3"}} to achieve Ubuntu style tap behaviour for right mouse button in lower right corner)<br />
; RTCornerButton: (integer) as above, but for top right corner, one finger tap.<br />
; VertEdgeScroll: (boolean) enables vertical scrolling while dragging across the right edge of the touch pad.<br />
; HorizEdgeScroll: (boolean) enables horizontal scrolling while dragging across the bottom edge of the touch pad.<br />
; VertTwoFingerScroll: (boolean) enables vertical scrolling using two fingers.<br />
; HorizTwoFingerScroll: (boolean) enables horizontal scrolling using two fingers.<br />
; EmulateTwoFingerMinZ/W: (integer) play with this value to set the precision of two finger scroll.<br />
; FingerLow: (integer) when finger pressure drops below this value, the driver counts it as a release.<br />
; FingerHigh: (integer) when finger pressure goes above this value, the driver counts it as a touch.<br />
; MaxTapTime: Determines how "crisp" a tap must be to be considered a real tap. Decrease the value to require a more crisp tap. Properly adjusting this parameter can reduce false positives when the hands hover over or lightly touch the pad.<br />
; VertScrollDelta and HorizScrollDelta: (integer) configures the speed of scrolling, it is a bit counter-intuitive because higher values produce greater precision and thus slower scrolling. Negative values cause natural scrolling like in macOS.<br />
<br />
{{Note|<br />
* If you find that your hand frequently brushes your touchpad, causing the {{ic|TapButton2}} option to be triggered (which will more than likely paste from your clipboard), and you do not mind losing two-finger-tap functionality, set {{ic|TapButton2}} to {{ic|0}}. Alternatively, see [[#Disable touchpad while typing]].<br />
* Recent versions include a "Coasting" feature, enabled by default, which may have the undesired effect of continuing almost any scrolling until the next tap or click, even if you are no longer touching the touchpad. This means that to scroll just a bit, you need to scroll (by using the edge, or a multitouch option) and then almost immediately tap the touchpad, otherwise scrolling will continue forever. If wish to avoid this, set {{ic|CoastingSpeed}} to {{ic|0}}.<br />
* If your touchpad is too sensitive, use higher values for {{ic|FingerLow}} and {{ic|FingerHigh}} and vice versa. Remember that {{ic|FingerLow}} should be smaller than {{ic|FingerHigh}}<br />
}}<br />
<br />
=== Configuration on the fly ===<br />
<br />
Next to the traditional method of configuration, the Synaptics driver also supports on the fly configuration. This means that users can set certain options through a software application, these options are applied immediately without needing to restart Xorg. This is useful to test configuration options before you include them in the configuration file or a script. Note that on the fly configuration is not persistent and lasts only until the Xorg server exists.<br />
<br />
==== Console tools ====<br />
<br />
* {{App|[[#Synclient|Synclient]]|command line utility to configure and query Synaptics driver settings|http://xorg.freedesktop.org/|{{Pkg|xf86-input-synaptics}}}}<br />
* {{App|[[#Using xinput to determine touchpad capabilities|xinput]]|general-purpose utility to configure X input devices|http://xorg.freedesktop.org/|{{Pkg|xorg-xinput}}}}<br />
<br />
==== Graphical tools ====<br />
<br />
* {{App|GPointing Device Settings|Provides graphical on the fly configuration for several pointing devices connected to the system, including your synaptics touch pad. This application replaces GSynaptics as the preferred tool for graphical touchpad configuration through the synaptics driver.|https://wiki.gnome.org/Attic/GPointingDeviceSettings|{{Pkg|gpointing-device-settings}}}}<br />
* {{App|kcm_touchpad|New configuration tool for [[KDE]] Plasma 5. It provides a module under input devices in System Settings. It is to be considered a replacement for ''synaptiks'' and the old ''kcm-touchpad'' module.|https://cgit.kde.org/plasma-desktop.git/tree/kcms/touchpad|4={{Pkg|plasma-desktop}}}}<br />
<br />
=== Xfce4/Cinnamon ===<br />
<br />
To change these settings in ''XFCE 4''':<br />
<br />
# Open ''System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
To change these settings in '''Cinnamon''':<br />
<br />
# Open ''Cinnamon System Settings''.<br />
# Click ''Mouse and Touchpad''.<br />
# Change the settings on the ''Touchpad'' tab.<br />
<br />
=== MATE ===<br />
<br />
It is possible configure the way MATE handles the touchpad:<br />
<br />
# Run {{ic|dconf-editor}}<br />
# Edit the keys in the {{ic|org.mate.desktop.peripherals.touchpad}} folder.<br />
<br />
To prevent Mate settings daemon from overriding existing settings, do as follows:<br />
<br />
# Run {{ic|dconf-editor}}<br />
# Edit {{ic|org.mate.SettingsDaemon.plugins.mouse}}<br />
# Uncheck the '''active''' setting.<br />
<br />
== Advanced configuration ==<br />
<br />
=== Using xinput to determine touchpad capabilities ===<br />
<br />
Depending on your model, synaptic touchpads may have or lack capabilities. We can determine which capabilities your hardware supports by using {{ic|xinput}}.<br />
<br />
* left, middle and right hardware buttons<br />
* two finger detection<br />
* three finger detection<br />
* configurable resolution<br />
<br />
First, find the name of your touchpad:<br />
<br />
$ xinput list<br />
<br />
You can now use {{ic|xinput}} to find your touchpad's capabilities:<br />
<br />
{{hc|$ xinput list-props "SynPS/2 Synaptics TouchPad" {{!}} grep Capabilities|<br />
Synaptics Capabilities (309): 1, 0, 1, 0, 0, 1, 1<br />
}}<br />
<br />
From left to right, this shows:<br />
* {{ic|1}}: device has a physical left button<br />
* {{ic|0}}: device does not have a physical middle button<br />
* {{ic|1}}: device has a physical right button<br />
* {{ic|0}}: device does not support two-finger detection<br />
* {{ic|0}}: device does not support three-finger detection<br />
* {{ic|1}}: device can configure vertical resolution<br />
* {{ic|1}}: device can configure horizontal resolution<br />
<br />
Use {{ic|xinput list-props "SynPS/2 Synaptics TouchPad"}} to list all device properties. See {{man|4|synaptics|url=}} for full documentation of the Synaptics properties.<br />
<br />
=== Synclient ===<br />
<br />
Synclient can configure every option available to the user as documented in {{man|4|synaptics|url=}}. A full list of the current user settings can be brought up:<br />
<br />
$ synclient -l<br />
<br />
Every listed configuration option can be controlled through synclient, for example:<br />
<br />
* Enable palm detection: {{ic|1=$ synclient PalmDetect=1}} <br />
* Configure button events (right button event for two finger tap here): {{ic|1=$ synclient TapButton2=3}} <br />
* Disable the touchpad: {{ic|1=$ synclient TouchpadOff=1}} <br />
<br />
After you have successfully tried and tested your options through synclient, you can make these changes permanent by adding them to {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}}.<br />
<br />
=== evtest ===<br />
<br />
The tool {{Pkg|evtest}} can display pressure and placement on the touchpad in real-time, allowing further refinement of the default Synaptics settings. The evtest monitoring can be started with:<br />
<br />
$ evtest /dev/input/event''X''<br />
<br />
''X'' denotes the touchpad's ID. It can be found by looking at the output of {{ic|cat /proc/bus/input/devices}}.<br />
<br />
evtest needs exclusive access to the device which means it cannot be run together with an X server instance. You can either kill the X server or run evtest from a different virtual terminal (e.g., by pressing {{ic|Ctrl+Alt+2}}).<br />
<br />
=== xev ===<br />
<br />
The tool {{Pkg|xorg-xev}} can display taps, clicks, pressure, placement and other measured parameters in real-time, allowing still further refinement of the default Synaptics settings. xev can be run in X and needs no specifics. using the "-event" parameter, it is possible to restrict the types of events that are reported.<br />
<br />
=== Circular Scrolling ===<br />
<br />
Circular scrolling is a feature that Synaptics offers which closely resembles the behaviour of iPods. Instead of (or additional to) scrolling horizontally or vertically, you can scroll circularly. Some users find this faster and more precise.<br />
To enable circular scrolling, add the following options to the touchpad device section of {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}}:<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "CircularScrolling" "on"<br />
Option "CircScrollTrigger" "0"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
The option '''CircScrollTrigger''' may be one of the following values, determining which edge circular scrolling should start:<br />
<br />
0 All Edges<br />
1 Top Edge<br />
2 Top Right Corner<br />
3 Right Edge<br />
4 Bottom Right Corner<br />
5 Bottom Edge<br />
6 Bottom Left Corner<br />
7 Left Edge<br />
8 Top Left Corner<br />
<br />
Specifying something different from zero may be useful if you want to use circular scrolling in conjunction with horizontal and/or vertical scrolling. If you do so, the type of scrolling is determined by the edge you start from.<br />
<br />
To scroll fast, draw small circles in the center of your touchpad. To scroll slowly and more precise, draw large circles.<br />
<br />
=== Natural scrolling ===<br />
<br />
It is possible to enable natural scrolling through synaptics. Simply use negative values for {{ic|VertScrollDelta}} and {{ic|HorizScrollDelta}} like so:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
...<br />
Option "VertScrollDelta" "-111"<br />
Option "HorizScrollDelta" "-111"<br />
...<br />
EndSection<br />
</nowiki>}}<br />
<br />
=== Software toggle ===<br />
<br />
You might want to turn the touchpad on and off with a simple button click or shortcut. This can be done by binding the following ''xinput''-based script to a keyboard event as explained in [[Extra keyboard keys in Xorg]]:<br />
<br />
{{hc|/usr/local/bin/touchpad_toggle.sh|2=<nowiki><br />
#!/bin/bash<br />
<br />
declare -i ID<br />
ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`<br />
declare -i STATE<br />
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`<br />
if [ $STATE -eq 1 ]<br />
then<br />
xinput disable $ID<br />
# echo "Touchpad disabled."<br />
# notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png<br />
else<br />
xinput enable $ID<br />
# echo "Touchpad enabled."<br />
# notify-send 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png<br />
fi<br />
</nowiki>}}<br />
<br />
{{Tip|When using external monitors with [[bumblebee]], the touchpad can be configured on the second X server by prepending {{ic|1=DISPLAY=:8}} to the command.}} <br />
<br />
Alternatively, {{ic|synclient}} can be used to toggle the touchpad. However, it can only turn off touch events but not physical clickpad button usage:<br />
<br />
{{hc|/usr/local/bin/touchpad.sh|<nowiki><br />
#!/bin/bash<br />
<br />
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')<br />
</nowiki>}}<br />
<br />
=== Disable touchpad while typing ===<br />
<br />
==== Using the driver's automatic palm detection ====<br />
<br />
First of all you should test if it works properly for your touchpad and if the settings are accurate. Enable palm detection with<br />
<br />
$ synclient PalmDetect=1<br />
<br />
Then test the typing. You can tweak the detection by setting the minimum width for the touch to be considered a palm, for example<br />
<br />
$ synclient PalmMinWidth=8<br />
<br />
And you can tweak the minimum pressure required for the touch to be considered a palm, for example<br />
<br />
$ synclient PalmMinZ=100<br />
<br />
{{Tip|To help find the best values for palm detection, you can use {{pkg|evtest}} to see the width and Z values reported during touchpad use.}}<br />
<br />
Once you have found the correct settings, you can add them to your [[#Configuration|config file]]:<br />
<br />
{{bc|<nowiki><br />
Option "PalmDetect" "1"<br />
Option "PalmMinWidth" "8"<br />
Option "PalmMinZ" "100"<br />
</nowiki>}}<br />
<br />
{{Warning|1=For some touchpads, an [https://bugzilla.kernel.org/show_bug.cgi?id=77161 issue] with the kernel can cause the palm width to always be reported as 0. This breaks palm detection in a majority of cases. Pending an actual fix, you can [https://gist.github.com/silverhammermba/a231c8156ecaa63c86f1 patch] the synaptics package to use only Z for palm detection.}}<br />
<br />
{{Tip|If you experience problems with consistent palm detection for your hardware, an alternative to try is [[libinput]].}}<br />
<br />
==== Using syndaemon ====<br />
<br />
{{ic|syndaemon}} monitors keyboard activity and disables the touchpad while typing. It has several options to control when the disabling occurs. View them with<br />
<br />
$ syndaemon -h<br />
<br />
For example, to disable tapping and scrolling for 0.5 seconds after each keypress (ignoring modifier keys like Ctrl), use<br />
<br />
$ syndaemon -i 0.5 -t -K -R<br />
<br />
Once you have determined the options you like, you should use your login manager or [[xinitrc]] to have it run automatically when X starts. The {{ic|-d}} option will make it start in the background as a daemon.<br />
<br />
=== Disable touchpad on mouse detection ===<br />
<br />
With the assistance of [[udev]], it is possible to automatically disable the touchpad if an external mouse has been plugged in. To achieve this, use one of the following rules.<br />
<br />
==== Basic desktop ====<br />
<br />
This is a basic rule generally for non-"desktop environment" sessions:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/''username''/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/''username''/.Xauthority", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
}}<br />
<br />
If the touchpad is always deactivated at startup, even when no mouse is plugged in, try adding the following criteria between the KERNEL and ACTION parameters above:<br />
<br />
ATTRS{name}!="*TouchPad", ATTRS{name}!="*Stick",<br />
<br />
==== GDM ====<br />
<br />
{{Accuracy|saying that GDM ''usually'' does something does not make sense}}<br />
<br />
GDM usually stores the Xauthority files in {{ic|/var/run/gdm}} in a randomly-named directory. You should find your actual path to the Xauthority file which can be done using {{ic|ps ax}}. For some reason multiple authority files may appear for a user, so a rule like will be necessary:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="add", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print0 -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=1"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="remove", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print0 -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/usr/bin/synclient TouchpadOff=0"<br />
}}<br />
<br />
Furthermore, you should validate that your udev script is running properly! You can check for the conditions using {{ic| udevadm monitor -p}} which must be run as root.<br />
<br />
===== With syndaemon running =====<br />
<br />
{{ic|syndaemon}} whether started by the [[#Using syndaemon|user]] or the desktop environment can conflict with synclient and will need to be disabled. A rule like this will be needed:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]", ACTION=="add", PROGRAM="/usr/bin/find /var/run/gdm -name ''username'' -print -quit", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="$result/database", RUN+="/bin/sh -c '/usr/bin/synclient TouchpadOff=1 ; sleep 1; /bin/killall syndaemon; '"<br />
}}<br />
<br />
===== touchpad-state =====<br />
<br />
An AUR package {{aur|touchpad-state-git}} has been created around the udev rules above. It includes a udev rule and script:<br />
<br />
touchpad-state [--off] [--on]<br />
<br />
==== GNOME ====<br />
<br />
GNOME users can install GNOME shell extension [https://extensions.gnome.org/extension/131/touchpad-indicator/ Touchpad Indicator], change "Switch Method" to "Synclient" and enable "Automatically switch Touchpad On/Off" in its preferences.<br />
<br />
==== KDE ====<br />
<br />
If using Plasma, the package {{Pkg|plasma-desktop}} can be used to manage the touchpad.<br />
<br />
==== System with multiple X sessions ====<br />
<br />
{{Accuracy|Hard-coded {{ic|DISPLAY}} variable does not work with multiple X sessions.}} <br />
<br />
For an environment where multiple users are present, a slightly different approach is needed to detect the current users X environment. This script will help achieving this:<br />
<br />
{{hc|/usr/bin/mouse-pnp-event-handler.sh|<nowiki><br />
#!/bin/sh<br />
## $1 = "add" / "remove"<br />
## $2 = %k from udev <br />
<br />
## Set TRACKPAD_NAME according to your configuration. <br />
## Check your trackpad name with: <br />
## find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'<br />
TRACKPAD_NAME="SynPS/2 Synaptics TouchPad"<br />
<br />
USERLIST=$(w -h | cut -d' ' -f1 | sort | uniq)<br />
MOUSELIST=$(find /sys/class/input/ -name mouse*)<br />
<br />
for CUR_USER in ${USERLIST}; do<br />
CUR_USER_XAUTH="$(sudo -Hiu ${CUR_USER} env | grep -e "^HOME=" | cut -d'=' -f2)/.Xauthority"<br />
<br />
<br />
## Can't find a way to get another users DISPLAY variable from an isolated root environment. Have to set it manually.<br />
#CUR_USER_DISPL="$(sudo -Hiu ${CUR_USER} env | grep -e "^DISPLAY=" | cut -d'=' -f2)"<br />
CUR_USER_DISPL=":0"<br />
<br />
export XAUTHORITY="${CUR_USER_XAUTH}"<br />
export DISPLAY="${CUR_USER_DISPL}"<br />
<br />
if [ -f "${CUR_USER_XAUTH}" ]; then<br />
case "$1" in<br />
"add")<br />
/usr/bin/synclient TouchpadOff=1<br />
/usr/bin/logger "USB mouse plugged. Disabling touchpad for $CUR_USER. ($XAUTHORITY - $DISPLAY)"<br />
;;<br />
"remove")<br />
## Only execute synclient if there are no external USB mice connected to the system.<br />
EXT_MOUSE_FOUND="0"<br />
for CUR_MOUSE in ${MOUSELIST}; do<br />
if [ "$(cat ${CUR_MOUSE}/device/name)" != "${TRACKPAD_NAME}" ]; then<br />
EXT_MOUSE_FOUND="1"<br />
fi<br />
done<br />
if [ "${EXT_MOUSE_FOUND}" == "0" ]; then<br />
/usr/bin/synclient TouchpadOff=0<br />
/usr/bin/logger "No additional external mice found. Enabling touchpad for $CUR_USER."<br />
else<br />
logger "Additional external mice found. Won't enable touchpad yet for $CUR_USER."<br />
fi<br />
;;<br />
esac<br />
fi<br />
done<br />
</nowiki>}}<br />
<br />
Update the {{ic|TRACKPAD_NAME}} variable for your system configuration.<br />
Run {{ic|<nowiki>find /sys/class/input/ -name mouse* -exec udevadm info -a {} \; | grep 'ATTRS{name}'</nowiki>}} to get a list of useful mice-names. Choose the one for your trackpad.<br />
<br />
Then have udev run this script when USB mices are plugged in or out, with these udev rules:<br />
<br />
{{hc|/etc/udev/rules.d/01-touchpad.rules|2=<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="add", RUN+="/usr/bin/mouse-pnp-event-handler.sh add %k"<br />
SUBSYSTEM=="input", KERNEL=="mouse[0-9]*", ACTION=="remove", RUN+="/usr/bin/mouse-pnp-event-handler.sh remove %k"<br />
}}<br />
<br />
=== Buttonless touchpads (aka ClickPads) ===<br />
<br />
Ever more laptops have a special kind of touchpad which has a single mouse button as part of the tracking plate, instead of external buttons. For example, the 2015 Dell XPS 13, HP series 4500 ProBooks, ThinkPad X220 and X1 ThinkPad series have this kind of a touchpad. By default, the whole button area is detected as a left button, so right and middle-click functions and click + drag will not work. It is possible to define two and three finger clicks as right and middle button clicks, and/or to define parts of the click pad surface as right and middle buttons. Note that although the driver registers multiple touches, it does not track individual fingers (as of version 1.7.1) which results in confusing behavior when using physical buttons of a clickpad for drag-and-drop and other gestures: you have to click with two or three fingers but then only move one of them while holding the button down with another. You can look into the {{AUR|xf86-input-mtrack}} driver for better multitouch support.<br />
<br />
Some desktop environments (KDE and GNOME at least) define sane and useful default configurations for clickpads, providing a right button at the bottom right of the pad, recognising two and three-finger clicks anywhere on the pad as right and middle clicks, and providing configuration options to define two and three-finger taps as right and middle clicks. If your desktop does not do this, or if you want more control, you can modify the touchpad section in {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}} (or better, of your custom synaptics configuration file prefixed with a higher number). For example:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
# Enable clickpad/multitouch support<br />
Option "ClickPad" "true"<br />
# Middle-button emulation is not supported<br />
Option "EmulateMidButtonTime" "0"<br />
# Define right soft button at the bottom<br />
Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"<br />
EndSection<br />
</nowiki>}}<br />
<br />
The format for the SoftButtonAreas option is (from {{man|4|synaptics|url=}}):<br />
{{bc|RightButtonAreaLeft RightButtonAreaRight RightButtonAreaTop RightButtonAreaBottom MiddleButtonAreaLeft MiddleButtonAreaRight MiddleButtonAreaTop MiddleButtonAreaBottom}}<br />
<br />
The above "SoftButtonAreas" option is commonly found in documentation or synaptics packages, and it defines the right half of the bottom 18% of the touchpad as a right button. There is '''no middle button''' defined. If you want to define a middle button remember one key piece of information from the manual; '''edge set to 0 extends to infinity in that direction.'''<br />
<br />
In the following example the right button will occupy the rightmost 40% of the button area and the middle button 20% of it in the center. The leftmost 40% remains as a left button (as does the rest of the clickpad):<br />
<br />
...<br />
Option "SoftButtonAreas" "60% 0 82% 0 40% 59% 82% 0"<br />
...<br />
<br />
You can use {{ic|<nowiki>synclient</nowiki>}} to check the soft button areas: <br />
<br />
{{hc|<nowiki>$ synclient -l | grep -i ButtonArea</nowiki>|<nowiki><br />
RightButtonAreaLeft = 3914<br />
RightButtonAreaRight = 0<br />
RightButtonAreaTop = 3918<br />
RightButtonAreaBottom = 0<br />
MiddleButtonAreaLeft = 3100<br />
MiddleButtonAreaRight = 3873<br />
MiddleButtonAreaTop = 3918<br />
MiddleButtonAreaBottom = 0<br />
</nowiki>}}<br />
<br />
If your buttons are not working, soft button areas are not changing, ensure you do not have a synaptics configuration file distributed by a package which is overriding your custom settings (ie. some AUR packages distribute configurations prefixed with very high numbers).<br />
<br />
These settings cannot be modified on the fly with {{ic|<nowiki>synclient</nowiki>}}, however, {{ic|<nowiki>xinput</nowiki>}} works:<br />
<br />
xinput set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Soft Button Areas" 4000 0 4063 0 3000 4000 4063 0<br />
<br />
You cannot use percentages with this command, so look at {{ic|/var/log/Xorg.0.log}} to figure out the touchpad x and y-axis ranges.<br />
<br />
==== Bottom edge correction ====<br />
<br />
In some cases, for example Toshiba Satellite P50, everything work out of the box except often your click are seen as mouse movement and the cursor will jump away just before registering the click.<br />
This can be easily solved running<br />
<br />
$ synclient -l | grep BottomEdge<br />
<br />
take the BottomEdge value and subtract a the wanted height of your button, then temporary apply with<br />
<br />
$ synclient AreaBottomEdge=4000<br />
<br />
when a good value has been found make it a fixed correction with<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
...<br />
Option "AreaBottomEdge" "4000"<br />
...<br />
</nowiki>}}<br />
<br />
{{Note|The area will not act as touchpad if the touch '''begins''' in that area, but it can still be used if the touch has originated outside.}}<br />
<br />
== Troubleshooting ==<br />
<br />
=== Touchpad does not work after resuming from hibernate/suspend ===<br />
<br />
Occasionally touchpads will fail to work when the computer resumes from sleep or hibernation. This can often be corrected without rebooting by<br />
<br />
* Switching to a console and back again,<br />
* entering sleep mode again, and resuming again, or<br />
* locating the correct kernel module, then removing it and inserting it again. <br />
<br />
{{Note|You can use Ctrl-Alt-F1 through F8 to switch to a console without using the mouse.}}<br />
<br />
modprobe -r psmouse #psmouse happens to be the kernel module for my touchpad (Alps DualPoint)<br />
modprobe psmouse<br />
<br />
Now switch back to the tty that X is running on. If you chose the right module, your touchpad should be working again.<br />
<br />
=== xorg.conf.d/70-synaptics.conf does not seem to apply in MATE ===<br />
<br />
[[MATE]] will by default overwrite various options for your touchpad. This includes configurable features for which there is no graphical configuration within MATE's system control panel. This may cause it to appear that {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}} is not applied. Follow [[#MATE]] to prevent this behavior.<br />
<br />
=== The touchpad is not working, Xorg.0.log shows "Query no Synaptics: 6003C8" ===<br />
<br />
Due to the way synaptics is currently set-up, 2 instances of the synaptics module are loaded. We can recognize this situation by opening the xorg log file ({{ic|/var/log/Xorg.0.log}}) and noticing this:<br />
<br />
{{hc|/var/log/Xorg.0.log|<nowiki><br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"<br />
[ 9304.803] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"<br />
</nowiki>}}<br />
<br />
Notice how 2 differently named instances of the module are being loaded. In some cases, this causes the touchpad to become nonfunctional.<br />
<br />
We can prevent this double loading by adding {{ic|MatchDevicePath "/dev/input/event*"}} to our {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}} file:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|<nowiki><br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
Driver "synaptics"<br />
MatchIsTouchpad "on"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "TapButton1" "1"<br />
Option "TapButton2" "2"<br />
Option "TapButton3" "3"<br />
EndSection <br />
</nowiki>}}<br />
<br />
Restart X and check xorg logs again, the error should be gone and the touchpad should be functional.<br />
<br />
related bugreport: {{Bug|20830}}<br />
<br />
related forum topics:<br />
<br />
* https://bbs.archlinux.org/viewtopic.php?id=104769<br />
* https://bbs.archlinux.org/viewtopic.php?pid=825690<br />
<br />
=== Touchpad detected as "PS/2 Generic Mouse" or "Logitech PS/2 mouse" ===<br />
<br />
This can be caused by a number of issues;<br />
<br />
==== Elantech touchpads ====<br />
<br />
This can happen with some laptops with an Elantech touchpad, for example the ASUS x53s. In this situation you need {{AUR|psmouse-alps-driver}}{{Broken package link|{{aur-mirror|psmouse-alps-driver}}}} package from [[AUR]].<br />
<br />
==== Laptops with touchscreen & touchpad ====<br />
<br />
There also seems to be a problem with laptops which have both a touchscreen & a touchpad, such as the Dell XPS 12 or Dell XPS 13. To fix this, you can [[blacklisting|blacklist]] the {{ic|i2c_hid}} driver, this does have the side-effect of disabling the touchscreen though.<br />
<br />
This [http://www.spinics.net/lists/linux-input/msg27768.html seems to be a known problem]. Also see [https://bbs.archlinux.org/viewtopic.php?pid=1419078 this thread].<br />
<br />
Post kernel 3.15, having the module blacklisted may cause touchpad to stop working completely. Removing the blacklist should allow this to start working with limited functionality, see {{Bug|40921}}.<br />
<br />
=== Non-functional Synaptics special abilities (multi-tap, scrolling, etc.) ===<br />
<br />
In some cases Synaptics touchpads only work partially. Features like two-finger scrolling or two-finger middle-click do not work even if properly enabled. This is probably related to the [[#The touchpad is not working, Xorg.0.log shows "Query no Synaptics: 6003C8"|The touchpad is not working]] problem mentioned above. Fix is the same, prevent double module loading.<br />
<br />
If preventing the module from loading twice does not solve your issue, try commenting out the toggle {{ic|MatchIsTouchpad}} (which is now included by default in the synaptics config).<br />
<br />
If clicking with either 2 or 3 fingers is interpreted as a right-click, so you cannot get a middle click either way regardless of configuration, this bug is probably the culprit: https://bugs.freedesktop.org/show_bug.cgi?id=55365<br />
<br />
====No Multi-touch in some Elantech touchpads====<br />
<br />
add "i8042.reset i8042.nomux i8042.nopnp i8042.noloop" to the kernel boot options.<br />
<br />
in my laptop i add two options"i8042.reset i8042.nomux",and Multi-touch work fine<br />
<br />
=== Cursor jump ===<br />
<br />
Some users have their cursor inexplicably ''jump'' around the screen. There currently no patch for this, but the developers are aware of the problem and are working on it.<br />
<br />
Another posibility is that you are experiencing ''IRQ losses'' related to the i8042 controller (this device handles the keyboard and the touchpad of many laptops), so you have two possibilities here:<br />
<br />
1. rmmod && insmod the psmouse module.<br />
<br />
2. append {{ic|i8042.nomux=1}} to your [[kernel parameters]] and reboot your machine.<br />
<br />
=== Touchpad device is not located at {{ic|/dev/input/*}} ===<br />
<br />
If that is the case, you can use this command to display information about your input devices:<br />
<br />
$ cat /proc/bus/input/devices<br />
<br />
Search for an input device which has the name "SynPS/2 Synaptics TouchPad". The "Handlers" section of the output specifies what device you need to specify.<br />
<br />
'''Example output:'''<br />
<br />
{{hc|$ cat /proc/bus/input/devices|<nowiki><br />
I: Bus=0011 Vendor=0002 Product=0007 Version=0000<br />
N: Name="SynPS/2 Synaptics TouchPad"<br />
P: Phys=isa0060/serio4/input0<br />
S: Sysfs=/class/input/input1<br />
H: Handlers=mouse0 event1<br />
B: EV=b<br />
B: KEY=6420 0 7000f 0<br />
</nowiki>}}<br />
<br />
In this case, the {{ic|Handlers}} are {{ic|mouse0}} and {{ic|event1}}, so {{ic|/dev/input/mouse0}} would be used.<br />
<br />
{{Expansion|TODO: explain how to apply this in {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}}}}<br />
<br />
=== Firefox and special touchpad events ===<br />
<br />
You can enable/disable some special events that Firefox handles upon tapping or scrolling certain parts of your touchpad by editing the settings of those actions.<br />
Type {{ic|about:config}} in your Firefox address bar.<br />
To alter options, double-click on the line in question.<br />
<br />
==== Firefox 17.0 and later ====<br />
<br />
Horizontal scrolling will now by default scroll through pages and not through your history. To reenable Mac-style forward/backward with two-finger swiping, edit:<br />
<br />
mousewheel.default.action.override_x = 2<br />
<br />
You may encounter accidental forwards/backwards while scrolling vertically. To change Firefox's sensitivity to horizontal swipes, edit:<br />
<br />
mousewheel.default.delta_multiplier_x<br />
<br />
The optimum value will depend on your touchpad and how you use it, try starting with {{ic|10}}. A negative value will reverse the swipe directions.<br />
<br />
=== Opera: horizontal scrolling issues ===<br />
<br />
Same as above.<br />
To fix it, go to ''Tools > Preferences > Advanced > Shortcuts''. Select "Opera Standard" mouse setup and click "Edit". In "Application" section:<br />
<br />
{{Accuracy|Description here is not so clear and i don't use Opera,Please make it clear :)}}<br />
<br />
* assign key "Button 6" to command "Scroll left"<br />
* assign key "Button 7" to command "Scroll right"<br />
<br />
=== Scrolling and multiple actions with Synaptics on LG laptops ===<br />
<br />
These problems seem to be occurring on several models of LG laptops.<br />
Symptoms include: when pressing Mouse Button 1, Synaptics interprets it as ScrollUP and a regular button 1 click; same goes for button 2.<br />
<br />
The scrolling issue can be resolved by entering in {{ic|xorg.conf}}:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|<br />
Option "UpDownScrolling" "0"<br />
}}<br />
<br />
{{Note|This will make Synaptics interpret one button push as three. There is a patch written by Oskar Sandberg [http://www.math.chalmers.se/~ossa/linux/lg_tx_express.html] that removes these clicks.}}<br />
<br />
Apparently, when trying to compile this against the latest version of Synaptics it fails. The solution to this is using the GIT repository for Synaptics [http://web.telia.com/~u89404340/touchpad/synaptics/.git].<br />
<br />
There is also a package build file in the AUR to automate this: {{AUR|xf86-input-synaptics-lg}}{{Broken package link|{{aur-mirror|xf86-input-synaptics-lg}}}}.<br />
<br />
To build the package after downloading the tarball and unpacking it, execute:<br />
<br />
$ cd synaptics-git<br />
$ makepkg<br />
<br />
=== Other external mouse issues ===<br />
<br />
First, make sure your section describing the external mouse contains this line (or that the line looks like this):<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|<br />
Option "Device" "/dev/input/mice"<br />
}}<br />
<br />
If the "Device" line is different, change it to the above and try to restart X. If this does not solve your problem, make your '''touchpad''' is the CorePointer in the "Server Layout" section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|<br />
InputDevice "Touchpad" "CorePointer"<br />
}}<br />
<br />
and make your external device "SendCoreEvents":<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|<br />
InputDevice "USB Mouse" "SendCoreEvents"<br />
}}<br />
<br />
finally add this to your external device's section:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/xorg.conf|<br />
Option "SendCoreEvents" "true"<br />
}}<br />
<br />
If all of the above does not work for you, please check relevant bug trackers for possible bugs, or go through the forums to see if anyone has found a better solution.<br />
<br />
=== Touchpad synchronization issues ===<br />
<br />
{{Out of date|section=Outdated "Touchpad synchronization issues" section}}<br />
<br />
Sometimes the cursor may freeze for several seconds or start acting on its own for no apparent reason. This behavior is accompanied by records in {{ic|/var/log/messages.log}}<br />
<br />
{{hc|/var/log/messages.log|<br />
psmouse.c: TouchPad at isa0060/serio1/input0 lost synchronization, throwing 3 bytes away<br />
}}<br />
<br />
This problem has no general solution, but there are several possible workarounds.<br />
* If you use CPU frequency scaling, avoid using the "ondemand" governor and use the "performance" governor when possible, as the touchpad may lose sync when the CPU frequency changes.<br />
* Avoid using an ACPI battery monitor.<br />
* Attempt to load psmouse with "proto=imps" option. To do that, add this line to your {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|2=<br />
options psmouse proto=imps<br />
}}<br />
<br />
* Try another desktop environment. Some users report that this problem only occurs when using XFCE or GNOME, for whatever reason<br />
<br />
=== Xorg.log.0 shows SynPS/2 Synaptics touchpad can not grab event device, errno=16 ===<br />
<br />
If you are using Xorg 7.4, you may get a warning like this from {{ic|/var/log/Xorg.0.log}}, thais is because the driver will grab the event device for exclusive use when using the Linux 2.6 event protocol. When it fails, X will return this error message.<br />
<br />
Grabbing the event device means that no other user space or kernel space program sees the touchpad events. This is desirable if the X config file includes {{ic|/dev/input/mice}} as an input device, but is undesirable if you want to monitor the device from user space.<br />
<br />
If you want to control it, add or modify the "GrabEventDevice" option in you touchpad section in {{ic|/etc/X11/xorg.conf.d/70-synaptics.conf}}:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/70-synaptics.conf|2=<br />
...<br />
Option "GrabEventDevice" "''boolean''"<br />
...<br />
}}<br />
<br />
This will come into effect when X is restarted, though you can also change it by using synclient. When changing this parameter with the synclient program, the change will not take effect until the Synaptics driver is disabled and re-enabled. This can be achieved by switching to a text console and then switching back to X.<br />
<br />
=== Synaptics loses multitouch detection after rebooting from Windows ===<br />
<br />
Many drivers include a firmware that is loaded into flash memory when the computer boots. This firmware is not necessarily cleared upon shutdown, and is not always compatible with Linux drivers. The only way to clear the flash memory is to shutdown completely rather than using reboot. It is generally considered best practice to never use reboot when switching between operating systems.<br />
<br />
=== Touchpad not recognized after shutdown from Arch ===<br />
<br />
Certain touchpads (elantech in particular) will fail to be recognized as a device of any sort after a standard shutdown from Arch linux. There are multiple possible solutions to this problem:<br />
<br />
* Boot into a Windows partition/install disk and shutdown from there.<br />
* Wait approximately 1 minute before turning on the computer after shutdown.<br />
* As discussed in https://bugzilla.kernel.org/show_bug.cgi?id=81331#c186 a patch has been merged into the stable kernel that provides a fix for Elantech touchpads. Gigabyte P34, P35v2 and X3 models are supported by default, for others (especially rebranded Gigabyte laptops, like XMG's) {{ic|1=i8042.kbdreset=1}} can be set as kernel parameter.<br />
<br />
=== Trackpoint and Clickpad ===<br />
<br />
Newer Thinkpads do not have physical buttons for their Trackpoint anymore and instead use the upper area of the Clickpad for buttons (Left, Middle, Right). <br />
Apart from the ergonomic viewpoint this works quite well with current Xorg. Unfortunately mouse wheel emulation using the middle button is not supported yet. Install {{AUR|xf86-input-evdev-trackpoint}} from the AUR for a patched and properly configured version if you intend to use the Trackpoint.<br />
<br />
=== ASUS Touchpads only recognised as PS/2 FocalTech emulated mouse ===<br />
<br />
# Install the linux header for your kernel<br />
# Install the focaltech-dkms from https://github.com/hanipouspilot/focaltech-dkms<br />
# Restart your computer<br />
# Edit your settings in the "Mouse and Trackpad" settings.<br />
# If the above does not work, the dkms from https://github.com/vlasenko/hid-asus-dkms could be used<br />
# For more informations see https://bugzilla.kernel.org/show_bug.cgi?id=120181<br />
<br />
== See also ==<br />
<br />
* [http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/ Synaptics touchpad driver]<br />
* [http://www.x.org/archive/X11R7.5/doc/man/man4/synaptics.4.html Synaptics manual on x.org ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=343907NVIDIA (简体中文)2014-11-08T16:46:14Z<p>Yafengabc: /* 没有笔记本电脑上的亮度控制 */</p>
<hr />
<div>[[Category: 简体中文]]<br />
[[Category: Graphics (简体中文)]]<br />
[[Category: X Server (简体中文)]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[en:NVIDIA]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
{{Related articles start (简体中文)}}<br />
{{Related|Nouveau}}<br />
{{Related|Xorg (简体中文)}}<br />
{{Related articles end}}<br />
<br />
本文包含安装和配置 [http://www.nvidia.com NVIDIA] ''专有'' 显卡驱动的信息。想要了解开源驱动的信息,参见 [[Nouveau]].<br />
<br />
== 安装 ==<br />
<br />
该部分仅适用于 {{Pkg|linux}} 内核包,定制内核请[[#备用安装:定制内核|略过]]该小节。<br />
<br />
{{小贴士|您最好是使用ArchLinux的[[pacman (简体中文)|pacman]]来安装驱动,而不是直接到[http://www.nvidia.cn 英伟达官网]去下载驱动,因为这样会在更新系统时同时更新。}}<br />
<br />
1.访问 NVIDIA [http://www.nvidia.cn/Download/index.aspx?lang=cn 中文驱动下载页面]来找到给定显卡的合适驱动。也可以检查[http://www.nvidia.com/object/IO_32667.html 老显卡列表].<br />
<br />
:{{Note|For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[AUR]], since the stable drivers may not support the newly introduced features. Try the stable ones first (see bellow).}}<br />
<br />
2. Install the appropriate driver for your card:<br />
:* For GeForce 8 series and newer [NVC0 and newer] cards, install {{Pkg|nvidia}} package, available in the [[official repositories]].<br />
:* For GeForce 6/7 series cards [NV40-NVAF], install {{Pkg|nvidia-304xx}} package, available in the [[official repositories]].<br />
:* For GeForce 5 FX series cards [NV30-NV38], install {{AUR|nvidia-173xx}} package, available in the [[Arch User Repository]].<br />
:* For GeForce2 MX, GeForce3 and GeForce4 series cards [NV11 and NV17-NV28], install {{AUR|nvidia-96xx}} package, available in the [[Arch User Repository]].<br />
<br />
:nvidia {-173xx,-96xx}-utils 包会跟 libgl 冲突,所以安装的时候,如果 pacman 询问您移除 libgl 并且因为依赖无法移除,您可以使用 {{ic|# pacman -Rdd libgl}} 移除 libgl.<br />
<br />
{{注意|假如您是使用最新的显卡,您也许需要使用[[AUR]]上的驱动{{AUR|nvidia-beta}}和{{AUR|nvidia-utils-beta}},因为稳定版的驱动不支持一些新引入的特性。}}<br />
<br />
{{注意|在64位的操作系统上,假如您想发挥32位的程序发挥好nvidia-utils的优势,还必须安装lib32的包(例如{{pkg|lib32-nvidia-libgl}} 或者 {{AUR|lib32-nvidia-utils-beta}})。}}<br />
<br />
3. '''重新启动您的计算机''', nvidia{,-304xx,-173xx,-96xx}-utils包含一个文件可以把nouveau加入模块黑名单。重新启动会使黑名单生效。 <br />
<br />
一旦驱动安装完毕,就可以进入下一步了:[[#配置|配置英伟达驱动]]。<br />
<br />
===备用安装:定制内核===<br />
在此之前,您最好了解一下Arch的打包系统(the Arch Build System)的工作原理:<br />
* 这里是一篇[[Arch_Build_System_(简体中文)]]的介绍<br />
* 还有[[Makepkg_(简体中文)]]<br />
* 还有[[Creating_Packages_(简体中文)]]<br />
<br />
{{注意|在[[AUR]]上有一个叫{{AUR|nvidia-all}}的软件包可以帮助您更方便地安装英伟达的专有驱动,它适合于定制内核或者多内核。}}<br />
<br />
下面的这篇短小精悍的教程将教您怎样使用[[ABS]]来定制您的驱动。<br />
<br />
安装ABS和生成目录树:<br />
# pacman -S abs<br />
# abs<br />
作为一个标准的ArchLinux用户,请为新的软件包创建一个临时目录:<br />
$ mkdir -p ~/devel/abs<br />
为英伟达的驱动包创建一个拷贝:<br />
$ cp -r /var/abs/extra/nvidia/ ~/devel/abs/<br />
下面,可以进入英伟达驱动的工程目录了:<br />
$ cd ~/devel/abs/nvidia<br />
您可以编辑一下一些文件{{ic|nvidia.install}}和{{ic|PKGBUILD}}以便它们包含的正确的内核版本变量。<br />
<br />
在运行定制内核的时候,可以用下面的方式得到相应的内核和本地版本的名称:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are more than one kernels in the system installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nvidia module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
跟着:<br />
$ makepkg -ci<br />
参数{{ic|-c}}告诉makepkg构建完英伟达驱动后清理一些文件, 而参数{{ic|-i}}告诉makepkg自动运行pacman来安装构建后的软件包。<br />
<br />
==配置==<br />
安装完驱动之后,您需要创建Xorg的配置文件。您可以运行一次[[Xorg#Running|测试]]来检验没有配置文件Xorg能否正确运行。但是,您可能需要创建配置文件{{ic|/etc/X11/xorg.conf}}来调整Xorg运行时的一些变量。您可以用nvidia-xconfig配置工具来生成这些文件,也可以手动创建。假如您是手动创建的话,它可以是一个最小的配置文件(也就是意味着它仅仅把一些基础的选项传给[[Xorg]]服务器),或者包含[[Xorg#Configuration|一些自定义的配置]]来绕开Xorg的自动发现或者是预配置的选项。<br />
<br />
===自动配置===<br />
英伟达的软件包已经包含一个自动配置的工具来帮助您创建Xorg的配置文件({{ic|xorg.conf}})您可以通过运行下面的命令来实现自动配置:<br />
# nvidia-xconfig<br />
<br />
当Xorg的配置文件{{ic|xorg.conf}}不存在时,这条命令会自动检测您的硬件,并创建文件{{ic|/etc/X11/xorg.conf}}。假如配置文件已经存在的话,它会进行一些编辑,以方便在Xorg运行时能成功载入英伟达的专有驱动。<br />
<br />
假如您想载入DRI(Direct Rendering Infrastructure),确定已经把您的配置文件修改为:<br />
# Load "dri"<br />
再一次检查您的配置文件{{ic|/etc/X11/xorg.conf}}中的默认色深,水平同步,垂直刷新和分辨率是否正确,不正确的配置可能会损害您的硬件,请仔细进行检查。<br />
<br />
{{警告| 可能在Xorg-server 1.8下仍旧不能正常工作}}<br />
<br />
===最小配置模式===<br />
用根用户创建一个基本的配置文件{{ic|/etc/X11/xorg.conf}}:<br />
# vi /etc/X11/xorg.conf<br />
<br />
把英伟达的驱动添加到配置文件里面去:<br />
<pre><br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
EndSection<br />
</pre><br />
<br />
{{小贴士|假如您已经预先安装了开源驱动nouveau,请确定已经从{{ic|/etc/mkinitcpio.conf}}里面去除"nouveau"。您也可以通过使用[[#在nvidia和nouveau之间切换|这些脚本]]来在开源和闭源驱动之间进行切换。}}<br />
<br />
<br />
===多台显示器===<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
====使用 NVIDIA Settings====<br />
你也可以使用由软件包{{Pkg|nvidia-utils}}提供的{{ic|nvidia-settings}}工具. 通过这个方法你可以使用NVIDIA公司随驱动程序提供的受限软件. 只需要以root权限运行命令{{ic|nvidia-settings}}就可以自由设置驱动,你的设置将会被保存到文件{{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}中.<br />
<br />
==调整==<br />
<br />
===图形用户界面:nvidia-settings===<br />
英伟达的驱动包提供了一个{{ic|nvidia-settings}}的程序来给您调整一些额外的选项。<br />
<br />
假如您想在登录时载入设置,请在终端输入:<br />
$ nvidia-settings --load-config-only<br />
<br />
或者添加到您的桌面环境的启动应用程序里面。<br />
<br />
For a dramatic 2D graphics performance increase in pixmap-intensive applications, e.g. Firefox, set the {{ic|InitialPixmapPlacement}} parameter to 2:<br />
<br />
$ nvidia-settings -a InitialPixmapPlacement=2<br />
<br />
This is documented in [http://cgit.freedesktop.org/~aplattner/nvidia-settings/tree/src/libXNVCtrl/NVCtrl.h?id=b27db3d10d58b821e87fbe3f46166e02dc589855#n2797 nvidia-settings source code]. For this setting to persist, this command needs to be run on every startup or added to your {{ic|~/.nvidia-settings-rc}}.<br />
<br />
{{小贴士| 在极少数情况下{{ic|~/.nvidia-settings-rc}}可能会出现问题。若真如此,Xorg服务器可能会崩溃,并且需要删除这个文件来解决问题。 }}<br />
<br />
* 请到[http://us.download.nvidia.com/XFree86/Linux-x86_64/256.53/README/index.html NVIDIA Accelerated Linux Graphics Driver README and Installation Guide]查看一些额外的细节和选项。<br />
<br />
====启用桌面组合====<br />
从180.44版本开始,英伟达的驱动默认使用 Damage 和 Composite X 扩展支持 GLX。请参阅 [[Composite]] 了解一些详细的说明。<br />
<br />
====关闭启动时的Logo====<br />
添加{{ic|"NoLogo"}}选项到{{ic|Device}}节里:<br />
Option "NoLogo" "1"<br />
<br />
====启用硬件加速====<br />
{{注意|从97.46.xx版本开始RenderAccel就已经被默认启用。}}<br />
添加{{ic|"RenderAccel"}}选项在{{ic|Device}}节下面:<br />
Option "RenderAccel" "1"<br />
<br />
====覆盖显示器检测====<br />
{{ic|Device}}节下面的{{ic|"ConnectedMonitor"}}选项允许您重载X服务器在启动时的显示器检测选项,它可以在启动的时候节约您大量的宝贵时间。有用的选项是:{{ic|"CRT"}}是用于CRT显示器,{{ic|"DFP"}}是用于数字显示器,{{ic|"TV"}}是用于电视的。<br />
<br />
下面的例子是强制英伟达的驱动绕开启动检测并且强制把显示器识别为DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{注意| "CRT"适用于所有模拟的15pin的VGA连接器,甚至是平板显示器。"DFP"仅仅适合于DVI数字连接器。}}<br />
<br />
====启用三重缓存====<br />
您可以在{{ic|Device}}节下面添加{{ic|"TripleBuffer"}}选项来启用三重缓存:<br />
Option "TripleBuffer" "1"<br />
<br />
假如您的显卡有充足的显存(128MB或者更多)的话,建议您启用该选项。这个只有在垂直同步(nvidia-settings中的一个特性)启用的时候才会生效。<br />
<br />
{{注意|此选项可能会引致全屏花屏和降低性能。}}<br />
<br />
====使用系统级事件====<br />
这是来自英伟达驱动的[http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt README]文件: ''"[...] 使用系统级事件,可以在当某个客户端进行直接渲染到组合窗口的时候,可以有效地通知X。"'' 它可以帮助您提高性能,但是它如今还不能完全支持SLI和多GPU模式。<br />
<br />
在{{ic|Device}}节下添加:<br />
Option "DamageEvents" "1"<br />
{{注意|在较新的驱动程序版本中,此选项是默认启用的。}}<br />
<br />
====启用省电功能====<br />
在{{ic|Monitor}}节下添加:<br />
Option "DPMS" "1"<br />
<br />
====启用亮度控制====<br />
在{{ic|Device}}节下添加:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
====启用SLI====<br />
{{警告|截至2011年5月7日,你可能会遇到SLI在GNOME 3下会遇到视频性能低迷的情况。}}<br />
<br />
根据英伟达驱动的[http://http.download.nvidia.com/XFree86/Linux-x86/1.0-8774/README/appendix-d.html README] 附录: ''这个选项可以在支持的配置中控制 SLI 渲染的配置。''一个''支持的配置''适用于有一块SLI认证的主板以及2或者3个SLI认证的GPU的计算机。在[http://www.slizone.com/page/home.html SLI Zone]上面有更加详细的信息。<br />
<br />
您可以用{{ic|lspci}}查找第一个GPU的PCI总线ID:<br />
$ lspci | grep VGA<br />
<br />
跟着会返回类似的信息:<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
<br />
在{{ic|Device}}节下添加BusID(3个先前例子):<br />
BusID "PCI:3:0:0"<br />
<br />
{{注意|这个格式很重要。BusID的值必须指定为{{ic|"PCI:<BusID>:0:0"}}的格式}}<br />
<br />
根据需要的SLI渲染模式来添加值到{{ic|Screen}}节下面:<br />
Option "SLI" "SLIAA"<br />
<br />
下表列出了可用的渲染模式。<br />
<br />
{| border="1"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || 渲染时仅使用单GPU。<br />
|-<br />
| 1, yes, on, true, Auto || 启用SLI并让驱动自动选择合适的渲染模式。<br />
|-<br />
| AFR || 启用SLI并使用交替帧渲染模式。<br />
|-<br />
| SFR || 启用SLI并使用的分割帧渲染模式。<br />
|-<br />
| SLIAA || 启用SLI和使用SLI抗锯齿。使用全场景反锯齿结合,以改善视觉效果。<br />
|}<br />
<br />
另外,您可以使用{{ic|nvidia-xconfig}}实用工具的命令行参数来插入这些改变到{{ic|xorg.conf}}:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=SLIAA<br />
<br />
从shell来验证一下SLI是否被启动:<br />
$ nvidia-settings -q all | grep SLIMode<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
<br />
====强制Powermizer性能水平(适用于笔记本)====<br />
在{{ic|Device}}节下添加:<br />
# 强制Powermizer任何时间都在在特定级别<br />
# level 0x1=highest<br />
# level 0x2=med<br />
# level 0x3=lowest<br />
<br />
# 交流电源设置:<br />
Option "RegistryDwords" "PowerMizerLevelAC=0x3"<br />
# 电池设置:<br />
Option "RegistryDwords" "PowerMizerLevel=0x3"<br />
或许[http://tutanhamon.com.ua/technovodstvo/NVIDIA-UNIX-driver/ NVIDIA Driver for X.org:Performance and Power Saving Hints]这篇文章可以更好地解释这些设置。<br />
<br />
=====让GPU根据温度来设置自己的性能水平=====<br />
在{{ic|Device}}节下添加:<br />
Option "RegistryDwords" "PerfLevelSrc=0x3333"<br />
<br />
====禁用vblank中断(适用于笔记本)====<br />
当运行中断检测的实用工具{{ic|powertop}},<br />
When running the interrupt detection utility {{ic|powertop}},它可以观察到英伟达驱动将会为每个vblank产生一个中断。在{{ic|Device}}节下放置以下选项来禁用:<br />
Option "OnDemandVBlankInterrupts" "1"<br />
这将减少约一或两个每秒的中断。<br />
<br />
====启用超频====<br />
{{警告|'''请注意,超频可能会严重地损害您的硬件,所以在启用之前您必须要三思而后行。'''}}<br />
<br />
您可以在{{ic|Device}}节里添加下面的选项来启用超频:<br />
Option "Coolbits" "1"<br />
<br />
这将会在X会话上启动超频:<br />
$ nvidia-settings<br />
{{注意|GTX 4xx/5xx系列的Fermi核心没办法使用Coolbits的方式来超频。另一种方法是在DOS下编辑和刷新BIOS来实现(当然,这是最好的方法),或者在Win32环境下使用[http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]和[http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]来实现。通过更新BIOS,不仅可以提高电压限制,同时稳定地提高软件超频。<br />
<br />
=====设置静态的2D/3D时钟=====<br />
在{{ic|Device}}节里面添加以下字串来启用PowerMizer的最大性能级别: <br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
在{{ic|Device}}节里面设置一下字串的其中一个来通过{{ic|nvidia-settings}}来手动控制GPU风扇: <br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
====通过XRandR启用屏幕旋转====<br />
把下面的行添加到{{ic|Device}}节里面:<br />
Option "RandRRotation" "True"<br />
重新启动Xorg后可以用旋转屏幕:<br />
$ xrandr -o left<br />
可以用下面的方法恢复默认:<br />
$ xrandr -o normal<br />
{{注意| 可能您不需要编辑{{ic|xorg.conf}}来启用屏幕旋转,因为它已经被默认被启用来。最好是使用各自桌面环境的工具,例如KDE的系统设置工具。}}<br />
<br />
==提示和技巧==<br />
===启用 Pure Video HD 高清视频解码(VDPAU/VAAPI)===<br />
'''硬件需求:''' <br />
<br />
至少是一块第二代的PureVideo HD[http://en.wikipedia.org/wiki/PureVideo_HD#Table_of_PureVideo_.28HD.29_GPUs]<br />
<br />
'''软件需求:'''<br />
<br />
安装英伟达显卡的专有驱动将会根据不同PureVideo的显卡来提供到VDPAU的接口来提供视频解码能力。<br />
<br />
您也可以通过下面的方式来添加VA-API的支持:<br />
# pacman -S vdpau-video<br />
<br />
您可以通过下面的方式来验证VA-API是否被当前系统所支持:<br />
$ vainfo<br />
<br />
假如您想充分发挥您的显卡的硬件解码能力的话,您可能需要一个支持VDPAU或者VA-API的媒体播放器。<br />
<br />
假如您想启用 [[MPlayer (简体中文)|MPlayer]] 的硬件加速能力的话,您可以编辑{{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
启用[[VLC]]的硬件加速能力可以使用下面的方法:<br />
<br />
工具 -> 首选项 -> 输入和解码器 -> 检查“使用GPU加速(实验性的)”<br />
<br />
启用'''smplayer'''的硬件加速能力可以使用下面的方法:<br />
<br />
选项 -> 首选项 -> 常规 -> 视频 标签页 -> 选择vdpau作为输出设备<br />
<br />
启用'''gnome-mplayer'''的硬件加速能力可以使用下面的方法:<br />
<br />
编辑 -> 首选项 -> 设置vdpau为视频输出<br />
<br />
'''在低显存下播放高清电影:'''<br />
<br />
假如您的显卡没有太多的显存(>521MB?),当您播放1080p甚至是720p可看到锯齿。<br />
您可以使用TWM或者MWM之类的窗口管理器来避免这些问题。<br />
<br />
此外可以配置{{ic|~/.mplayer/config}}增加 MPlayer 的缓存大小。<br />
<br />
===使用电视输出===<br />
下面的文章将指导您去实现[http://en.wikibooks.org/wiki/NVidia/TV-OUT 电视输出]<br />
<br />
===使用一台电视(DFP)作为X的唯一输出===<br />
假如CRT-0上面的备用显示器没有被自动检测,这可能是使用DVI作为主要输出的一个问题,或许是X启动时电视被关闭或者是还没有被连接到计算机上。<br />
<br />
强制英伟达使用DFP,把一个EDID的拷贝储存在文件系统上,好让X可以解释文件,而不是从TV/DFP上面读EDID。<br />
<br />
运行nvidia-settings来获得EDID,它会用树格式来显示一些信息,并会忽略余下的设置和选择的GPU(相应条目应该为"GPU-0"或者类似的选项),点击"DFP"节(再提醒一下,是"DFP-0"或者类似的选项),点击"获取 Edid"按钮来储存,例如{{ic|/etc/X11/dfp0.edid}}。<br />
<br />
在xorg.conf的"Device"节添加:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
选项{{ic|ConnectedMonitor}}会强制驱动调整连接的DFP。选项{{ic|CustomEDID}}会提供EDID数据给设备,这将意味着连接到TV/DFP的设备会被在X的进程中启动。<br />
<br />
通过这种方法,可以在启动时自动启动一个登录管理器并且通过开机进程来启动电视,并且正确配置屏幕。<br />
<br />
===检查电源状态===<br />
英伟达的Xorg驱动可以检测电源。可以检查'GPUPowerSource'这个只读参数来实现(0 - 交流电源,1 - 电池):<br />
<br />
$ nvidia-settings -q GPUPowerSource -t<br />
1<br />
<br />
为了能够实现检测,您需要预先安装[[acpid]],并且把它添加到rc.conf的DAEMONS里面,否则系统日志会出现警告:<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
<br />
===在shell显示GPU温度===<br />
====途径一 - nvidia-settings====<br />
{{注意|您必须要用X才能使用该途径。如果你没有X,使用途径二或途径三。还要注意途径三目前对于较新的显卡(例如 G210/220)以及嵌入式 GPUs (如 Zotac IONITX's 8800GS) 不工作,}}<br />
<br />
您可以用下面的方法让nvidia-settings在shell下面显示GPU温度:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
这将输出类似下面的信息:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
您可以使用rrdtool或者conky其它的实用工具来输出GPU的温度。<br />
$ nvidia-settings -q gpucoretemp -t<br />
41<br />
<br />
====途径二 - nvidia-smi====<br />
<br />
使用nvidia-smi可以直接获取GPU的温度,而不需要使用X。这对于一部分没有运行X的用户很有用,也许是因为这些机器无显示器而运行着服务器软件。<br />
<br />
您可以使用下面的方法来使用nvidia-smi让shell输出GPU温度:<br />
$ nvidia-smi<br />
<br />
将会输出类似下面的信息:<br />
{{bc|<nowiki>$ nvidia-smi<br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki>}}<br />
<br />
仅输出温度:<br />
{{bc|<nowiki><br />
$ nvidia-smi -q -d TEMPERATURE<br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki>}}<br />
<br />
您可以使用rrdtool或者conky其它的实用工具来输出GPU的温度。<br />
<br />
$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36<br />
<br />
62<br />
<br />
参考: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli<br />
<br />
====途径三 - nvclock====<br />
nvclock可以从[extra]的软件源中得到。注意nvclock无法访问G210/220或者更新的热传感器。<br />
<br />
nvclock获取的温度跟nvidia-settings/nv-control获取的温度会有明显的差异。根据[http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 这里],一篇来自nvclock的名叫thunderbird的作者提到,nvclock的数值或许更加准确。<br />
<br />
===登陆时设置风扇速度===<br />
您可以使用{{ic|nvidia-settings}}的命令行借口来调整。首先确定您的Xorg的配置文件的{{ic|Device}}节是否已经把Coolbits设置为4或者5.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{注意|GTX 4xx/5xx系列的显卡目前还不能在用这种方法设置登录的风扇速度。该途径仅仅允许在当前的X会话的nvidia-settings设置风扇转速。}}<br />
<br />
在您的[[xinitrc|{{ic|~/.xinitrc}}]]文件放置下面的行来调整运行Xorg下的风扇。把<n>替换为您要设置的风扇转速百分比。<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=<n>"<br />
<br />
您还可以用递增的方法来配置第二个GPU:<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=<n>" \<br />
-a [fan:1]/GPUCurrentFanSpeed=<n>" &<br />
<br />
假如您使用GDM或者KDM之类的登录管理器,您可以创建一个桌面的入口文件来处理这个设定。创建{{ic|~/.config/autostart/nvidia-fan-speed.desktop}}并且把这些文本放置到里面。'''把<n>替换为您要设置的风扇转速百分比。'''<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=<n>"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
===改变驱动程序的安装/反安装顺序===<br />
在这里,旧的英伟达驱动被定义为nvidiaO,而新的英伟达驱动则被定义为nvidiaN。<br />
移除 nvidiaO<br />
安装 nvidia-libglN<br />
安装 nvidiaN<br />
安装 lib32-nvidia-libgl-N (假如有必要的话)<br />
<br />
===在nvidia和nouveau之间切换===<br />
假如您经常在nvidia和nouveau两个驱动之间切换,您可以使用这两个脚本来让您的工作更加简单有效:<br />
<br />
#!/bin/bash<br />
# nvidia -> nouveau<br />
<br />
/usr/bin/sudo /bin/sed -i 's/#options nouveau modeset=1/options nouveau modeset=1/' /etc/modprobe.d/modprobe.conf<br />
/usr/bin/sudo /bin/sed -i 's/#MODULES="nouveau"/MODULES="nouveau"/' /etc/mkinitcpio.conf<br />
<br />
/usr/bin/sudo /usr/bin/pacman -Rdds --noconfirm nvidia-173xx{,-utils}<br />
/usr/bin/sudo /usr/bin/pacman -S --noconfirm nouveau-dri xf86-video-nouveau<br />
<br />
#/usr/bin/sudo /bin/cp {10-monitor,30-nouveau}.conf /etc/X11/xorg.conf.d/<br />
<br />
/usr/bin/sudo /sbin/mkinitcpio -p linux<br />
<br />
#!/bin/bash<br />
# nouveau -> nvidia<br />
<br />
/usr/bin/sudo /bin/sed -i 's/options nouveau modeset=1/#options nouveau modeset=1/' /etc/modprobe.d/modprobe.conf<br />
/usr/bin/sudo /bin/sed -i 's/MODULES="nouveau"/#MODULES="nouveau"/' /etc/mkinitcpio.conf<br />
<br />
/usr/bin/sudo /usr/bin/pacman -Rdds --noconfirm nouveau-dri xf86-video-nouveau libgl<br />
/usr/bin/sudo /usr/bin/pacman -S --noconfirm nvidia-173xx{,-utils}<br />
<br />
#/usr/bin/sudo /bin/rm /etc/X11/xorg.conf.d/{10-monitor,30-nouveau}.conf<br />
<br />
/usr/bin/sudo /sbin/mkinitcpio -p linux<br />
<br />
'''想要成功地完成切换,一次重启是很有必要的。'''<br />
请根据您正在使用的驱动版本来修改一些地方(在这里我使用的是nvidia-173xx)<br />
<br />
假如您正在使用的xorg-server的版本低于1.10.2-1,取消注释行,复制和删除{10-monitor,30-nouveau}.conf。自从1.10.2-1之后的版本,xorg-server修补为自动加载nouveau。我保留了10-monitor.conf和[https://wiki.archlinux.org/index.php/Nouveau#Configuration 30-nouveau.conf]在同一个目录作为这个脚本,必要时还要调整一下路径。<br />
<br />
==故障排除==<br />
<br />
===游戏中使用双头显示输出===<br />
当您使用全屏进行游戏的时候,您会发现游戏会把两个屏幕识别为一个大屏幕。虽然这在技术上是正确的(虚拟出来的大屏幕是您的几个屏幕的组合),您可能不需要在两个屏幕上同时玩游戏。<br />
您可以在SDL上改变这些行为,试一下:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
在OpenGL里面,添加适当的Metamodes到您的xorg.conf的{{ic|Device}}节下面,然后重启X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
另一种方法,可单独工作或连同上面提到的那些是[[Gaming#Starting_games_in_a_separate_X_server|在单独的X服务器里面开始游戏]].<br />
<br />
===旧的Xorg的设置===<br />
如果您是从旧的版本升级过来的,请移除旧的{{ic|/usr/X11R6}},防止在安装过程中引发问题。<br />
<br />
===屏幕损坏:"六屏"问题===<br />
一些使用Geforce GT 100M系列显卡的用户,屏幕会在X启动的时候转为损坏;分为六个限制为640x480的区域。<br />
<br />
为了解决这个问题,可以在{{ic|Device}}节里启动验证模式{{ic|NoTotalSizeCheck}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
==='/dev/nvidia0' Input/Output error===<br />
这个错误可以是由几个不同的原因引发,此错误最常见的解决方案是检查组/文件权限,这也许不能说是一个问题。在英伟达的文档里面并没有详细地告诉您如何解决这个问题但还有一些东西对一些人有用。这个问题可以是IRQ与其它驱动冲突或者是错误的路由,甚至是内核或者BIOS的问题。<br />
<br />
首先您得尝试移除视频采集卡或者其它视频设备来解决问题。如果在同一系统中有太多的视频处理器,可能由于视频控制器的内存分配问题导致内核无法启动。特别是显存比较低的系统可能发生这种情况,即使只有一个视频处理器。你应该找出你的系统的显存(例如运行''lspci -v'')并分配参数传递到内核:<br />
vmalloc=64M<br />
或者<br />
vmalloc=256M<br />
<br />
另一种方法是尝试的是从“操作控制系统”改变你的BIOS IRQ路由“BIOS控制”或其他方式。第一个可以通过内核参数:<br />
PCI=biosirq<br />
<br />
''noacpi''的内核参数也可以作为一个建议,但是因为它完全禁用ACPI的,应谨慎使用,毕竟一些硬件很容易因过热损坏。<br />
<br />
{{注意|您可以在内核的命令行或者在启动管理器的配置文件上传输参数。您可以到你的启动管理器的Wiki页面上面了解更详细的信息。}}<br />
<br />
==='/dev/nvidiactl' errors===<br />
启动一个OpenGL的应用程序可能会引致以下的错误:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
您可以把适当的用户添加到"video"组并重新登录来解决这个问题:<br />
# gpasswd -a username video<br />
<br />
===32位应用程序无法启动===<br />
在64位系统下,安装{{ic|lib32-nvidia-libgl}}对应相同版本的64位驱动可以修复这个问题。<br />
<br />
===更新内核之后的错误===<br />
使用自定义构建的NVIDIA模块来替代[extra]里面的软件包,每次内核更新后驱动都需要重新编译。一般建议更新内核和图形驱动程序后重新启动。<br />
<br />
===通常奔溃的问题===<br />
* 尝试在xorg.conf里面关闭{{ic|RenderAccel}}。<br />
* 假如Xorg输出一些错误如"conflicting memory type"或者"failed to allocate primary buffer: out of memory",在{{ic|/boot/grub/menu.lst}}添加{{ic|nopat}}到{{ic|kernel}}行的末尾。<br />
<br />
* 如果NVIDIA编译器提示当前版本的gcc和用于编译的内核的版本号不同,请在{{ic|/etc/profile}}里面添加:<br />
export IGNORE_CC_MISMATCH=1<br />
* 假如Xorg使用nvidia-96xx驱动时由于"Signal 11"奔溃,尝试禁用PAT。把参数{{ic|nopat}}传输到{{ic|menu.lst}}的{{ic|kernel}}行。<br />
您可以在[http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]找到更多的关于故障排除的信息。<br />
<br />
===安装新版本的驱动后性能很糟糕===<br />
假如和旧版本的驱动相比,FPS有下降,首先检查是否打开直接渲染:<br />
$ glxinfo | grep direct<br />
假如输出:<br />
direct rendering: No <br />
跟着FPS可能会突然下降。<br />
<br />
一种可能的解决方案是降级您的驱动为先前的版本并重新启动。<br />
<br />
===400系列显卡与CPU峰值===<br />
如果您遇到间歇性的CPU峰值与400系列显卡的问题,这可能是PowerMizer不断变化的GPU的时钟频率引起。选择PowerMizer自适应性能的设置,请把一下内容添加到您的Xorg的配置文件的Device节里面:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
===X在登入/注销时挂起,用Ctrl+Alt+Backspace来实现===<br />
假如在使用传统的英伟达驱动启用Xorg的登入/注销时挂起,但登录仍然可以通过Ctrl-Alt-Backspace,尝试添加下面的行到{{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
一些用户可能很幸运地实现,但其他用户反而实现性能下降:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
注意{{ic|NVreg_Mobile}}需要根据您的笔记本来修改:<br />
* 1 适用于Dell笔记本.<br />
* 2 适用于non-Compal Toshiba 笔记本.<br />
* 3 适用于其它笔记本.<br />
* 4 适用于Compal Toshiba笔记本.<br />
* 5 适用于Gateway笔记本.<br />
在[http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's Readme:Appendix K]可以看到更多的信息。<br />
<br />
===XRandR检测的刷新率不正确依赖实用工具===<br />
XRandR的X扩展目前还不能识别到一个X屏幕上的多个显示设备;它仅仅可以看到{{ic|MetaMode}}的边界框,XRandR将无法区分它们。<br />
为了支持动态双头输出,NVIDIA的驱动程序必须使每个MetaMode是唯一的,目前,NVIDIA的驱动程序来通过使用一个唯一的标识符刷新率完成。<br />
XRandR扩展目前正在由Xorg社区进行了重新设计,所以刷新率的解决方法可能在未来的某个节点上删除。<br />
<br />
此可用的办法也被禁用的“DynamicTwinView”X配置选项设置为“false”,这将禁用NV-CONTROL支持操纵MetaModes,但会造成XRandR和XF86VidMode可见刷新率要准确。<br />
<br />
===No screens found on a laptop / Nvidia Optimus===<br />
假如在一些笔记本上英伟达的驱动找不到任何屏幕,您可以用下面的方法实现:<br />
lspci | grep VGA<br />
将会输出类似的信息:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
不幸的是,英伟达已经没有计划在他们的Linux驱动程序支持。<br />
<br />
您需要安装[[Intel]]的驱动来处理屏幕,让3D软件使用,您需要通过[[Bumblebee]]告诉他们使用英伟达的显卡。 <br />
<br />
===没有笔记本电脑上的亮度控制===<br />
尝试在20-nvidia.conf添加下面的行:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
如果X无法启动,尝试改为下边的样子:<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "Quadro NVS 3100M"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
<br />
<br />
假如它仍旧不能工作的话,您可以尝试安装[https://aur.archlinux.org/packages.php?ID=25467 nvidia-bl]。<br />
<br />
==一些额外的链接==<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=343901NVIDIA2014-11-08T16:41:02Z<p>Yafengabc: /* No brightness control on laptops */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
[[zh-CN:NVIDIA]]<br />
{{Related articles start}}<br />
{{Related|Nouveau}}<br />
{{Related|Bumblebee}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]]. See instead [[NVIDIA Optimus]] if you have a laptop based on such technology.<br />
<br />
== Installing ==<br />
<br />
These instructions are for those using the stock {{Pkg|linux}} or {{Pkg|linux-lts}} packages. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
{{Warning| Mixing driver versions does NOT work. You can't use the current branch and the 32-Bit libGL package of the legacy branches or any combination.}}<br />
<br />
1. If you do not know what graphics card you have, find out by issuing:<br />
:{{bc|<nowiki>$ lspci -k | grep -A 2 -i "VGA"</nowiki>}}<br />
<br />
2. Determine the necessary driver version for your card by visiting NVIDIA's [http://www.nvidia.com/Download/index.aspx driver download site], looking up the name in NVIDIA's [http://www.nvidia.com/object/IO_32667.html legacy card list], or finding the code name on [http://nouveau.freedesktop.org/wiki/CodeNames nouveau wiki's code names page].<br />
<br />
3. Install the appropriate driver for your card:<br />
:* For GeForce 400 series cards and newer [NVCx and newer], install the {{Pkg|nvidia}} or {{Pkg|nvidia-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 8000/9000 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx] from around 2006-2010, install the {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-340xx-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 6000/7000 series cards [NV4x and NV6x] from around 2004-2006, install the {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} package, available in the [[official repositories]].<br />
<br />
:* For even older cards, have a look at [[#Unsupported drivers]].<br />
:* For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[Arch User Repository]], since the stable drivers may not support the newly introduced features.<br />
<br />
:If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent ''lib32'' package from the [[multilib]] repository (e.g. {{Pkg|lib32-nvidia-libgl}}, {{Pkg|lib32-nvidia-340xx-libgl}} or {{Pkg|lib32-nvidia-304xx-libgl}}).<br />
<br />
4. Reboot. The {{Pkg|nvidia}} package contains a file which blacklists the ''nouveau'' module, so rebooting is necessary.<br />
<br />
Once the driver has been installed, continue to [[#Configuring]].<br />
<br />
=== Unsupported drivers ===<br />
<br />
If you have a GeForce 5 FX series card or older, Nvidia no longer supports drivers for you card. This means that these drivers [http://nvidia.custhelp.com/app/answers/detail/a_id/3142/ do not support the current Xorg version]. It thus might be easier if you use the [[nouveau]] driver, which supports the old cards with the current Xorg.<br />
<br />
However, Nvidia's drivers might provide better 3D performance/stability. If you want to use them, you can install them (together with an old Xorg version) from the [[Arch User Repository]]:<br />
<br />
* For GeForce 5 FX series cards [NV30-NV36], install the {{AUR|nvidia-173xx}} package. Last supported Xorg version is 1.15.<br />
* For GeForce 2/3/4 MX/Ti series cards [NV11, NV17-NV28], install the {{AUR|nvidia-96xx}} package. Last supported Xorg version is 1.12.<br />
<br />
{{Tip|The legacy nvidia-96xx and nvidia-173xx drivers can also be installed from the unofficial [http://pkgbuild.com/~bgyorgy/city.html <nowiki>[city] repository</nowiki>]. (It's strongly advised that you don't skip any dependencies restriction when installing from here)}}<br />
<br />
=== Alternate install: custom kernel ===<br />
<br />
First of all, it's good to know how the ABS works by reading some of the other articles about it:<br />
<br />
* Main article for [[Arch Build System|ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating packages]]<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
[[Pacman|Install]] {{Pkg|abs}} from the [[official repositories]] and generate the tree with:<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/abs<br />
Make a copy of the {{ic|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/abs/<br />
Go into the temporary {{ic|nvidia}} build directory:<br />
$ cd ~/abs/nvidia<br />
It is required to edit the files {{ic|nvidia.install}} and {{ic|PKGBUILD}} so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are multiple kernels installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nouveau module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{ic|-c}} operand tells makepkg to clean left over files after building the package, whereas {{ic|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
=== Automatic re-compilation of the NVIDIA module with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|nvidia-hook}} from the [[AUR]]. You will need to install the module sources: {{AUR|nvidia-dkms}}. In '''nvidia-hook''', the 'automatic re-compilation' functionality is done by a '''nvidia hook''' on [[mkinitcpio]] after forcing to update the '''linux-headers''' package. You will need to add 'nvidia' to the HOOKS array in /etc/mkinitcpio.conf.<br />
<br />
The hook will call the '''dkms''' command to update the NVIDIA module for the version of your new kernel.<br />
<br />
{{Note|<br />
* If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. nvidia hook will tell you if anything goes wrong.<br />
* If you would like to do this manually please see this section [[Dynamic Kernel Module Support#Usage| in the dkms arch wiki.]]<br />
}}<br />
<br />
== Configuring ==<br />
<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a configuration file (prefer {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} over {{ic|/etc/X11/xorg.conf}}) in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a number of settings that can bypass Xorg's auto-discovered or pre-configured options.<br />
{{Note|Since 1.8.x Xorg uses separate configuration files in {{ic|/etc/X11/xorg.conf.d/}} - check out [[NVIDIA#Advanced: 20-nvidia.conf|advanced configuration]] section.}}<br />
<br />
=== Minimal configuration ===<br />
<br />
A basic configuration block in {{ic|20-nvidia.conf}} (or deprecated in {{ic|xorg.conf}}) would look like this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Nvidia Card"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "NoLogo" "true"<br />
#Option "UseEDID" "false"<br />
#Option "ConnectedMonitor" "DFP"<br />
# ...<br />
EndSection<br />
}}<br />
<br />
{{Tip|If upgrading from nouveau make sure to remove "{{ic|nouveau}}" from {{ic|/etc/mkinitcpio.conf}}. See [[NVIDIA#Switching between NVIDIA and nouveau drivers|Switching between NVIDIA and nouveau drivers]], if switching between the open and proprietary drivers often.}}<br />
<br />
=== Automatic configuration ===<br />
<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{ic|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{ic|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{ic|/etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning|That may still not work properly with Xorg-server 1.8 }}<br />
<br />
=== Multiple monitors ===<br />
<br />
:''See [[Multihead]] for more general information''<br />
{{Warning|1=As of August 2013, Xinerama is broken when using the proprietary NVIDIA driver from 319 upwards. Users wishing to use Xinerama with the NVIDIA driver should use the NVIDIA 313 driver, which works only with Linux kernels earlier than 3.10. See [https://bbs.archlinux.org/viewtopic.php?id=163319 this thread] for more information.}}<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
TwinView only works on a per card basis: If you have multiple cards, you'll have to use xinerama or zaphod mode (multiple X screens). You can combine TwinView with zaphod mode, ending up, for example, with two X screens covering two monitors each. Most window managers fail miserably in zaphod mode. Awesome is the shining exception, and KDE almost works.<br />
<br />
Example configuration:<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "TwinLayout"<br />
Screen 0 "metaScreen" 0 0<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
<br />
#refer to the link below for more information on each of the following options.<br />
Option "HorizSync" "DFP-0: 28-33; DFP-1 28-33"<br />
Option "VertRefresh" "DFP-0: 43-73; DFP-1 43-73"<br />
Option "MetaModes" "1920x1080, 1920x1080"<br />
Option "ConnectedMonitor" "DFP-0, DFP-1"<br />
Option "MetaModeOrientation" "DFP-1 LeftOf DFP-0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "metaScreen"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "True"<br />
SubSection "Display"<br />
Modes "1920x1080"<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
[http://us.download.nvidia.com/XFree86/Linux-x86/304.51/README/configtwinview.html Device option information].<br />
<br />
If you have multiple cards that are SLI capable, it is possible to run more than one monitor attached to separate cards (for example: two cards in SLI with one monitor attached to each). The "MetaModes" option in conjunction with SLI Mosaic mode enables this. Below is a configuration which works for the aforementioned example and runs [[GNOME]] flawlessly.<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Device"<br />
Identifier "Card A"<br />
Driver "nvidia"<br />
BusID "PCI:1:00:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card B"<br />
Driver "nvidia"<br />
BusID "PCI:2:00:0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Right Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Left Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Right Screen"<br />
Device "Card A"<br />
Monitor "Right Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Left Screen"<br />
Device "Card B"<br />
Monitor "Left Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default"<br />
Screen 0 "Right Screen" 0 0<br />
Option "Xinerama" "0"<br />
EndSection}}<br />
<br />
===== Manual CLI configuration with xrandr =====<br />
<br />
If the latest solutions don't work for you, you can use your window manager's ''autostart'' implementation with {{Pkg|xorg-xrandr}}.<br />
<br />
Some {{ic|xrandr}} examples could be:<br />
<br />
xrandr --output DVI-I-0 --auto --primary --left-of DVI-I-1<br />
<br />
or:<br />
<br />
xrandr --output DVI-I-1 --pos 1440x0 --mode 1440x900 --rate 75.0<br />
<br />
When:<br />
<br />
* {{ic|--output}} is used to indicate the "monitor" to which the options are set.<br />
* {{ic|DVI-I-1}} is the name of the second monitor.<br />
* {{ic|--pos}} is the position of the second monitor relative to the first.<br />
* {{ic|--mode}} is the resolution of the second monitor.<br />
* {{ic|--rate}} is the refresh rate (in Hz).<br />
<br />
You can find the proper options by running {{ic|xrandr}} without any arguments.<br />
<br />
==== Using NVIDIA Settings ====<br />
<br />
You can also use the {{ic|nvidia-settings}} tool provided by {{Pkg|nvidia-utils}}. With this method, you will use the proprietary software NVIDIA provides with their drivers. Simply run {{ic|nvidia-settings}} as root, then configure as you wish, and then save the configuration to {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
==== ConnectedMonitor ====<br />
<br />
If the driver doesn't properly detect a second monitor, you can force it to do so with ConnectedMonitor. <br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
VendorName "Panasonic"<br />
ModelName "Panasonic MICRON 2100Ex"<br />
HorizSync 30.0 - 121.0 # this monitor has incorrect EDID, hence Option "UseEDIDFreqs" "false"<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor2"<br />
VendorName "Gateway"<br />
ModelName "GatewayVX1120"<br />
HorizSync 30.0 - 121.0<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device2"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 1<br />
EndSection<br />
<br />
}}<br />
<br />
The duplicated device with {{ic|Screen}} is how you get X to use two monitors on one card without {{ic|TwinView}}. Note that {{ic|nvidia-settings}} will strip out any {{ic|ConnectedMonitor}} options you have added.<br />
<br />
==== Mosaic mode ====<br />
<br />
Mosaic mode is the only way to use more than 2 monitors across multiple graphics cards with compositing. Your window manager may or may not recognize the distinction between each monitor.<br />
<br />
===== Base mosaic =====<br />
<br />
Base mosaic mode works on any set of Geforce 8000 series or higher GPUs. It cannot be enabled from withing the nvidia-setting GUI. You must either use the nvidia-xconfig command line program or edit xorg.conf by hand. Metamodes must be specified. The following is an example for four DFPs in a 2x2 configuration, each running at 1920x1024, with two DFPs connected to two cards:<br />
$ nvidia-xconfig --base-mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
{{Note|While the documentation lists a 2x2 configuration of monitors, Nvidia has reduced that ability to just 3 monitors in base mosaic mode as of driver version 304. More monitors are available with a Quadro card, but with standard consumer cards, it is limited to three. The explanation given for this reduction is "Feature parity with the Windows driver". As of 9/14/2014, Windows has no restriction on the number of monitors, even on the same driver version. This is not a bug, this is entirely by design.}}<br />
<br />
===== SLI Mosaic =====<br />
<br />
If you have an SLI configuration and each GPU is a Quadro FX 5800, Quadro Fermi or newer then you can use SLI Mosaic mode. It can be enabled from within the nvidia-settings GUI or from the command line with:<br />
$ nvidia-xconfig --sli=Mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
== Tweaking ==<br />
<br />
=== GUI: nvidia-settings ===<br />
<br />
The NVIDIA package includes the {{ic|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
The desktop environment's auto-startup method 'may' not work for loading nvidia-settings properly (KDE). To be sure that settings are really loaded put the command in ~/.xinitrc file (create if not present).<br />
<br />
{{Tip|On rare occasions the {{ic|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the problem.}}<br />
<br />
=== Advanced: 20-nvidia.conf ===<br />
<br />
Edit {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and add the option to the correct section. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/ NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.<br />
<br />
==== Disabling the logo on startup ====<br />
<br />
Add the {{ic|"NoLogo"}} option under section {{ic|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
==== Overriding monitor detection ====<br />
<br />
The {{ic|"ConnectedMonitor"}} option under section {{ic|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{ic|"CRT"}} for analog connections, {{ic|"DFP"}} for digital monitors and {{ic|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
==== Enabling brightness control ====<br />
<br />
Add under section {{ic|Device}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
{{Note|If you already have this enabled<br />
and your brightness control doesn't work try to comment it out.}}<br />
<br />
==== Enabling SLI ====<br />
<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A "supported configuration" is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{ic|lspci}}:<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
}}<br />
<br />
Add the BusID (3 in the previous example) under section {{ic|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{ic|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{ic|Screen}}:<br />
Option "SLI" "AA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| class="wikitable"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| AA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
Alternatively, you can use the {{ic|nvidia-xconfig}} utility to insert these changes into {{ic|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=AA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
{{hc|<nowiki>$ nvidia-settings -q all | grep SLIMode</nowiki>|<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
}}<br />
<br />
{{Warning| After enabling SLI, your system may become frozen/non-responsive upon starting xorg. It is advisable that you disable your display manager before restarting.}}<br />
<br />
==== Enabling overclocking ====<br />
<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{ic|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
{{Note|GeForce 400/500/600/700 series Fermi/Kepler cores CAN now, as of version 337.12, be overclocked! Now {{ic|Option "Coolbits" "8"}} needs to be set within the device section of the X configuration file to enable the new overclocking support. If you also want to enable manual GPU fan controls, you need to set {{ic|Option "Coolbits" "12"}}.}}<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|An alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]{{Dead link|2013|05|25}} and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]{{Dead link|2013|05|25}}. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits. [http://ivanvojtko.blogspot.sk/2014/03/how-to-overclock-geforce-460gtx-fermi.html Fermi BIOS modification tutorial]}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
<br />
Set the following string in the {{ic|Device}} section to enable PowerMizer at its maximum performance level (VSync won't work without this line):<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{ic|Device}} section to enable manual GPU fan control within {{ic|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Fixing terminal resolution ===<br />
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.<br />
<br />
==== GRUB ====<br />
If you are using GRUB, a possible solution is to edit the {{ic|GRUB_GFXMODE}} line of {{ic|/etc/default/grub}} with desired display resolutions. Multiple resolutions can be specified, including the default {{ic|auto}}, so it is recommended that you edit the line to resemble {{ic|1=GRUB_GFXMODE=<desired resolution>,<fallback such as 1024x768>,auto}}. For more information, refer to [https://www.gnu.org/software/grub/manual/html_node/gfxmode.html#gfxmode the GRUB gfxmode documentation].<br />
<br />
=== Enabling Pure Video HD (VDPAU/VAAPI) ===<br />
<br />
{{Merge|VDPAU|Keep here only the specifics and merge the general information into the main article.}}<br />
<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/Nvidia_PureVideo#Table_of_PureVideo_.28HD.29_GPUs].<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with {{Pkg|libva-vdpau-driver}}.<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware.}}<br />
<br />
To enable hardware acceleration in [[VLC media player|VLC]] go:<br />
<br />
{{ic|Tools > Preferences > Input & Codecs}}, then select {{ic|VDPAU}} as {{ic|'''Hardware-accelerated decoding'''}}<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
{{ic|Options > Preferences > General > Video Tab}}, then select {{ic|vdpau}} as {{ic|'''output driver'''}}<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
{{ic|Edit > Preference}}, then set {{ic|'''video output'''}} to {{ic|vdpau}}<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>512MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{ic|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
=== Avoid screen tearing in KDE (KWin) ===<br />
<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export __GL_YIELD="USLEEP"<br />
</nowiki>}}<br />
<br />
Also if the above doesn't help, then try this:<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export KWIN_TRIPLE_BUFFER=1<br />
</nowiki>}}<br />
<br />
Do not have both of the above enabled at the same time.<br />
Also if you enable triple buffering make sure to enable TripleBuffering for the driver itself.<br />
Source: https://bugs.kde.org/show_bug.cgi?id=322060<br />
<br />
=== Hardware accelerated video decoding with XvMC ===<br />
<br />
Accelerated decoding of MPEG-1 and MPEG-2 videos via [[XvMC]] are supported on GeForce4, GeForce 5 FX, GeForce 6 and GeForce 7 series cards. To use it, create a new file {{ic|/etc/X11/XvMCConfig}} with the following content:<br />
libXvMCNVIDIA_dynamic.so.1<br />
<br />
See how to configure [[XvMC#Supported software|supported software]].<br />
<br />
=== Using TV-out ===<br />
<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here].<br />
<br />
=== X with a TV (DFP) as the only display ===<br />
<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the {{ic|DFP}} section (again, {{ic|DFP-0}} or similar), click on the {{ic|Acquire Edid}} Button and store it somewhere, for example, {{ic|/etc/X11/dfp0.edid}}.<br />
<br />
Edit {{ic|xorg.conf}} by adding to the {{ic|Device}} section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The {{ic|ConnectedMonitor}} option forces the driver to recognize the DFP as if it were connected. The {{ic|CustomEDID}} provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
=== Check the power source ===<br />
<br />
The NVIDIA X.org driver can also be used to detect the GPU's current source of power. To see the current power source, check the 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
{{hc|$ nvidia-settings -q GPUPowerSource -t|1}}<br />
<br />
If you're seeing an error message similiar to the one below, then you either need to install [[acpid]] or start the systemd service via {{ic|systemctl start acpid.service}}<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
(If you are not seeing this error, it is not necessary to install/run acpid soley for this purpose. My current power source is correctly reported without acpid even installed.)<br />
<br />
=== Displaying GPU temperature in the shell ===<br />
<br />
==== Method 1 - nvidia-settings ====<br />
<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use {{ic|nvidia-settings}} as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as {{ic|rrdtool}} or {{ic|conky}}, among others:<br />
{{hc|$ nvidia-settings -q gpucoretemp -t|41}}<br />
<br />
==== Method 2 - nvidia-smi ====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temperature in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi<br />
<br />
This should output something similar to the following:<br />
{{hc|$ nvidia-smi|<nowiki><br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki><br />
}}<br />
<br />
Only for temperature:<br />
{{hc|$ nvidia-smi -q -d TEMPERATURE|<nowiki><br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki><br />
}}<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
{{hc|<nowiki>$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36</nowiki>|62}}<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli.<br />
<br />
==== Method 3 - nvclock ====<br />
<br />
Use {{AUR|nvclock}} which is available from the [[AUR]].<br />
{{Note|{{ic|nvclock}} cannot access thermal sensors on newer NVIDIA cards such as Geforce 200 series cards.}}<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
=== Set fan speed at login ===<br />
<br />
You can adjust the fan speed on your graphics card with ''nvidia-settings''' console interface. First ensure that your Xorg configuration sets the Coolbits option to {{ic|4}}, {{ic|5}} or {{ic|12}} for fermi and above in your {{ic|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GeForce 400/500 series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{ic|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace {{ic|''n''}} with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=''n''" \<br />
-a [fan:1]/GPUCurrentFanSpeed=''n''" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{ic|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change {{ic|''n''}} to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
=== Order of install/deinstall for changing drivers ===<br />
<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-libglN<br />
install nvidiaN<br />
install lib32-nvidia-libgl-N (if required)<br />
<br />
=== Switching between NVIDIA and nouveau drivers ===<br />
<br />
{{Warning|The {{ic|-Rdds}} switch is used as the installation otherwise fails due to unstatisfied dependencies.}}<br />
<br />
If you need to switch between drivers, you may use the following script, run as root (say yes to all confirmations):<br />
<br />
{{bc|1=<nowiki><br />
#!/bin/bash<br />
BRANCH=340xx<br />
#BRANCH=304xx<br />
<br />
NVIDIA="nvidia-$BRANCH"<br />
_NVIDIA="$(pacman -Qqs ^${NVIDIA}$)"<br />
NOUVEAU="xf86-video-nouveau mesa-libgl"<br />
_NOUVEAU="$(pacman -Qqs ^mesa-libgl$)"<br />
<br />
if [[ ! $_NVIDIA ]]; then<br />
pacman -Rdds "$NOUVEAU"<br />
pacman -S "$NVIDIA" #lib32-$NVIDIA-libgl #$NVIDIA-lts<br />
elif [[ ! $_NOUVEAU ]]; then<br />
pacman -Rdds "$_NVIDIA"<br />
pacman -S "$NOUVEAU" #lib32-mesa-libgl<br />
fi<br />
</nowiki>}}<br />
<br />
Uncomment the lib32 packages if you run a 64-bit system and require the 32-bit libraries (e.g. 32-bit games/Steam).<br />
<br />
=== Avoid tearing with GeForce 600/700 series cards === <br />
<br />
Adding the following line to the {{ic|"Screen"}} section of your X11 configuration file, for example {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, will eliminate tearing entirely, regardless of the compositor you are using. It has been reported to reduce the performance of some OpenGL applications, though.<br />
<br />
Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Gaming using TwinView ===<br />
<br />
In case you want to play fullscreen games when using TwinView, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropriate Metamodes to your xorg.conf in section {{ic|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
=== Vertical sync using TwinView ===<br />
<br />
If you're using TwinView and vertical sync (the "Sync to VBlank" option in '''nvidia-settings'''), you will notice that only one screen is being properly synced, unless you have two identical monitors. Although '''nvidia-settings''' does offer an option to change which screen is being synced (the "Sync to this display device" option), this does not always work. A solution is to add the following environment variables at startup, for example append in {{ic|/etc/profile}}:<br />
<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_SYNC_DISPLAY_DEVICE=DFP-0<br />
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DFP-0<br />
<br />
You can change {{ic|DFP-0}} with your preferred screen ({{ic|DFP-0}} is the DVI port and {{ic|CRT-0}} is the VGA port). You can find the identifier for your display from '''nvidia-settings''' in the "X Server XVideoSettings" section.<br />
<br />
=== Old Xorg settings ===<br />
<br />
If upgrading from an old installation, please remove old {{ic|/usr/X11R6/}} paths as it can cause trouble during installation.<br />
<br />
=== Corrupted screen: "Six screens" Problem ===<br />
<br />
For some users, using GeForce GT 100M's, the screen gets corrupted after X starts, divided into 6 sections with a resolution limited to 640x480.<br />
The same problem has been recently reported with Quadro 2000 and hi-res displays.<br />
<br />
To solve this problem, enable the Validation Mode {{ic|NoTotalSizeCheck}} in section {{ic|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
=== '/dev/nvidia0' input/output error ===<br />
<br />
{{Accuracy|Verify that the BIOS related suggestions work and are not coincidentally set while troubleshooting.|section='/dev/nvidia0' Input/Output error... suggested fixes}}<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the problem. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with {{ic|lspci -v}}) and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
If running a 64bit kernel, a driver defect can cause the NVIDIA module to fail initializing when IOMMU is on. Turning it off in the BIOS has been confirmed to work for some users. [http://www.nvnews.net/vbulletin/showthread.php?s=68bb2fabadcb53b10b286aa42d13c5bc&t=159335][[User:Clickthem#nvidia module]]<br />
<br />
Another thing to try is to change your BIOS IRQ routing from {{ic|Operating system controlled}} to {{ic|BIOS controlled}} or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The {{ic|noacpi}} kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
=== '/dev/nvidiactl' errors ===<br />
<br />
Trying to start an OpenGL application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropriate user to the {{ic|video}} group and log in again:<br />
# gpasswd -a username video<br />
<br />
=== 32-bit applications do not start ===<br />
<br />
Under 64-bit systems, installing {{ic|lib32-nvidia-libgl}} that corresponds to the same version installed for the 64-bit driver fixes the problem.<br />
<br />
=== Errors after updating the kernel ===<br />
<br />
If a custom build of NVIDIA's module is used instead of the package from the ''extra'' repository, a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
=== Crashing in general ===<br />
<br />
* Try disabling {{ic|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{ic|nopat}} at the end of the {{ic|kernel}} line in {{ic|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{ic|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{ic|nopat}} to [[kernel parameters]].<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
=== Bad performance after installing a new driver version ===<br />
<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on (glxinfo is included in {{Pkg|mesa-demos}}):<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
=== CPU spikes with 400 series cards ===<br />
<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the {{ic|Device}} section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
=== Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace ===<br />
<br />
If, while using the legacy NVIDIA drivers, Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via {{ic|Ctrl+Alt+Backspace}} (or whatever the new "kill X" key binding is), try adding this in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{ic|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's README: Appendix K] for more information.<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [[http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html]] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
==== Possible Workaround ====<br />
<br />
Enter the BIOS and changed the default graphics setting from 'Optimus' to 'Discrete' and the install NVIDIA drivers (295.20-1 at time of writing) recognized the screens.<br />
<br />
Steps:<br />
# Enter BIOS.<br />
# Find Graphics Settings (should be in tab ''Config > Display'').<br />
# Change 'Graphics Device' to 'Discrete Graphics' (Disables Intel integrated graphics).<br />
# Change OS Detection for Nvidia Optimus to "Disabled".<br />
# Save and exit.<br />
<br />
Tested on a Lenovo W520 with a Quadro 1000M and Nvidia Optimus<br />
<br />
=== Screen(s) found, but none have a usable configuration ===<br />
<br />
On a laptop, sometimes NVIDIA driver cannot find the active screen.<br />
It may be caused because you own a graphic card with vga/tv outs.<br />
You should examine Xorg.0.log to see what is wrong.<br />
<br />
Another thing to try is adding invalid {{ic|"ConnectedMonitor" Option}} to {{ic|Section "Device"}}<br />
to force Xorg throws error and shows you how correct it.<br />
[http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html Here]<br />
more about ConnectedMonitor setting.<br />
<br />
After re-run X see Xorg.0.log to get valid CRT-x,DFP-x,TV-x values.<br />
<br />
{{ic|nvidia-xconfig --query-gpu-info}} could be helpful.<br />
<br />
=== Blackscreen at X startup with new driver ===<br />
<br />
If you have installed an update of Nvidia and you screen stay black after launching Xorg. You have to use the {{ic|<nowiki>rcutree.rcu_idle_gp_delay=1</nowiki>}} [[kernel parameter]].<br />
<br />
You can also try to add the {{ic|nvidia}} module directly to your [[mkinitcpio]] config file.<br />
<br />
=== No brightness control on laptops ===<br />
<br />
Try to add the following line in {{ic|20-nvidia.conf}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
if the Xorg can't start an tested {{ic|20-nvidia.conf}} is:<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
<br />
If it is still not working, you can try installing {{AUR|nvidia-bl}} or {{AUR|nvidiabl}}.<br />
<br />
=== Backlight is not turning off in some occasions ===<br />
<br />
By default, DPMS should turn off backlight with the timeouts set or by running xset. However, probably due to a bug in the proprietary Nvidia drivers the result is a blank screen with no powersaving whatsoever. To workaround it, until the bug has been fixed you can use the {{ic|vbetool}} as root.<br />
<br />
Install the {{Pkg|vbetool}} package.<br />
<br />
Turn off your screen on demand and then by pressing a random key backlight turns on again:<br />
<br />
vbetool dpms off && read -n1; vbetool dpms on<br />
<br />
Alternatively, xrandr is able to disable and re-enable monitor outputs without requiring root.<br />
<br />
xrandr --output DP-1 --off; read -n1; xrandr --output DP-1 --auto<br />
<br />
=== Blue tint on videos with Flash ===<br />
<br />
A problem with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
# Install the latest {{Pkg|libvdpau}}.<br />
# Patch {{ic|vdpau_trace.so}} with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
# Right click on a video, select "Settings..." and uncheck "Enable hardware acceleration". Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
# [[Downgrading packages|Downgrade]] the {{Pkg|flashplugin}} package to version 11.1.102.63-1 at most.<br />
# Use {{AUR|google-chrome}} with the new Pepper API {{AUR|chromium-pepper-flash}}.<br />
# Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread].<br />
<br />
=== Bleeding overlay with Flash ===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this problem simply install the latest {{Pkg|libvdpau}} or export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}<br />
<br />
=== Full system freeze using Flash ===<br />
<br />
If you experience occasional full system freezes (only the mouse is moving) using flashplugin<br />
and get:<br />
<br />
{{hc|/var/log/errors.log|<br />
NVRM: Xid (0000:01:00): 31, Ch 00000007, engmask 00000120, intr 10000000<br />
}}<br />
<br />
A possible workaround is to switch off Hardware Acceleration in Flash, setting<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
Or, if you want to keep Hardware acceleration enabled, you may try to::<br />
export VDPAU_NVIDIA_NO_OVERLAY=1<br />
<br />
...before starting the browser.<br />
Note that this may introduce tearing.<br />
<br />
=== Xorg fails to load or Red Screen of Death ===<br />
<br />
If you get a red screen and use GRUB disable the GRUB framebuffer by editing {{ic|/etc/default/grub}} and uncomment GRUB_TERMINAL_OUTPUT. For more information see [[GRUB#Disable_framebuffer|GRUB]].<br />
<br />
=== Black screen on systems with Intel integrated GPU ===<br />
<br />
If you have an Intel CPU with an integrated GPU (e.g. Intel HD 4000) and have installed the {{Pkg|nvidia}} package, you may experience a black screen on boot, when changing virtual terminal, or when exiting an X session. This may be caused by a conflict between the graphics modules. This is solved by blacklisting the Intel GPU modules. Create the file {{ic|/etc/modprobe.d/blacklist.conf}} and prevent the ''i915'' and ''intel_agp'' modules from loading on boot:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install i915 /usr/bin/false<br />
install intel_agp /usr/bin/false<br />
}}<br />
<br />
=== Black screen on systems with VIA integrated GPU ===<br />
<br />
As above, blacklisting the ''viafb'' module may resolve conflicts with NVIDIA drivers:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install viafb /usr/bin/false<br />
}}<br />
<br />
=== X fails with "no screens found" with Intel iGPU ===<br />
<br />
Like above, if you have an Intel CPU with an integrated GPU and X fails to start with <br />
<br />
[ 76.633] (EE) No devices detected.<br />
[ 76.633] Fatal server error:<br />
[ 76.633] no screens found<br />
<br />
then you need to add your discrete card's BusID to your X configuration. Find it:<br />
<br />
{{hc|<nowiki># lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)<br />
}}<br />
<br />
then you fix it by adding it to the card's Device section in your X configuration. In my case:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
Note how {{ic|01:00.0}} is written as {{ic|1:0:0}}.<br />
<br />
=== Xorg fails during boot, but otherwise starts fine ===<br />
<br />
On very fast booting systems, systemd may attempt to start the display manager before the NVIDIA driver has fully initialized. You will see a message like the following in your logs only when Xorg runs during boot.<br />
{{hc|/var/log/Xorg.0.log|output=<br />
[ 1.807] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the<br />
[ 1.807] (EE) NVIDIA(0): system's kernel log for additional error messages and<br />
[ 1.808] (EE) NVIDIA(0): consult the NVIDIA README for details.<br />
[ 1.808] (EE) NVIDIA(0): *** Aborting ***<br />
}}<br />
In this case you will need to establish an ordering dependency from the display manager to the DRI device. First create device units for DRI devices by creating a new udev rules file.<br />
{{hc|/etc/udev/rules.d/99-systemd-dri-devices.rules|output=<br />
ACTION=="add", KERNEL=="card*", SUBSYSTEM=="drm", TAG+="systemd"<br />
}}<br />
Then create dependencies from the display manager to the device(s).<br />
{{hc|/etc/systemd/system/display-manager.service.d/10-wait-for-dri-devices.conf|output=<br />
[Unit]<br />
Wants=dev-dri-card0.device<br />
After=dev-dri-card0.device<br />
}}<br />
If you have additional cards needed for the desktop then list them in Wants and After seperated by spaces.<br />
<br />
=== Flash video players crashes ===<br />
<br />
If you are getting frequent crashes of Flash video players, try to switch off Hardware Acceleration:<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
(This problem appeared after installing the proprietary nvidia driver, and was fixed by changing this setting.)<br />
<br />
== See also ==<br />
<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=343900NVIDIA2014-11-08T16:40:07Z<p>Yafengabc: /* No brightness control on laptops */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
[[zh-CN:NVIDIA]]<br />
{{Related articles start}}<br />
{{Related|Nouveau}}<br />
{{Related|Bumblebee}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]]. See instead [[NVIDIA Optimus]] if you have a laptop based on such technology.<br />
<br />
== Installing ==<br />
<br />
These instructions are for those using the stock {{Pkg|linux}} or {{Pkg|linux-lts}} packages. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
{{Warning| Mixing driver versions does NOT work. You can't use the current branch and the 32-Bit libGL package of the legacy branches or any combination.}}<br />
<br />
1. If you do not know what graphics card you have, find out by issuing:<br />
:{{bc|<nowiki>$ lspci -k | grep -A 2 -i "VGA"</nowiki>}}<br />
<br />
2. Determine the necessary driver version for your card by visiting NVIDIA's [http://www.nvidia.com/Download/index.aspx driver download site], looking up the name in NVIDIA's [http://www.nvidia.com/object/IO_32667.html legacy card list], or finding the code name on [http://nouveau.freedesktop.org/wiki/CodeNames nouveau wiki's code names page].<br />
<br />
3. Install the appropriate driver for your card:<br />
:* For GeForce 400 series cards and newer [NVCx and newer], install the {{Pkg|nvidia}} or {{Pkg|nvidia-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 8000/9000 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx] from around 2006-2010, install the {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-340xx-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 6000/7000 series cards [NV4x and NV6x] from around 2004-2006, install the {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} package, available in the [[official repositories]].<br />
<br />
:* For even older cards, have a look at [[#Unsupported drivers]].<br />
:* For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[Arch User Repository]], since the stable drivers may not support the newly introduced features.<br />
<br />
:If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent ''lib32'' package from the [[multilib]] repository (e.g. {{Pkg|lib32-nvidia-libgl}}, {{Pkg|lib32-nvidia-340xx-libgl}} or {{Pkg|lib32-nvidia-304xx-libgl}}).<br />
<br />
4. Reboot. The {{Pkg|nvidia}} package contains a file which blacklists the ''nouveau'' module, so rebooting is necessary.<br />
<br />
Once the driver has been installed, continue to [[#Configuring]].<br />
<br />
=== Unsupported drivers ===<br />
<br />
If you have a GeForce 5 FX series card or older, Nvidia no longer supports drivers for you card. This means that these drivers [http://nvidia.custhelp.com/app/answers/detail/a_id/3142/ do not support the current Xorg version]. It thus might be easier if you use the [[nouveau]] driver, which supports the old cards with the current Xorg.<br />
<br />
However, Nvidia's drivers might provide better 3D performance/stability. If you want to use them, you can install them (together with an old Xorg version) from the [[Arch User Repository]]:<br />
<br />
* For GeForce 5 FX series cards [NV30-NV36], install the {{AUR|nvidia-173xx}} package. Last supported Xorg version is 1.15.<br />
* For GeForce 2/3/4 MX/Ti series cards [NV11, NV17-NV28], install the {{AUR|nvidia-96xx}} package. Last supported Xorg version is 1.12.<br />
<br />
{{Tip|The legacy nvidia-96xx and nvidia-173xx drivers can also be installed from the unofficial [http://pkgbuild.com/~bgyorgy/city.html <nowiki>[city] repository</nowiki>]. (It's strongly advised that you don't skip any dependencies restriction when installing from here)}}<br />
<br />
=== Alternate install: custom kernel ===<br />
<br />
First of all, it's good to know how the ABS works by reading some of the other articles about it:<br />
<br />
* Main article for [[Arch Build System|ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating packages]]<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
[[Pacman|Install]] {{Pkg|abs}} from the [[official repositories]] and generate the tree with:<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/abs<br />
Make a copy of the {{ic|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/abs/<br />
Go into the temporary {{ic|nvidia}} build directory:<br />
$ cd ~/abs/nvidia<br />
It is required to edit the files {{ic|nvidia.install}} and {{ic|PKGBUILD}} so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are multiple kernels installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nouveau module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{ic|-c}} operand tells makepkg to clean left over files after building the package, whereas {{ic|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
=== Automatic re-compilation of the NVIDIA module with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|nvidia-hook}} from the [[AUR]]. You will need to install the module sources: {{AUR|nvidia-dkms}}. In '''nvidia-hook''', the 'automatic re-compilation' functionality is done by a '''nvidia hook''' on [[mkinitcpio]] after forcing to update the '''linux-headers''' package. You will need to add 'nvidia' to the HOOKS array in /etc/mkinitcpio.conf.<br />
<br />
The hook will call the '''dkms''' command to update the NVIDIA module for the version of your new kernel.<br />
<br />
{{Note|<br />
* If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. nvidia hook will tell you if anything goes wrong.<br />
* If you would like to do this manually please see this section [[Dynamic Kernel Module Support#Usage| in the dkms arch wiki.]]<br />
}}<br />
<br />
== Configuring ==<br />
<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a configuration file (prefer {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} over {{ic|/etc/X11/xorg.conf}}) in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a number of settings that can bypass Xorg's auto-discovered or pre-configured options.<br />
{{Note|Since 1.8.x Xorg uses separate configuration files in {{ic|/etc/X11/xorg.conf.d/}} - check out [[NVIDIA#Advanced: 20-nvidia.conf|advanced configuration]] section.}}<br />
<br />
=== Minimal configuration ===<br />
<br />
A basic configuration block in {{ic|20-nvidia.conf}} (or deprecated in {{ic|xorg.conf}}) would look like this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Nvidia Card"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "NoLogo" "true"<br />
#Option "UseEDID" "false"<br />
#Option "ConnectedMonitor" "DFP"<br />
# ...<br />
EndSection<br />
}}<br />
<br />
{{Tip|If upgrading from nouveau make sure to remove "{{ic|nouveau}}" from {{ic|/etc/mkinitcpio.conf}}. See [[NVIDIA#Switching between NVIDIA and nouveau drivers|Switching between NVIDIA and nouveau drivers]], if switching between the open and proprietary drivers often.}}<br />
<br />
=== Automatic configuration ===<br />
<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{ic|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{ic|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{ic|/etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning|That may still not work properly with Xorg-server 1.8 }}<br />
<br />
=== Multiple monitors ===<br />
<br />
:''See [[Multihead]] for more general information''<br />
{{Warning|1=As of August 2013, Xinerama is broken when using the proprietary NVIDIA driver from 319 upwards. Users wishing to use Xinerama with the NVIDIA driver should use the NVIDIA 313 driver, which works only with Linux kernels earlier than 3.10. See [https://bbs.archlinux.org/viewtopic.php?id=163319 this thread] for more information.}}<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
TwinView only works on a per card basis: If you have multiple cards, you'll have to use xinerama or zaphod mode (multiple X screens). You can combine TwinView with zaphod mode, ending up, for example, with two X screens covering two monitors each. Most window managers fail miserably in zaphod mode. Awesome is the shining exception, and KDE almost works.<br />
<br />
Example configuration:<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "TwinLayout"<br />
Screen 0 "metaScreen" 0 0<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
<br />
#refer to the link below for more information on each of the following options.<br />
Option "HorizSync" "DFP-0: 28-33; DFP-1 28-33"<br />
Option "VertRefresh" "DFP-0: 43-73; DFP-1 43-73"<br />
Option "MetaModes" "1920x1080, 1920x1080"<br />
Option "ConnectedMonitor" "DFP-0, DFP-1"<br />
Option "MetaModeOrientation" "DFP-1 LeftOf DFP-0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "metaScreen"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "True"<br />
SubSection "Display"<br />
Modes "1920x1080"<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
[http://us.download.nvidia.com/XFree86/Linux-x86/304.51/README/configtwinview.html Device option information].<br />
<br />
If you have multiple cards that are SLI capable, it is possible to run more than one monitor attached to separate cards (for example: two cards in SLI with one monitor attached to each). The "MetaModes" option in conjunction with SLI Mosaic mode enables this. Below is a configuration which works for the aforementioned example and runs [[GNOME]] flawlessly.<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Device"<br />
Identifier "Card A"<br />
Driver "nvidia"<br />
BusID "PCI:1:00:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card B"<br />
Driver "nvidia"<br />
BusID "PCI:2:00:0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Right Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Left Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Right Screen"<br />
Device "Card A"<br />
Monitor "Right Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Left Screen"<br />
Device "Card B"<br />
Monitor "Left Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default"<br />
Screen 0 "Right Screen" 0 0<br />
Option "Xinerama" "0"<br />
EndSection}}<br />
<br />
===== Manual CLI configuration with xrandr =====<br />
<br />
If the latest solutions don't work for you, you can use your window manager's ''autostart'' implementation with {{Pkg|xorg-xrandr}}.<br />
<br />
Some {{ic|xrandr}} examples could be:<br />
<br />
xrandr --output DVI-I-0 --auto --primary --left-of DVI-I-1<br />
<br />
or:<br />
<br />
xrandr --output DVI-I-1 --pos 1440x0 --mode 1440x900 --rate 75.0<br />
<br />
When:<br />
<br />
* {{ic|--output}} is used to indicate the "monitor" to which the options are set.<br />
* {{ic|DVI-I-1}} is the name of the second monitor.<br />
* {{ic|--pos}} is the position of the second monitor relative to the first.<br />
* {{ic|--mode}} is the resolution of the second monitor.<br />
* {{ic|--rate}} is the refresh rate (in Hz).<br />
<br />
You can find the proper options by running {{ic|xrandr}} without any arguments.<br />
<br />
==== Using NVIDIA Settings ====<br />
<br />
You can also use the {{ic|nvidia-settings}} tool provided by {{Pkg|nvidia-utils}}. With this method, you will use the proprietary software NVIDIA provides with their drivers. Simply run {{ic|nvidia-settings}} as root, then configure as you wish, and then save the configuration to {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
==== ConnectedMonitor ====<br />
<br />
If the driver doesn't properly detect a second monitor, you can force it to do so with ConnectedMonitor. <br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
VendorName "Panasonic"<br />
ModelName "Panasonic MICRON 2100Ex"<br />
HorizSync 30.0 - 121.0 # this monitor has incorrect EDID, hence Option "UseEDIDFreqs" "false"<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor2"<br />
VendorName "Gateway"<br />
ModelName "GatewayVX1120"<br />
HorizSync 30.0 - 121.0<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device2"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 1<br />
EndSection<br />
<br />
}}<br />
<br />
The duplicated device with {{ic|Screen}} is how you get X to use two monitors on one card without {{ic|TwinView}}. Note that {{ic|nvidia-settings}} will strip out any {{ic|ConnectedMonitor}} options you have added.<br />
<br />
==== Mosaic mode ====<br />
<br />
Mosaic mode is the only way to use more than 2 monitors across multiple graphics cards with compositing. Your window manager may or may not recognize the distinction between each monitor.<br />
<br />
===== Base mosaic =====<br />
<br />
Base mosaic mode works on any set of Geforce 8000 series or higher GPUs. It cannot be enabled from withing the nvidia-setting GUI. You must either use the nvidia-xconfig command line program or edit xorg.conf by hand. Metamodes must be specified. The following is an example for four DFPs in a 2x2 configuration, each running at 1920x1024, with two DFPs connected to two cards:<br />
$ nvidia-xconfig --base-mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
{{Note|While the documentation lists a 2x2 configuration of monitors, Nvidia has reduced that ability to just 3 monitors in base mosaic mode as of driver version 304. More monitors are available with a Quadro card, but with standard consumer cards, it is limited to three. The explanation given for this reduction is "Feature parity with the Windows driver". As of 9/14/2014, Windows has no restriction on the number of monitors, even on the same driver version. This is not a bug, this is entirely by design.}}<br />
<br />
===== SLI Mosaic =====<br />
<br />
If you have an SLI configuration and each GPU is a Quadro FX 5800, Quadro Fermi or newer then you can use SLI Mosaic mode. It can be enabled from within the nvidia-settings GUI or from the command line with:<br />
$ nvidia-xconfig --sli=Mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
== Tweaking ==<br />
<br />
=== GUI: nvidia-settings ===<br />
<br />
The NVIDIA package includes the {{ic|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
The desktop environment's auto-startup method 'may' not work for loading nvidia-settings properly (KDE). To be sure that settings are really loaded put the command in ~/.xinitrc file (create if not present).<br />
<br />
{{Tip|On rare occasions the {{ic|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the problem.}}<br />
<br />
=== Advanced: 20-nvidia.conf ===<br />
<br />
Edit {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and add the option to the correct section. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/ NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.<br />
<br />
==== Disabling the logo on startup ====<br />
<br />
Add the {{ic|"NoLogo"}} option under section {{ic|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
==== Overriding monitor detection ====<br />
<br />
The {{ic|"ConnectedMonitor"}} option under section {{ic|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{ic|"CRT"}} for analog connections, {{ic|"DFP"}} for digital monitors and {{ic|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
==== Enabling brightness control ====<br />
<br />
Add under section {{ic|Device}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
{{Note|If you already have this enabled<br />
and your brightness control doesn't work try to comment it out.}}<br />
<br />
==== Enabling SLI ====<br />
<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A "supported configuration" is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{ic|lspci}}:<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
}}<br />
<br />
Add the BusID (3 in the previous example) under section {{ic|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{ic|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{ic|Screen}}:<br />
Option "SLI" "AA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| class="wikitable"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| AA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
Alternatively, you can use the {{ic|nvidia-xconfig}} utility to insert these changes into {{ic|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=AA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
{{hc|<nowiki>$ nvidia-settings -q all | grep SLIMode</nowiki>|<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
}}<br />
<br />
{{Warning| After enabling SLI, your system may become frozen/non-responsive upon starting xorg. It is advisable that you disable your display manager before restarting.}}<br />
<br />
==== Enabling overclocking ====<br />
<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{ic|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
{{Note|GeForce 400/500/600/700 series Fermi/Kepler cores CAN now, as of version 337.12, be overclocked! Now {{ic|Option "Coolbits" "8"}} needs to be set within the device section of the X configuration file to enable the new overclocking support. If you also want to enable manual GPU fan controls, you need to set {{ic|Option "Coolbits" "12"}}.}}<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|An alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]{{Dead link|2013|05|25}} and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]{{Dead link|2013|05|25}}. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits. [http://ivanvojtko.blogspot.sk/2014/03/how-to-overclock-geforce-460gtx-fermi.html Fermi BIOS modification tutorial]}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
<br />
Set the following string in the {{ic|Device}} section to enable PowerMizer at its maximum performance level (VSync won't work without this line):<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{ic|Device}} section to enable manual GPU fan control within {{ic|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Fixing terminal resolution ===<br />
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.<br />
<br />
==== GRUB ====<br />
If you are using GRUB, a possible solution is to edit the {{ic|GRUB_GFXMODE}} line of {{ic|/etc/default/grub}} with desired display resolutions. Multiple resolutions can be specified, including the default {{ic|auto}}, so it is recommended that you edit the line to resemble {{ic|1=GRUB_GFXMODE=<desired resolution>,<fallback such as 1024x768>,auto}}. For more information, refer to [https://www.gnu.org/software/grub/manual/html_node/gfxmode.html#gfxmode the GRUB gfxmode documentation].<br />
<br />
=== Enabling Pure Video HD (VDPAU/VAAPI) ===<br />
<br />
{{Merge|VDPAU|Keep here only the specifics and merge the general information into the main article.}}<br />
<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/Nvidia_PureVideo#Table_of_PureVideo_.28HD.29_GPUs].<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with {{Pkg|libva-vdpau-driver}}.<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware.}}<br />
<br />
To enable hardware acceleration in [[VLC media player|VLC]] go:<br />
<br />
{{ic|Tools > Preferences > Input & Codecs}}, then select {{ic|VDPAU}} as {{ic|'''Hardware-accelerated decoding'''}}<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
{{ic|Options > Preferences > General > Video Tab}}, then select {{ic|vdpau}} as {{ic|'''output driver'''}}<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
{{ic|Edit > Preference}}, then set {{ic|'''video output'''}} to {{ic|vdpau}}<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>512MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{ic|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
=== Avoid screen tearing in KDE (KWin) ===<br />
<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export __GL_YIELD="USLEEP"<br />
</nowiki>}}<br />
<br />
Also if the above doesn't help, then try this:<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export KWIN_TRIPLE_BUFFER=1<br />
</nowiki>}}<br />
<br />
Do not have both of the above enabled at the same time.<br />
Also if you enable triple buffering make sure to enable TripleBuffering for the driver itself.<br />
Source: https://bugs.kde.org/show_bug.cgi?id=322060<br />
<br />
=== Hardware accelerated video decoding with XvMC ===<br />
<br />
Accelerated decoding of MPEG-1 and MPEG-2 videos via [[XvMC]] are supported on GeForce4, GeForce 5 FX, GeForce 6 and GeForce 7 series cards. To use it, create a new file {{ic|/etc/X11/XvMCConfig}} with the following content:<br />
libXvMCNVIDIA_dynamic.so.1<br />
<br />
See how to configure [[XvMC#Supported software|supported software]].<br />
<br />
=== Using TV-out ===<br />
<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here].<br />
<br />
=== X with a TV (DFP) as the only display ===<br />
<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the {{ic|DFP}} section (again, {{ic|DFP-0}} or similar), click on the {{ic|Acquire Edid}} Button and store it somewhere, for example, {{ic|/etc/X11/dfp0.edid}}.<br />
<br />
Edit {{ic|xorg.conf}} by adding to the {{ic|Device}} section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The {{ic|ConnectedMonitor}} option forces the driver to recognize the DFP as if it were connected. The {{ic|CustomEDID}} provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
=== Check the power source ===<br />
<br />
The NVIDIA X.org driver can also be used to detect the GPU's current source of power. To see the current power source, check the 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
{{hc|$ nvidia-settings -q GPUPowerSource -t|1}}<br />
<br />
If you're seeing an error message similiar to the one below, then you either need to install [[acpid]] or start the systemd service via {{ic|systemctl start acpid.service}}<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
(If you are not seeing this error, it is not necessary to install/run acpid soley for this purpose. My current power source is correctly reported without acpid even installed.)<br />
<br />
=== Displaying GPU temperature in the shell ===<br />
<br />
==== Method 1 - nvidia-settings ====<br />
<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use {{ic|nvidia-settings}} as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as {{ic|rrdtool}} or {{ic|conky}}, among others:<br />
{{hc|$ nvidia-settings -q gpucoretemp -t|41}}<br />
<br />
==== Method 2 - nvidia-smi ====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temperature in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi<br />
<br />
This should output something similar to the following:<br />
{{hc|$ nvidia-smi|<nowiki><br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki><br />
}}<br />
<br />
Only for temperature:<br />
{{hc|$ nvidia-smi -q -d TEMPERATURE|<nowiki><br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki><br />
}}<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
{{hc|<nowiki>$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36</nowiki>|62}}<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli.<br />
<br />
==== Method 3 - nvclock ====<br />
<br />
Use {{AUR|nvclock}} which is available from the [[AUR]].<br />
{{Note|{{ic|nvclock}} cannot access thermal sensors on newer NVIDIA cards such as Geforce 200 series cards.}}<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
=== Set fan speed at login ===<br />
<br />
You can adjust the fan speed on your graphics card with ''nvidia-settings''' console interface. First ensure that your Xorg configuration sets the Coolbits option to {{ic|4}}, {{ic|5}} or {{ic|12}} for fermi and above in your {{ic|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GeForce 400/500 series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{ic|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace {{ic|''n''}} with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=''n''" \<br />
-a [fan:1]/GPUCurrentFanSpeed=''n''" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{ic|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change {{ic|''n''}} to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
=== Order of install/deinstall for changing drivers ===<br />
<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-libglN<br />
install nvidiaN<br />
install lib32-nvidia-libgl-N (if required)<br />
<br />
=== Switching between NVIDIA and nouveau drivers ===<br />
<br />
{{Warning|The {{ic|-Rdds}} switch is used as the installation otherwise fails due to unstatisfied dependencies.}}<br />
<br />
If you need to switch between drivers, you may use the following script, run as root (say yes to all confirmations):<br />
<br />
{{bc|1=<nowiki><br />
#!/bin/bash<br />
BRANCH=340xx<br />
#BRANCH=304xx<br />
<br />
NVIDIA="nvidia-$BRANCH"<br />
_NVIDIA="$(pacman -Qqs ^${NVIDIA}$)"<br />
NOUVEAU="xf86-video-nouveau mesa-libgl"<br />
_NOUVEAU="$(pacman -Qqs ^mesa-libgl$)"<br />
<br />
if [[ ! $_NVIDIA ]]; then<br />
pacman -Rdds "$NOUVEAU"<br />
pacman -S "$NVIDIA" #lib32-$NVIDIA-libgl #$NVIDIA-lts<br />
elif [[ ! $_NOUVEAU ]]; then<br />
pacman -Rdds "$_NVIDIA"<br />
pacman -S "$NOUVEAU" #lib32-mesa-libgl<br />
fi<br />
</nowiki>}}<br />
<br />
Uncomment the lib32 packages if you run a 64-bit system and require the 32-bit libraries (e.g. 32-bit games/Steam).<br />
<br />
=== Avoid tearing with GeForce 600/700 series cards === <br />
<br />
Adding the following line to the {{ic|"Screen"}} section of your X11 configuration file, for example {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, will eliminate tearing entirely, regardless of the compositor you are using. It has been reported to reduce the performance of some OpenGL applications, though.<br />
<br />
Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Gaming using TwinView ===<br />
<br />
In case you want to play fullscreen games when using TwinView, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropriate Metamodes to your xorg.conf in section {{ic|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
=== Vertical sync using TwinView ===<br />
<br />
If you're using TwinView and vertical sync (the "Sync to VBlank" option in '''nvidia-settings'''), you will notice that only one screen is being properly synced, unless you have two identical monitors. Although '''nvidia-settings''' does offer an option to change which screen is being synced (the "Sync to this display device" option), this does not always work. A solution is to add the following environment variables at startup, for example append in {{ic|/etc/profile}}:<br />
<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_SYNC_DISPLAY_DEVICE=DFP-0<br />
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DFP-0<br />
<br />
You can change {{ic|DFP-0}} with your preferred screen ({{ic|DFP-0}} is the DVI port and {{ic|CRT-0}} is the VGA port). You can find the identifier for your display from '''nvidia-settings''' in the "X Server XVideoSettings" section.<br />
<br />
=== Old Xorg settings ===<br />
<br />
If upgrading from an old installation, please remove old {{ic|/usr/X11R6/}} paths as it can cause trouble during installation.<br />
<br />
=== Corrupted screen: "Six screens" Problem ===<br />
<br />
For some users, using GeForce GT 100M's, the screen gets corrupted after X starts, divided into 6 sections with a resolution limited to 640x480.<br />
The same problem has been recently reported with Quadro 2000 and hi-res displays.<br />
<br />
To solve this problem, enable the Validation Mode {{ic|NoTotalSizeCheck}} in section {{ic|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
=== '/dev/nvidia0' input/output error ===<br />
<br />
{{Accuracy|Verify that the BIOS related suggestions work and are not coincidentally set while troubleshooting.|section='/dev/nvidia0' Input/Output error... suggested fixes}}<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the problem. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with {{ic|lspci -v}}) and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
If running a 64bit kernel, a driver defect can cause the NVIDIA module to fail initializing when IOMMU is on. Turning it off in the BIOS has been confirmed to work for some users. [http://www.nvnews.net/vbulletin/showthread.php?s=68bb2fabadcb53b10b286aa42d13c5bc&t=159335][[User:Clickthem#nvidia module]]<br />
<br />
Another thing to try is to change your BIOS IRQ routing from {{ic|Operating system controlled}} to {{ic|BIOS controlled}} or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The {{ic|noacpi}} kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
=== '/dev/nvidiactl' errors ===<br />
<br />
Trying to start an OpenGL application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropriate user to the {{ic|video}} group and log in again:<br />
# gpasswd -a username video<br />
<br />
=== 32-bit applications do not start ===<br />
<br />
Under 64-bit systems, installing {{ic|lib32-nvidia-libgl}} that corresponds to the same version installed for the 64-bit driver fixes the problem.<br />
<br />
=== Errors after updating the kernel ===<br />
<br />
If a custom build of NVIDIA's module is used instead of the package from the ''extra'' repository, a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
=== Crashing in general ===<br />
<br />
* Try disabling {{ic|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{ic|nopat}} at the end of the {{ic|kernel}} line in {{ic|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{ic|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{ic|nopat}} to [[kernel parameters]].<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
=== Bad performance after installing a new driver version ===<br />
<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on (glxinfo is included in {{Pkg|mesa-demos}}):<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
=== CPU spikes with 400 series cards ===<br />
<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the {{ic|Device}} section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
=== Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace ===<br />
<br />
If, while using the legacy NVIDIA drivers, Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via {{ic|Ctrl+Alt+Backspace}} (or whatever the new "kill X" key binding is), try adding this in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{ic|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's README: Appendix K] for more information.<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [[http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html]] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
==== Possible Workaround ====<br />
<br />
Enter the BIOS and changed the default graphics setting from 'Optimus' to 'Discrete' and the install NVIDIA drivers (295.20-1 at time of writing) recognized the screens.<br />
<br />
Steps:<br />
# Enter BIOS.<br />
# Find Graphics Settings (should be in tab ''Config > Display'').<br />
# Change 'Graphics Device' to 'Discrete Graphics' (Disables Intel integrated graphics).<br />
# Change OS Detection for Nvidia Optimus to "Disabled".<br />
# Save and exit.<br />
<br />
Tested on a Lenovo W520 with a Quadro 1000M and Nvidia Optimus<br />
<br />
=== Screen(s) found, but none have a usable configuration ===<br />
<br />
On a laptop, sometimes NVIDIA driver cannot find the active screen.<br />
It may be caused because you own a graphic card with vga/tv outs.<br />
You should examine Xorg.0.log to see what is wrong.<br />
<br />
Another thing to try is adding invalid {{ic|"ConnectedMonitor" Option}} to {{ic|Section "Device"}}<br />
to force Xorg throws error and shows you how correct it.<br />
[http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html Here]<br />
more about ConnectedMonitor setting.<br />
<br />
After re-run X see Xorg.0.log to get valid CRT-x,DFP-x,TV-x values.<br />
<br />
{{ic|nvidia-xconfig --query-gpu-info}} could be helpful.<br />
<br />
=== Blackscreen at X startup with new driver ===<br />
<br />
If you have installed an update of Nvidia and you screen stay black after launching Xorg. You have to use the {{ic|<nowiki>rcutree.rcu_idle_gp_delay=1</nowiki>}} [[kernel parameter]].<br />
<br />
You can also try to add the {{ic|nvidia}} module directly to your [[mkinitcpio]] config file.<br />
<br />
=== No brightness control on laptops ===<br />
<br />
Try to add the following line in {{ic|20-nvidia.conf}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
if the Xorg can't start an tested {{ic|20-nvidia.conf}} is:<br />
{{<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
}}<br />
<br />
<br />
<br />
If it is still not working, you can try installing {{AUR|nvidia-bl}} or {{AUR|nvidiabl}}.<br />
<br />
=== Backlight is not turning off in some occasions ===<br />
<br />
By default, DPMS should turn off backlight with the timeouts set or by running xset. However, probably due to a bug in the proprietary Nvidia drivers the result is a blank screen with no powersaving whatsoever. To workaround it, until the bug has been fixed you can use the {{ic|vbetool}} as root.<br />
<br />
Install the {{Pkg|vbetool}} package.<br />
<br />
Turn off your screen on demand and then by pressing a random key backlight turns on again:<br />
<br />
vbetool dpms off && read -n1; vbetool dpms on<br />
<br />
Alternatively, xrandr is able to disable and re-enable monitor outputs without requiring root.<br />
<br />
xrandr --output DP-1 --off; read -n1; xrandr --output DP-1 --auto<br />
<br />
=== Blue tint on videos with Flash ===<br />
<br />
A problem with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
# Install the latest {{Pkg|libvdpau}}.<br />
# Patch {{ic|vdpau_trace.so}} with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
# Right click on a video, select "Settings..." and uncheck "Enable hardware acceleration". Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
# [[Downgrading packages|Downgrade]] the {{Pkg|flashplugin}} package to version 11.1.102.63-1 at most.<br />
# Use {{AUR|google-chrome}} with the new Pepper API {{AUR|chromium-pepper-flash}}.<br />
# Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread].<br />
<br />
=== Bleeding overlay with Flash ===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this problem simply install the latest {{Pkg|libvdpau}} or export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}<br />
<br />
=== Full system freeze using Flash ===<br />
<br />
If you experience occasional full system freezes (only the mouse is moving) using flashplugin<br />
and get:<br />
<br />
{{hc|/var/log/errors.log|<br />
NVRM: Xid (0000:01:00): 31, Ch 00000007, engmask 00000120, intr 10000000<br />
}}<br />
<br />
A possible workaround is to switch off Hardware Acceleration in Flash, setting<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
Or, if you want to keep Hardware acceleration enabled, you may try to::<br />
export VDPAU_NVIDIA_NO_OVERLAY=1<br />
<br />
...before starting the browser.<br />
Note that this may introduce tearing.<br />
<br />
=== Xorg fails to load or Red Screen of Death ===<br />
<br />
If you get a red screen and use GRUB disable the GRUB framebuffer by editing {{ic|/etc/default/grub}} and uncomment GRUB_TERMINAL_OUTPUT. For more information see [[GRUB#Disable_framebuffer|GRUB]].<br />
<br />
=== Black screen on systems with Intel integrated GPU ===<br />
<br />
If you have an Intel CPU with an integrated GPU (e.g. Intel HD 4000) and have installed the {{Pkg|nvidia}} package, you may experience a black screen on boot, when changing virtual terminal, or when exiting an X session. This may be caused by a conflict between the graphics modules. This is solved by blacklisting the Intel GPU modules. Create the file {{ic|/etc/modprobe.d/blacklist.conf}} and prevent the ''i915'' and ''intel_agp'' modules from loading on boot:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install i915 /usr/bin/false<br />
install intel_agp /usr/bin/false<br />
}}<br />
<br />
=== Black screen on systems with VIA integrated GPU ===<br />
<br />
As above, blacklisting the ''viafb'' module may resolve conflicts with NVIDIA drivers:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install viafb /usr/bin/false<br />
}}<br />
<br />
=== X fails with "no screens found" with Intel iGPU ===<br />
<br />
Like above, if you have an Intel CPU with an integrated GPU and X fails to start with <br />
<br />
[ 76.633] (EE) No devices detected.<br />
[ 76.633] Fatal server error:<br />
[ 76.633] no screens found<br />
<br />
then you need to add your discrete card's BusID to your X configuration. Find it:<br />
<br />
{{hc|<nowiki># lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)<br />
}}<br />
<br />
then you fix it by adding it to the card's Device section in your X configuration. In my case:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
Note how {{ic|01:00.0}} is written as {{ic|1:0:0}}.<br />
<br />
=== Xorg fails during boot, but otherwise starts fine ===<br />
<br />
On very fast booting systems, systemd may attempt to start the display manager before the NVIDIA driver has fully initialized. You will see a message like the following in your logs only when Xorg runs during boot.<br />
{{hc|/var/log/Xorg.0.log|output=<br />
[ 1.807] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the<br />
[ 1.807] (EE) NVIDIA(0): system's kernel log for additional error messages and<br />
[ 1.808] (EE) NVIDIA(0): consult the NVIDIA README for details.<br />
[ 1.808] (EE) NVIDIA(0): *** Aborting ***<br />
}}<br />
In this case you will need to establish an ordering dependency from the display manager to the DRI device. First create device units for DRI devices by creating a new udev rules file.<br />
{{hc|/etc/udev/rules.d/99-systemd-dri-devices.rules|output=<br />
ACTION=="add", KERNEL=="card*", SUBSYSTEM=="drm", TAG+="systemd"<br />
}}<br />
Then create dependencies from the display manager to the device(s).<br />
{{hc|/etc/systemd/system/display-manager.service.d/10-wait-for-dri-devices.conf|output=<br />
[Unit]<br />
Wants=dev-dri-card0.device<br />
After=dev-dri-card0.device<br />
}}<br />
If you have additional cards needed for the desktop then list them in Wants and After seperated by spaces.<br />
<br />
=== Flash video players crashes ===<br />
<br />
If you are getting frequent crashes of Flash video players, try to switch off Hardware Acceleration:<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
(This problem appeared after installing the proprietary nvidia driver, and was fixed by changing this setting.)<br />
<br />
== See also ==<br />
<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=343899NVIDIA2014-11-08T16:39:25Z<p>Yafengabc: /* No brightness control on laptops */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
[[zh-CN:NVIDIA]]<br />
{{Related articles start}}<br />
{{Related|Nouveau}}<br />
{{Related|Bumblebee}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]]. See instead [[NVIDIA Optimus]] if you have a laptop based on such technology.<br />
<br />
== Installing ==<br />
<br />
These instructions are for those using the stock {{Pkg|linux}} or {{Pkg|linux-lts}} packages. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
{{Warning| Mixing driver versions does NOT work. You can't use the current branch and the 32-Bit libGL package of the legacy branches or any combination.}}<br />
<br />
1. If you do not know what graphics card you have, find out by issuing:<br />
:{{bc|<nowiki>$ lspci -k | grep -A 2 -i "VGA"</nowiki>}}<br />
<br />
2. Determine the necessary driver version for your card by visiting NVIDIA's [http://www.nvidia.com/Download/index.aspx driver download site], looking up the name in NVIDIA's [http://www.nvidia.com/object/IO_32667.html legacy card list], or finding the code name on [http://nouveau.freedesktop.org/wiki/CodeNames nouveau wiki's code names page].<br />
<br />
3. Install the appropriate driver for your card:<br />
:* For GeForce 400 series cards and newer [NVCx and newer], install the {{Pkg|nvidia}} or {{Pkg|nvidia-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 8000/9000 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx] from around 2006-2010, install the {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-340xx-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 6000/7000 series cards [NV4x and NV6x] from around 2004-2006, install the {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} package, available in the [[official repositories]].<br />
<br />
:* For even older cards, have a look at [[#Unsupported drivers]].<br />
:* For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[Arch User Repository]], since the stable drivers may not support the newly introduced features.<br />
<br />
:If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent ''lib32'' package from the [[multilib]] repository (e.g. {{Pkg|lib32-nvidia-libgl}}, {{Pkg|lib32-nvidia-340xx-libgl}} or {{Pkg|lib32-nvidia-304xx-libgl}}).<br />
<br />
4. Reboot. The {{Pkg|nvidia}} package contains a file which blacklists the ''nouveau'' module, so rebooting is necessary.<br />
<br />
Once the driver has been installed, continue to [[#Configuring]].<br />
<br />
=== Unsupported drivers ===<br />
<br />
If you have a GeForce 5 FX series card or older, Nvidia no longer supports drivers for you card. This means that these drivers [http://nvidia.custhelp.com/app/answers/detail/a_id/3142/ do not support the current Xorg version]. It thus might be easier if you use the [[nouveau]] driver, which supports the old cards with the current Xorg.<br />
<br />
However, Nvidia's drivers might provide better 3D performance/stability. If you want to use them, you can install them (together with an old Xorg version) from the [[Arch User Repository]]:<br />
<br />
* For GeForce 5 FX series cards [NV30-NV36], install the {{AUR|nvidia-173xx}} package. Last supported Xorg version is 1.15.<br />
* For GeForce 2/3/4 MX/Ti series cards [NV11, NV17-NV28], install the {{AUR|nvidia-96xx}} package. Last supported Xorg version is 1.12.<br />
<br />
{{Tip|The legacy nvidia-96xx and nvidia-173xx drivers can also be installed from the unofficial [http://pkgbuild.com/~bgyorgy/city.html <nowiki>[city] repository</nowiki>]. (It's strongly advised that you don't skip any dependencies restriction when installing from here)}}<br />
<br />
=== Alternate install: custom kernel ===<br />
<br />
First of all, it's good to know how the ABS works by reading some of the other articles about it:<br />
<br />
* Main article for [[Arch Build System|ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating packages]]<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
[[Pacman|Install]] {{Pkg|abs}} from the [[official repositories]] and generate the tree with:<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/abs<br />
Make a copy of the {{ic|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/abs/<br />
Go into the temporary {{ic|nvidia}} build directory:<br />
$ cd ~/abs/nvidia<br />
It is required to edit the files {{ic|nvidia.install}} and {{ic|PKGBUILD}} so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are multiple kernels installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nouveau module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{ic|-c}} operand tells makepkg to clean left over files after building the package, whereas {{ic|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
=== Automatic re-compilation of the NVIDIA module with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|nvidia-hook}} from the [[AUR]]. You will need to install the module sources: {{AUR|nvidia-dkms}}. In '''nvidia-hook''', the 'automatic re-compilation' functionality is done by a '''nvidia hook''' on [[mkinitcpio]] after forcing to update the '''linux-headers''' package. You will need to add 'nvidia' to the HOOKS array in /etc/mkinitcpio.conf.<br />
<br />
The hook will call the '''dkms''' command to update the NVIDIA module for the version of your new kernel.<br />
<br />
{{Note|<br />
* If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. nvidia hook will tell you if anything goes wrong.<br />
* If you would like to do this manually please see this section [[Dynamic Kernel Module Support#Usage| in the dkms arch wiki.]]<br />
}}<br />
<br />
== Configuring ==<br />
<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a configuration file (prefer {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} over {{ic|/etc/X11/xorg.conf}}) in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a number of settings that can bypass Xorg's auto-discovered or pre-configured options.<br />
{{Note|Since 1.8.x Xorg uses separate configuration files in {{ic|/etc/X11/xorg.conf.d/}} - check out [[NVIDIA#Advanced: 20-nvidia.conf|advanced configuration]] section.}}<br />
<br />
=== Minimal configuration ===<br />
<br />
A basic configuration block in {{ic|20-nvidia.conf}} (or deprecated in {{ic|xorg.conf}}) would look like this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Nvidia Card"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "NoLogo" "true"<br />
#Option "UseEDID" "false"<br />
#Option "ConnectedMonitor" "DFP"<br />
# ...<br />
EndSection<br />
}}<br />
<br />
{{Tip|If upgrading from nouveau make sure to remove "{{ic|nouveau}}" from {{ic|/etc/mkinitcpio.conf}}. See [[NVIDIA#Switching between NVIDIA and nouveau drivers|Switching between NVIDIA and nouveau drivers]], if switching between the open and proprietary drivers often.}}<br />
<br />
=== Automatic configuration ===<br />
<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{ic|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{ic|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{ic|/etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning|That may still not work properly with Xorg-server 1.8 }}<br />
<br />
=== Multiple monitors ===<br />
<br />
:''See [[Multihead]] for more general information''<br />
{{Warning|1=As of August 2013, Xinerama is broken when using the proprietary NVIDIA driver from 319 upwards. Users wishing to use Xinerama with the NVIDIA driver should use the NVIDIA 313 driver, which works only with Linux kernels earlier than 3.10. See [https://bbs.archlinux.org/viewtopic.php?id=163319 this thread] for more information.}}<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
TwinView only works on a per card basis: If you have multiple cards, you'll have to use xinerama or zaphod mode (multiple X screens). You can combine TwinView with zaphod mode, ending up, for example, with two X screens covering two monitors each. Most window managers fail miserably in zaphod mode. Awesome is the shining exception, and KDE almost works.<br />
<br />
Example configuration:<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "TwinLayout"<br />
Screen 0 "metaScreen" 0 0<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
<br />
#refer to the link below for more information on each of the following options.<br />
Option "HorizSync" "DFP-0: 28-33; DFP-1 28-33"<br />
Option "VertRefresh" "DFP-0: 43-73; DFP-1 43-73"<br />
Option "MetaModes" "1920x1080, 1920x1080"<br />
Option "ConnectedMonitor" "DFP-0, DFP-1"<br />
Option "MetaModeOrientation" "DFP-1 LeftOf DFP-0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "metaScreen"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "True"<br />
SubSection "Display"<br />
Modes "1920x1080"<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
[http://us.download.nvidia.com/XFree86/Linux-x86/304.51/README/configtwinview.html Device option information].<br />
<br />
If you have multiple cards that are SLI capable, it is possible to run more than one monitor attached to separate cards (for example: two cards in SLI with one monitor attached to each). The "MetaModes" option in conjunction with SLI Mosaic mode enables this. Below is a configuration which works for the aforementioned example and runs [[GNOME]] flawlessly.<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Device"<br />
Identifier "Card A"<br />
Driver "nvidia"<br />
BusID "PCI:1:00:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card B"<br />
Driver "nvidia"<br />
BusID "PCI:2:00:0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Right Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Left Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Right Screen"<br />
Device "Card A"<br />
Monitor "Right Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Left Screen"<br />
Device "Card B"<br />
Monitor "Left Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default"<br />
Screen 0 "Right Screen" 0 0<br />
Option "Xinerama" "0"<br />
EndSection}}<br />
<br />
===== Manual CLI configuration with xrandr =====<br />
<br />
If the latest solutions don't work for you, you can use your window manager's ''autostart'' implementation with {{Pkg|xorg-xrandr}}.<br />
<br />
Some {{ic|xrandr}} examples could be:<br />
<br />
xrandr --output DVI-I-0 --auto --primary --left-of DVI-I-1<br />
<br />
or:<br />
<br />
xrandr --output DVI-I-1 --pos 1440x0 --mode 1440x900 --rate 75.0<br />
<br />
When:<br />
<br />
* {{ic|--output}} is used to indicate the "monitor" to which the options are set.<br />
* {{ic|DVI-I-1}} is the name of the second monitor.<br />
* {{ic|--pos}} is the position of the second monitor relative to the first.<br />
* {{ic|--mode}} is the resolution of the second monitor.<br />
* {{ic|--rate}} is the refresh rate (in Hz).<br />
<br />
You can find the proper options by running {{ic|xrandr}} without any arguments.<br />
<br />
==== Using NVIDIA Settings ====<br />
<br />
You can also use the {{ic|nvidia-settings}} tool provided by {{Pkg|nvidia-utils}}. With this method, you will use the proprietary software NVIDIA provides with their drivers. Simply run {{ic|nvidia-settings}} as root, then configure as you wish, and then save the configuration to {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
==== ConnectedMonitor ====<br />
<br />
If the driver doesn't properly detect a second monitor, you can force it to do so with ConnectedMonitor. <br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
VendorName "Panasonic"<br />
ModelName "Panasonic MICRON 2100Ex"<br />
HorizSync 30.0 - 121.0 # this monitor has incorrect EDID, hence Option "UseEDIDFreqs" "false"<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor2"<br />
VendorName "Gateway"<br />
ModelName "GatewayVX1120"<br />
HorizSync 30.0 - 121.0<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device2"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 1<br />
EndSection<br />
<br />
}}<br />
<br />
The duplicated device with {{ic|Screen}} is how you get X to use two monitors on one card without {{ic|TwinView}}. Note that {{ic|nvidia-settings}} will strip out any {{ic|ConnectedMonitor}} options you have added.<br />
<br />
==== Mosaic mode ====<br />
<br />
Mosaic mode is the only way to use more than 2 monitors across multiple graphics cards with compositing. Your window manager may or may not recognize the distinction between each monitor.<br />
<br />
===== Base mosaic =====<br />
<br />
Base mosaic mode works on any set of Geforce 8000 series or higher GPUs. It cannot be enabled from withing the nvidia-setting GUI. You must either use the nvidia-xconfig command line program or edit xorg.conf by hand. Metamodes must be specified. The following is an example for four DFPs in a 2x2 configuration, each running at 1920x1024, with two DFPs connected to two cards:<br />
$ nvidia-xconfig --base-mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
{{Note|While the documentation lists a 2x2 configuration of monitors, Nvidia has reduced that ability to just 3 monitors in base mosaic mode as of driver version 304. More monitors are available with a Quadro card, but with standard consumer cards, it is limited to three. The explanation given for this reduction is "Feature parity with the Windows driver". As of 9/14/2014, Windows has no restriction on the number of monitors, even on the same driver version. This is not a bug, this is entirely by design.}}<br />
<br />
===== SLI Mosaic =====<br />
<br />
If you have an SLI configuration and each GPU is a Quadro FX 5800, Quadro Fermi or newer then you can use SLI Mosaic mode. It can be enabled from within the nvidia-settings GUI or from the command line with:<br />
$ nvidia-xconfig --sli=Mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
== Tweaking ==<br />
<br />
=== GUI: nvidia-settings ===<br />
<br />
The NVIDIA package includes the {{ic|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
The desktop environment's auto-startup method 'may' not work for loading nvidia-settings properly (KDE). To be sure that settings are really loaded put the command in ~/.xinitrc file (create if not present).<br />
<br />
{{Tip|On rare occasions the {{ic|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the problem.}}<br />
<br />
=== Advanced: 20-nvidia.conf ===<br />
<br />
Edit {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and add the option to the correct section. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/ NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.<br />
<br />
==== Disabling the logo on startup ====<br />
<br />
Add the {{ic|"NoLogo"}} option under section {{ic|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
==== Overriding monitor detection ====<br />
<br />
The {{ic|"ConnectedMonitor"}} option under section {{ic|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{ic|"CRT"}} for analog connections, {{ic|"DFP"}} for digital monitors and {{ic|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
==== Enabling brightness control ====<br />
<br />
Add under section {{ic|Device}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
{{Note|If you already have this enabled<br />
and your brightness control doesn't work try to comment it out.}}<br />
<br />
==== Enabling SLI ====<br />
<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A "supported configuration" is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{ic|lspci}}:<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
}}<br />
<br />
Add the BusID (3 in the previous example) under section {{ic|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{ic|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{ic|Screen}}:<br />
Option "SLI" "AA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| class="wikitable"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| AA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
Alternatively, you can use the {{ic|nvidia-xconfig}} utility to insert these changes into {{ic|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=AA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
{{hc|<nowiki>$ nvidia-settings -q all | grep SLIMode</nowiki>|<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
}}<br />
<br />
{{Warning| After enabling SLI, your system may become frozen/non-responsive upon starting xorg. It is advisable that you disable your display manager before restarting.}}<br />
<br />
==== Enabling overclocking ====<br />
<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{ic|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
{{Note|GeForce 400/500/600/700 series Fermi/Kepler cores CAN now, as of version 337.12, be overclocked! Now {{ic|Option "Coolbits" "8"}} needs to be set within the device section of the X configuration file to enable the new overclocking support. If you also want to enable manual GPU fan controls, you need to set {{ic|Option "Coolbits" "12"}}.}}<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|An alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]{{Dead link|2013|05|25}} and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]{{Dead link|2013|05|25}}. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits. [http://ivanvojtko.blogspot.sk/2014/03/how-to-overclock-geforce-460gtx-fermi.html Fermi BIOS modification tutorial]}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
<br />
Set the following string in the {{ic|Device}} section to enable PowerMizer at its maximum performance level (VSync won't work without this line):<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{ic|Device}} section to enable manual GPU fan control within {{ic|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Fixing terminal resolution ===<br />
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.<br />
<br />
==== GRUB ====<br />
If you are using GRUB, a possible solution is to edit the {{ic|GRUB_GFXMODE}} line of {{ic|/etc/default/grub}} with desired display resolutions. Multiple resolutions can be specified, including the default {{ic|auto}}, so it is recommended that you edit the line to resemble {{ic|1=GRUB_GFXMODE=<desired resolution>,<fallback such as 1024x768>,auto}}. For more information, refer to [https://www.gnu.org/software/grub/manual/html_node/gfxmode.html#gfxmode the GRUB gfxmode documentation].<br />
<br />
=== Enabling Pure Video HD (VDPAU/VAAPI) ===<br />
<br />
{{Merge|VDPAU|Keep here only the specifics and merge the general information into the main article.}}<br />
<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/Nvidia_PureVideo#Table_of_PureVideo_.28HD.29_GPUs].<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with {{Pkg|libva-vdpau-driver}}.<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware.}}<br />
<br />
To enable hardware acceleration in [[VLC media player|VLC]] go:<br />
<br />
{{ic|Tools > Preferences > Input & Codecs}}, then select {{ic|VDPAU}} as {{ic|'''Hardware-accelerated decoding'''}}<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
{{ic|Options > Preferences > General > Video Tab}}, then select {{ic|vdpau}} as {{ic|'''output driver'''}}<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
{{ic|Edit > Preference}}, then set {{ic|'''video output'''}} to {{ic|vdpau}}<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>512MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{ic|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
=== Avoid screen tearing in KDE (KWin) ===<br />
<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export __GL_YIELD="USLEEP"<br />
</nowiki>}}<br />
<br />
Also if the above doesn't help, then try this:<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export KWIN_TRIPLE_BUFFER=1<br />
</nowiki>}}<br />
<br />
Do not have both of the above enabled at the same time.<br />
Also if you enable triple buffering make sure to enable TripleBuffering for the driver itself.<br />
Source: https://bugs.kde.org/show_bug.cgi?id=322060<br />
<br />
=== Hardware accelerated video decoding with XvMC ===<br />
<br />
Accelerated decoding of MPEG-1 and MPEG-2 videos via [[XvMC]] are supported on GeForce4, GeForce 5 FX, GeForce 6 and GeForce 7 series cards. To use it, create a new file {{ic|/etc/X11/XvMCConfig}} with the following content:<br />
libXvMCNVIDIA_dynamic.so.1<br />
<br />
See how to configure [[XvMC#Supported software|supported software]].<br />
<br />
=== Using TV-out ===<br />
<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here].<br />
<br />
=== X with a TV (DFP) as the only display ===<br />
<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the {{ic|DFP}} section (again, {{ic|DFP-0}} or similar), click on the {{ic|Acquire Edid}} Button and store it somewhere, for example, {{ic|/etc/X11/dfp0.edid}}.<br />
<br />
Edit {{ic|xorg.conf}} by adding to the {{ic|Device}} section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The {{ic|ConnectedMonitor}} option forces the driver to recognize the DFP as if it were connected. The {{ic|CustomEDID}} provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
=== Check the power source ===<br />
<br />
The NVIDIA X.org driver can also be used to detect the GPU's current source of power. To see the current power source, check the 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
{{hc|$ nvidia-settings -q GPUPowerSource -t|1}}<br />
<br />
If you're seeing an error message similiar to the one below, then you either need to install [[acpid]] or start the systemd service via {{ic|systemctl start acpid.service}}<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
(If you are not seeing this error, it is not necessary to install/run acpid soley for this purpose. My current power source is correctly reported without acpid even installed.)<br />
<br />
=== Displaying GPU temperature in the shell ===<br />
<br />
==== Method 1 - nvidia-settings ====<br />
<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use {{ic|nvidia-settings}} as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as {{ic|rrdtool}} or {{ic|conky}}, among others:<br />
{{hc|$ nvidia-settings -q gpucoretemp -t|41}}<br />
<br />
==== Method 2 - nvidia-smi ====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temperature in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi<br />
<br />
This should output something similar to the following:<br />
{{hc|$ nvidia-smi|<nowiki><br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki><br />
}}<br />
<br />
Only for temperature:<br />
{{hc|$ nvidia-smi -q -d TEMPERATURE|<nowiki><br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki><br />
}}<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
{{hc|<nowiki>$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36</nowiki>|62}}<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli.<br />
<br />
==== Method 3 - nvclock ====<br />
<br />
Use {{AUR|nvclock}} which is available from the [[AUR]].<br />
{{Note|{{ic|nvclock}} cannot access thermal sensors on newer NVIDIA cards such as Geforce 200 series cards.}}<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
=== Set fan speed at login ===<br />
<br />
You can adjust the fan speed on your graphics card with ''nvidia-settings''' console interface. First ensure that your Xorg configuration sets the Coolbits option to {{ic|4}}, {{ic|5}} or {{ic|12}} for fermi and above in your {{ic|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GeForce 400/500 series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{ic|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace {{ic|''n''}} with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=''n''" \<br />
-a [fan:1]/GPUCurrentFanSpeed=''n''" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{ic|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change {{ic|''n''}} to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
=== Order of install/deinstall for changing drivers ===<br />
<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-libglN<br />
install nvidiaN<br />
install lib32-nvidia-libgl-N (if required)<br />
<br />
=== Switching between NVIDIA and nouveau drivers ===<br />
<br />
{{Warning|The {{ic|-Rdds}} switch is used as the installation otherwise fails due to unstatisfied dependencies.}}<br />
<br />
If you need to switch between drivers, you may use the following script, run as root (say yes to all confirmations):<br />
<br />
{{bc|1=<nowiki><br />
#!/bin/bash<br />
BRANCH=340xx<br />
#BRANCH=304xx<br />
<br />
NVIDIA="nvidia-$BRANCH"<br />
_NVIDIA="$(pacman -Qqs ^${NVIDIA}$)"<br />
NOUVEAU="xf86-video-nouveau mesa-libgl"<br />
_NOUVEAU="$(pacman -Qqs ^mesa-libgl$)"<br />
<br />
if [[ ! $_NVIDIA ]]; then<br />
pacman -Rdds "$NOUVEAU"<br />
pacman -S "$NVIDIA" #lib32-$NVIDIA-libgl #$NVIDIA-lts<br />
elif [[ ! $_NOUVEAU ]]; then<br />
pacman -Rdds "$_NVIDIA"<br />
pacman -S "$NOUVEAU" #lib32-mesa-libgl<br />
fi<br />
</nowiki>}}<br />
<br />
Uncomment the lib32 packages if you run a 64-bit system and require the 32-bit libraries (e.g. 32-bit games/Steam).<br />
<br />
=== Avoid tearing with GeForce 600/700 series cards === <br />
<br />
Adding the following line to the {{ic|"Screen"}} section of your X11 configuration file, for example {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, will eliminate tearing entirely, regardless of the compositor you are using. It has been reported to reduce the performance of some OpenGL applications, though.<br />
<br />
Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Gaming using TwinView ===<br />
<br />
In case you want to play fullscreen games when using TwinView, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropriate Metamodes to your xorg.conf in section {{ic|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
=== Vertical sync using TwinView ===<br />
<br />
If you're using TwinView and vertical sync (the "Sync to VBlank" option in '''nvidia-settings'''), you will notice that only one screen is being properly synced, unless you have two identical monitors. Although '''nvidia-settings''' does offer an option to change which screen is being synced (the "Sync to this display device" option), this does not always work. A solution is to add the following environment variables at startup, for example append in {{ic|/etc/profile}}:<br />
<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_SYNC_DISPLAY_DEVICE=DFP-0<br />
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DFP-0<br />
<br />
You can change {{ic|DFP-0}} with your preferred screen ({{ic|DFP-0}} is the DVI port and {{ic|CRT-0}} is the VGA port). You can find the identifier for your display from '''nvidia-settings''' in the "X Server XVideoSettings" section.<br />
<br />
=== Old Xorg settings ===<br />
<br />
If upgrading from an old installation, please remove old {{ic|/usr/X11R6/}} paths as it can cause trouble during installation.<br />
<br />
=== Corrupted screen: "Six screens" Problem ===<br />
<br />
For some users, using GeForce GT 100M's, the screen gets corrupted after X starts, divided into 6 sections with a resolution limited to 640x480.<br />
The same problem has been recently reported with Quadro 2000 and hi-res displays.<br />
<br />
To solve this problem, enable the Validation Mode {{ic|NoTotalSizeCheck}} in section {{ic|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
=== '/dev/nvidia0' input/output error ===<br />
<br />
{{Accuracy|Verify that the BIOS related suggestions work and are not coincidentally set while troubleshooting.|section='/dev/nvidia0' Input/Output error... suggested fixes}}<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the problem. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with {{ic|lspci -v}}) and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
If running a 64bit kernel, a driver defect can cause the NVIDIA module to fail initializing when IOMMU is on. Turning it off in the BIOS has been confirmed to work for some users. [http://www.nvnews.net/vbulletin/showthread.php?s=68bb2fabadcb53b10b286aa42d13c5bc&t=159335][[User:Clickthem#nvidia module]]<br />
<br />
Another thing to try is to change your BIOS IRQ routing from {{ic|Operating system controlled}} to {{ic|BIOS controlled}} or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The {{ic|noacpi}} kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
=== '/dev/nvidiactl' errors ===<br />
<br />
Trying to start an OpenGL application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropriate user to the {{ic|video}} group and log in again:<br />
# gpasswd -a username video<br />
<br />
=== 32-bit applications do not start ===<br />
<br />
Under 64-bit systems, installing {{ic|lib32-nvidia-libgl}} that corresponds to the same version installed for the 64-bit driver fixes the problem.<br />
<br />
=== Errors after updating the kernel ===<br />
<br />
If a custom build of NVIDIA's module is used instead of the package from the ''extra'' repository, a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
=== Crashing in general ===<br />
<br />
* Try disabling {{ic|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{ic|nopat}} at the end of the {{ic|kernel}} line in {{ic|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{ic|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{ic|nopat}} to [[kernel parameters]].<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
=== Bad performance after installing a new driver version ===<br />
<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on (glxinfo is included in {{Pkg|mesa-demos}}):<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
=== CPU spikes with 400 series cards ===<br />
<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the {{ic|Device}} section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
=== Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace ===<br />
<br />
If, while using the legacy NVIDIA drivers, Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via {{ic|Ctrl+Alt+Backspace}} (or whatever the new "kill X" key binding is), try adding this in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{ic|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's README: Appendix K] for more information.<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [[http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html]] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
==== Possible Workaround ====<br />
<br />
Enter the BIOS and changed the default graphics setting from 'Optimus' to 'Discrete' and the install NVIDIA drivers (295.20-1 at time of writing) recognized the screens.<br />
<br />
Steps:<br />
# Enter BIOS.<br />
# Find Graphics Settings (should be in tab ''Config > Display'').<br />
# Change 'Graphics Device' to 'Discrete Graphics' (Disables Intel integrated graphics).<br />
# Change OS Detection for Nvidia Optimus to "Disabled".<br />
# Save and exit.<br />
<br />
Tested on a Lenovo W520 with a Quadro 1000M and Nvidia Optimus<br />
<br />
=== Screen(s) found, but none have a usable configuration ===<br />
<br />
On a laptop, sometimes NVIDIA driver cannot find the active screen.<br />
It may be caused because you own a graphic card with vga/tv outs.<br />
You should examine Xorg.0.log to see what is wrong.<br />
<br />
Another thing to try is adding invalid {{ic|"ConnectedMonitor" Option}} to {{ic|Section "Device"}}<br />
to force Xorg throws error and shows you how correct it.<br />
[http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html Here]<br />
more about ConnectedMonitor setting.<br />
<br />
After re-run X see Xorg.0.log to get valid CRT-x,DFP-x,TV-x values.<br />
<br />
{{ic|nvidia-xconfig --query-gpu-info}} could be helpful.<br />
<br />
=== Blackscreen at X startup with new driver ===<br />
<br />
If you have installed an update of Nvidia and you screen stay black after launching Xorg. You have to use the {{ic|<nowiki>rcutree.rcu_idle_gp_delay=1</nowiki>}} [[kernel parameter]].<br />
<br />
You can also try to add the {{ic|nvidia}} module directly to your [[mkinitcpio]] config file.<br />
<br />
=== No brightness control on laptops ===<br />
<br />
Try to add the following line in {{ic|20-nvidia.conf}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
if the Xorg can't start an tested {{ic|20-nvidia.conf}} is:<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
}}<br />
<br />
<br />
<br />
If it is still not working, you can try installing {{AUR|nvidia-bl}} or {{AUR|nvidiabl}}.<br />
<br />
=== Backlight is not turning off in some occasions ===<br />
<br />
By default, DPMS should turn off backlight with the timeouts set or by running xset. However, probably due to a bug in the proprietary Nvidia drivers the result is a blank screen with no powersaving whatsoever. To workaround it, until the bug has been fixed you can use the {{ic|vbetool}} as root.<br />
<br />
Install the {{Pkg|vbetool}} package.<br />
<br />
Turn off your screen on demand and then by pressing a random key backlight turns on again:<br />
<br />
vbetool dpms off && read -n1; vbetool dpms on<br />
<br />
Alternatively, xrandr is able to disable and re-enable monitor outputs without requiring root.<br />
<br />
xrandr --output DP-1 --off; read -n1; xrandr --output DP-1 --auto<br />
<br />
=== Blue tint on videos with Flash ===<br />
<br />
A problem with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
# Install the latest {{Pkg|libvdpau}}.<br />
# Patch {{ic|vdpau_trace.so}} with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
# Right click on a video, select "Settings..." and uncheck "Enable hardware acceleration". Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
# [[Downgrading packages|Downgrade]] the {{Pkg|flashplugin}} package to version 11.1.102.63-1 at most.<br />
# Use {{AUR|google-chrome}} with the new Pepper API {{AUR|chromium-pepper-flash}}.<br />
# Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread].<br />
<br />
=== Bleeding overlay with Flash ===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this problem simply install the latest {{Pkg|libvdpau}} or export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}<br />
<br />
=== Full system freeze using Flash ===<br />
<br />
If you experience occasional full system freezes (only the mouse is moving) using flashplugin<br />
and get:<br />
<br />
{{hc|/var/log/errors.log|<br />
NVRM: Xid (0000:01:00): 31, Ch 00000007, engmask 00000120, intr 10000000<br />
}}<br />
<br />
A possible workaround is to switch off Hardware Acceleration in Flash, setting<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
Or, if you want to keep Hardware acceleration enabled, you may try to::<br />
export VDPAU_NVIDIA_NO_OVERLAY=1<br />
<br />
...before starting the browser.<br />
Note that this may introduce tearing.<br />
<br />
=== Xorg fails to load or Red Screen of Death ===<br />
<br />
If you get a red screen and use GRUB disable the GRUB framebuffer by editing {{ic|/etc/default/grub}} and uncomment GRUB_TERMINAL_OUTPUT. For more information see [[GRUB#Disable_framebuffer|GRUB]].<br />
<br />
=== Black screen on systems with Intel integrated GPU ===<br />
<br />
If you have an Intel CPU with an integrated GPU (e.g. Intel HD 4000) and have installed the {{Pkg|nvidia}} package, you may experience a black screen on boot, when changing virtual terminal, or when exiting an X session. This may be caused by a conflict between the graphics modules. This is solved by blacklisting the Intel GPU modules. Create the file {{ic|/etc/modprobe.d/blacklist.conf}} and prevent the ''i915'' and ''intel_agp'' modules from loading on boot:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install i915 /usr/bin/false<br />
install intel_agp /usr/bin/false<br />
}}<br />
<br />
=== Black screen on systems with VIA integrated GPU ===<br />
<br />
As above, blacklisting the ''viafb'' module may resolve conflicts with NVIDIA drivers:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install viafb /usr/bin/false<br />
}}<br />
<br />
=== X fails with "no screens found" with Intel iGPU ===<br />
<br />
Like above, if you have an Intel CPU with an integrated GPU and X fails to start with <br />
<br />
[ 76.633] (EE) No devices detected.<br />
[ 76.633] Fatal server error:<br />
[ 76.633] no screens found<br />
<br />
then you need to add your discrete card's BusID to your X configuration. Find it:<br />
<br />
{{hc|<nowiki># lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)<br />
}}<br />
<br />
then you fix it by adding it to the card's Device section in your X configuration. In my case:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
Note how {{ic|01:00.0}} is written as {{ic|1:0:0}}.<br />
<br />
=== Xorg fails during boot, but otherwise starts fine ===<br />
<br />
On very fast booting systems, systemd may attempt to start the display manager before the NVIDIA driver has fully initialized. You will see a message like the following in your logs only when Xorg runs during boot.<br />
{{hc|/var/log/Xorg.0.log|output=<br />
[ 1.807] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the<br />
[ 1.807] (EE) NVIDIA(0): system's kernel log for additional error messages and<br />
[ 1.808] (EE) NVIDIA(0): consult the NVIDIA README for details.<br />
[ 1.808] (EE) NVIDIA(0): *** Aborting ***<br />
}}<br />
In this case you will need to establish an ordering dependency from the display manager to the DRI device. First create device units for DRI devices by creating a new udev rules file.<br />
{{hc|/etc/udev/rules.d/99-systemd-dri-devices.rules|output=<br />
ACTION=="add", KERNEL=="card*", SUBSYSTEM=="drm", TAG+="systemd"<br />
}}<br />
Then create dependencies from the display manager to the device(s).<br />
{{hc|/etc/systemd/system/display-manager.service.d/10-wait-for-dri-devices.conf|output=<br />
[Unit]<br />
Wants=dev-dri-card0.device<br />
After=dev-dri-card0.device<br />
}}<br />
If you have additional cards needed for the desktop then list them in Wants and After seperated by spaces.<br />
<br />
=== Flash video players crashes ===<br />
<br />
If you are getting frequent crashes of Flash video players, try to switch off Hardware Acceleration:<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
(This problem appeared after installing the proprietary nvidia driver, and was fixed by changing this setting.)<br />
<br />
== See also ==<br />
<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=343898NVIDIA2014-11-08T16:38:31Z<p>Yafengabc: /* No brightness control on laptops */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
[[zh-CN:NVIDIA]]<br />
{{Related articles start}}<br />
{{Related|Nouveau}}<br />
{{Related|Bumblebee}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]]. See instead [[NVIDIA Optimus]] if you have a laptop based on such technology.<br />
<br />
== Installing ==<br />
<br />
These instructions are for those using the stock {{Pkg|linux}} or {{Pkg|linux-lts}} packages. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
{{Warning| Mixing driver versions does NOT work. You can't use the current branch and the 32-Bit libGL package of the legacy branches or any combination.}}<br />
<br />
1. If you do not know what graphics card you have, find out by issuing:<br />
:{{bc|<nowiki>$ lspci -k | grep -A 2 -i "VGA"</nowiki>}}<br />
<br />
2. Determine the necessary driver version for your card by visiting NVIDIA's [http://www.nvidia.com/Download/index.aspx driver download site], looking up the name in NVIDIA's [http://www.nvidia.com/object/IO_32667.html legacy card list], or finding the code name on [http://nouveau.freedesktop.org/wiki/CodeNames nouveau wiki's code names page].<br />
<br />
3. Install the appropriate driver for your card:<br />
:* For GeForce 400 series cards and newer [NVCx and newer], install the {{Pkg|nvidia}} or {{Pkg|nvidia-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 8000/9000 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx] from around 2006-2010, install the {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-340xx-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 6000/7000 series cards [NV4x and NV6x] from around 2004-2006, install the {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} package, available in the [[official repositories]].<br />
<br />
:* For even older cards, have a look at [[#Unsupported drivers]].<br />
:* For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[Arch User Repository]], since the stable drivers may not support the newly introduced features.<br />
<br />
:If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent ''lib32'' package from the [[multilib]] repository (e.g. {{Pkg|lib32-nvidia-libgl}}, {{Pkg|lib32-nvidia-340xx-libgl}} or {{Pkg|lib32-nvidia-304xx-libgl}}).<br />
<br />
4. Reboot. The {{Pkg|nvidia}} package contains a file which blacklists the ''nouveau'' module, so rebooting is necessary.<br />
<br />
Once the driver has been installed, continue to [[#Configuring]].<br />
<br />
=== Unsupported drivers ===<br />
<br />
If you have a GeForce 5 FX series card or older, Nvidia no longer supports drivers for you card. This means that these drivers [http://nvidia.custhelp.com/app/answers/detail/a_id/3142/ do not support the current Xorg version]. It thus might be easier if you use the [[nouveau]] driver, which supports the old cards with the current Xorg.<br />
<br />
However, Nvidia's drivers might provide better 3D performance/stability. If you want to use them, you can install them (together with an old Xorg version) from the [[Arch User Repository]]:<br />
<br />
* For GeForce 5 FX series cards [NV30-NV36], install the {{AUR|nvidia-173xx}} package. Last supported Xorg version is 1.15.<br />
* For GeForce 2/3/4 MX/Ti series cards [NV11, NV17-NV28], install the {{AUR|nvidia-96xx}} package. Last supported Xorg version is 1.12.<br />
<br />
{{Tip|The legacy nvidia-96xx and nvidia-173xx drivers can also be installed from the unofficial [http://pkgbuild.com/~bgyorgy/city.html <nowiki>[city] repository</nowiki>]. (It's strongly advised that you don't skip any dependencies restriction when installing from here)}}<br />
<br />
=== Alternate install: custom kernel ===<br />
<br />
First of all, it's good to know how the ABS works by reading some of the other articles about it:<br />
<br />
* Main article for [[Arch Build System|ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating packages]]<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
[[Pacman|Install]] {{Pkg|abs}} from the [[official repositories]] and generate the tree with:<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/abs<br />
Make a copy of the {{ic|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/abs/<br />
Go into the temporary {{ic|nvidia}} build directory:<br />
$ cd ~/abs/nvidia<br />
It is required to edit the files {{ic|nvidia.install}} and {{ic|PKGBUILD}} so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are multiple kernels installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nouveau module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{ic|-c}} operand tells makepkg to clean left over files after building the package, whereas {{ic|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
=== Automatic re-compilation of the NVIDIA module with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|nvidia-hook}} from the [[AUR]]. You will need to install the module sources: {{AUR|nvidia-dkms}}. In '''nvidia-hook''', the 'automatic re-compilation' functionality is done by a '''nvidia hook''' on [[mkinitcpio]] after forcing to update the '''linux-headers''' package. You will need to add 'nvidia' to the HOOKS array in /etc/mkinitcpio.conf.<br />
<br />
The hook will call the '''dkms''' command to update the NVIDIA module for the version of your new kernel.<br />
<br />
{{Note|<br />
* If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. nvidia hook will tell you if anything goes wrong.<br />
* If you would like to do this manually please see this section [[Dynamic Kernel Module Support#Usage| in the dkms arch wiki.]]<br />
}}<br />
<br />
== Configuring ==<br />
<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a configuration file (prefer {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} over {{ic|/etc/X11/xorg.conf}}) in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a number of settings that can bypass Xorg's auto-discovered or pre-configured options.<br />
{{Note|Since 1.8.x Xorg uses separate configuration files in {{ic|/etc/X11/xorg.conf.d/}} - check out [[NVIDIA#Advanced: 20-nvidia.conf|advanced configuration]] section.}}<br />
<br />
=== Minimal configuration ===<br />
<br />
A basic configuration block in {{ic|20-nvidia.conf}} (or deprecated in {{ic|xorg.conf}}) would look like this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Nvidia Card"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "NoLogo" "true"<br />
#Option "UseEDID" "false"<br />
#Option "ConnectedMonitor" "DFP"<br />
# ...<br />
EndSection<br />
}}<br />
<br />
{{Tip|If upgrading from nouveau make sure to remove "{{ic|nouveau}}" from {{ic|/etc/mkinitcpio.conf}}. See [[NVIDIA#Switching between NVIDIA and nouveau drivers|Switching between NVIDIA and nouveau drivers]], if switching between the open and proprietary drivers often.}}<br />
<br />
=== Automatic configuration ===<br />
<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{ic|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{ic|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{ic|/etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning|That may still not work properly with Xorg-server 1.8 }}<br />
<br />
=== Multiple monitors ===<br />
<br />
:''See [[Multihead]] for more general information''<br />
{{Warning|1=As of August 2013, Xinerama is broken when using the proprietary NVIDIA driver from 319 upwards. Users wishing to use Xinerama with the NVIDIA driver should use the NVIDIA 313 driver, which works only with Linux kernels earlier than 3.10. See [https://bbs.archlinux.org/viewtopic.php?id=163319 this thread] for more information.}}<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
TwinView only works on a per card basis: If you have multiple cards, you'll have to use xinerama or zaphod mode (multiple X screens). You can combine TwinView with zaphod mode, ending up, for example, with two X screens covering two monitors each. Most window managers fail miserably in zaphod mode. Awesome is the shining exception, and KDE almost works.<br />
<br />
Example configuration:<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "TwinLayout"<br />
Screen 0 "metaScreen" 0 0<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
<br />
#refer to the link below for more information on each of the following options.<br />
Option "HorizSync" "DFP-0: 28-33; DFP-1 28-33"<br />
Option "VertRefresh" "DFP-0: 43-73; DFP-1 43-73"<br />
Option "MetaModes" "1920x1080, 1920x1080"<br />
Option "ConnectedMonitor" "DFP-0, DFP-1"<br />
Option "MetaModeOrientation" "DFP-1 LeftOf DFP-0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "metaScreen"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "True"<br />
SubSection "Display"<br />
Modes "1920x1080"<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
[http://us.download.nvidia.com/XFree86/Linux-x86/304.51/README/configtwinview.html Device option information].<br />
<br />
If you have multiple cards that are SLI capable, it is possible to run more than one monitor attached to separate cards (for example: two cards in SLI with one monitor attached to each). The "MetaModes" option in conjunction with SLI Mosaic mode enables this. Below is a configuration which works for the aforementioned example and runs [[GNOME]] flawlessly.<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Device"<br />
Identifier "Card A"<br />
Driver "nvidia"<br />
BusID "PCI:1:00:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card B"<br />
Driver "nvidia"<br />
BusID "PCI:2:00:0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Right Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Left Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Right Screen"<br />
Device "Card A"<br />
Monitor "Right Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Left Screen"<br />
Device "Card B"<br />
Monitor "Left Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default"<br />
Screen 0 "Right Screen" 0 0<br />
Option "Xinerama" "0"<br />
EndSection}}<br />
<br />
===== Manual CLI configuration with xrandr =====<br />
<br />
If the latest solutions don't work for you, you can use your window manager's ''autostart'' implementation with {{Pkg|xorg-xrandr}}.<br />
<br />
Some {{ic|xrandr}} examples could be:<br />
<br />
xrandr --output DVI-I-0 --auto --primary --left-of DVI-I-1<br />
<br />
or:<br />
<br />
xrandr --output DVI-I-1 --pos 1440x0 --mode 1440x900 --rate 75.0<br />
<br />
When:<br />
<br />
* {{ic|--output}} is used to indicate the "monitor" to which the options are set.<br />
* {{ic|DVI-I-1}} is the name of the second monitor.<br />
* {{ic|--pos}} is the position of the second monitor relative to the first.<br />
* {{ic|--mode}} is the resolution of the second monitor.<br />
* {{ic|--rate}} is the refresh rate (in Hz).<br />
<br />
You can find the proper options by running {{ic|xrandr}} without any arguments.<br />
<br />
==== Using NVIDIA Settings ====<br />
<br />
You can also use the {{ic|nvidia-settings}} tool provided by {{Pkg|nvidia-utils}}. With this method, you will use the proprietary software NVIDIA provides with their drivers. Simply run {{ic|nvidia-settings}} as root, then configure as you wish, and then save the configuration to {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
==== ConnectedMonitor ====<br />
<br />
If the driver doesn't properly detect a second monitor, you can force it to do so with ConnectedMonitor. <br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
VendorName "Panasonic"<br />
ModelName "Panasonic MICRON 2100Ex"<br />
HorizSync 30.0 - 121.0 # this monitor has incorrect EDID, hence Option "UseEDIDFreqs" "false"<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor2"<br />
VendorName "Gateway"<br />
ModelName "GatewayVX1120"<br />
HorizSync 30.0 - 121.0<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device2"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 1<br />
EndSection<br />
<br />
}}<br />
<br />
The duplicated device with {{ic|Screen}} is how you get X to use two monitors on one card without {{ic|TwinView}}. Note that {{ic|nvidia-settings}} will strip out any {{ic|ConnectedMonitor}} options you have added.<br />
<br />
==== Mosaic mode ====<br />
<br />
Mosaic mode is the only way to use more than 2 monitors across multiple graphics cards with compositing. Your window manager may or may not recognize the distinction between each monitor.<br />
<br />
===== Base mosaic =====<br />
<br />
Base mosaic mode works on any set of Geforce 8000 series or higher GPUs. It cannot be enabled from withing the nvidia-setting GUI. You must either use the nvidia-xconfig command line program or edit xorg.conf by hand. Metamodes must be specified. The following is an example for four DFPs in a 2x2 configuration, each running at 1920x1024, with two DFPs connected to two cards:<br />
$ nvidia-xconfig --base-mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
{{Note|While the documentation lists a 2x2 configuration of monitors, Nvidia has reduced that ability to just 3 monitors in base mosaic mode as of driver version 304. More monitors are available with a Quadro card, but with standard consumer cards, it is limited to three. The explanation given for this reduction is "Feature parity with the Windows driver". As of 9/14/2014, Windows has no restriction on the number of monitors, even on the same driver version. This is not a bug, this is entirely by design.}}<br />
<br />
===== SLI Mosaic =====<br />
<br />
If you have an SLI configuration and each GPU is a Quadro FX 5800, Quadro Fermi or newer then you can use SLI Mosaic mode. It can be enabled from within the nvidia-settings GUI or from the command line with:<br />
$ nvidia-xconfig --sli=Mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
== Tweaking ==<br />
<br />
=== GUI: nvidia-settings ===<br />
<br />
The NVIDIA package includes the {{ic|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
The desktop environment's auto-startup method 'may' not work for loading nvidia-settings properly (KDE). To be sure that settings are really loaded put the command in ~/.xinitrc file (create if not present).<br />
<br />
{{Tip|On rare occasions the {{ic|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the problem.}}<br />
<br />
=== Advanced: 20-nvidia.conf ===<br />
<br />
Edit {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and add the option to the correct section. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/ NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.<br />
<br />
==== Disabling the logo on startup ====<br />
<br />
Add the {{ic|"NoLogo"}} option under section {{ic|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
==== Overriding monitor detection ====<br />
<br />
The {{ic|"ConnectedMonitor"}} option under section {{ic|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{ic|"CRT"}} for analog connections, {{ic|"DFP"}} for digital monitors and {{ic|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
==== Enabling brightness control ====<br />
<br />
Add under section {{ic|Device}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
{{Note|If you already have this enabled<br />
and your brightness control doesn't work try to comment it out.}}<br />
<br />
==== Enabling SLI ====<br />
<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A "supported configuration" is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{ic|lspci}}:<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
}}<br />
<br />
Add the BusID (3 in the previous example) under section {{ic|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{ic|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{ic|Screen}}:<br />
Option "SLI" "AA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| class="wikitable"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| AA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
Alternatively, you can use the {{ic|nvidia-xconfig}} utility to insert these changes into {{ic|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=AA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
{{hc|<nowiki>$ nvidia-settings -q all | grep SLIMode</nowiki>|<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
}}<br />
<br />
{{Warning| After enabling SLI, your system may become frozen/non-responsive upon starting xorg. It is advisable that you disable your display manager before restarting.}}<br />
<br />
==== Enabling overclocking ====<br />
<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{ic|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
{{Note|GeForce 400/500/600/700 series Fermi/Kepler cores CAN now, as of version 337.12, be overclocked! Now {{ic|Option "Coolbits" "8"}} needs to be set within the device section of the X configuration file to enable the new overclocking support. If you also want to enable manual GPU fan controls, you need to set {{ic|Option "Coolbits" "12"}}.}}<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|An alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]{{Dead link|2013|05|25}} and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]{{Dead link|2013|05|25}}. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits. [http://ivanvojtko.blogspot.sk/2014/03/how-to-overclock-geforce-460gtx-fermi.html Fermi BIOS modification tutorial]}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
<br />
Set the following string in the {{ic|Device}} section to enable PowerMizer at its maximum performance level (VSync won't work without this line):<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{ic|Device}} section to enable manual GPU fan control within {{ic|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Fixing terminal resolution ===<br />
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.<br />
<br />
==== GRUB ====<br />
If you are using GRUB, a possible solution is to edit the {{ic|GRUB_GFXMODE}} line of {{ic|/etc/default/grub}} with desired display resolutions. Multiple resolutions can be specified, including the default {{ic|auto}}, so it is recommended that you edit the line to resemble {{ic|1=GRUB_GFXMODE=<desired resolution>,<fallback such as 1024x768>,auto}}. For more information, refer to [https://www.gnu.org/software/grub/manual/html_node/gfxmode.html#gfxmode the GRUB gfxmode documentation].<br />
<br />
=== Enabling Pure Video HD (VDPAU/VAAPI) ===<br />
<br />
{{Merge|VDPAU|Keep here only the specifics and merge the general information into the main article.}}<br />
<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/Nvidia_PureVideo#Table_of_PureVideo_.28HD.29_GPUs].<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with {{Pkg|libva-vdpau-driver}}.<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware.}}<br />
<br />
To enable hardware acceleration in [[VLC media player|VLC]] go:<br />
<br />
{{ic|Tools > Preferences > Input & Codecs}}, then select {{ic|VDPAU}} as {{ic|'''Hardware-accelerated decoding'''}}<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
{{ic|Options > Preferences > General > Video Tab}}, then select {{ic|vdpau}} as {{ic|'''output driver'''}}<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
{{ic|Edit > Preference}}, then set {{ic|'''video output'''}} to {{ic|vdpau}}<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>512MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{ic|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
=== Avoid screen tearing in KDE (KWin) ===<br />
<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export __GL_YIELD="USLEEP"<br />
</nowiki>}}<br />
<br />
Also if the above doesn't help, then try this:<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export KWIN_TRIPLE_BUFFER=1<br />
</nowiki>}}<br />
<br />
Do not have both of the above enabled at the same time.<br />
Also if you enable triple buffering make sure to enable TripleBuffering for the driver itself.<br />
Source: https://bugs.kde.org/show_bug.cgi?id=322060<br />
<br />
=== Hardware accelerated video decoding with XvMC ===<br />
<br />
Accelerated decoding of MPEG-1 and MPEG-2 videos via [[XvMC]] are supported on GeForce4, GeForce 5 FX, GeForce 6 and GeForce 7 series cards. To use it, create a new file {{ic|/etc/X11/XvMCConfig}} with the following content:<br />
libXvMCNVIDIA_dynamic.so.1<br />
<br />
See how to configure [[XvMC#Supported software|supported software]].<br />
<br />
=== Using TV-out ===<br />
<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here].<br />
<br />
=== X with a TV (DFP) as the only display ===<br />
<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the {{ic|DFP}} section (again, {{ic|DFP-0}} or similar), click on the {{ic|Acquire Edid}} Button and store it somewhere, for example, {{ic|/etc/X11/dfp0.edid}}.<br />
<br />
Edit {{ic|xorg.conf}} by adding to the {{ic|Device}} section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The {{ic|ConnectedMonitor}} option forces the driver to recognize the DFP as if it were connected. The {{ic|CustomEDID}} provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
=== Check the power source ===<br />
<br />
The NVIDIA X.org driver can also be used to detect the GPU's current source of power. To see the current power source, check the 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
{{hc|$ nvidia-settings -q GPUPowerSource -t|1}}<br />
<br />
If you're seeing an error message similiar to the one below, then you either need to install [[acpid]] or start the systemd service via {{ic|systemctl start acpid.service}}<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
(If you are not seeing this error, it is not necessary to install/run acpid soley for this purpose. My current power source is correctly reported without acpid even installed.)<br />
<br />
=== Displaying GPU temperature in the shell ===<br />
<br />
==== Method 1 - nvidia-settings ====<br />
<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use {{ic|nvidia-settings}} as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as {{ic|rrdtool}} or {{ic|conky}}, among others:<br />
{{hc|$ nvidia-settings -q gpucoretemp -t|41}}<br />
<br />
==== Method 2 - nvidia-smi ====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temperature in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi<br />
<br />
This should output something similar to the following:<br />
{{hc|$ nvidia-smi|<nowiki><br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki><br />
}}<br />
<br />
Only for temperature:<br />
{{hc|$ nvidia-smi -q -d TEMPERATURE|<nowiki><br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki><br />
}}<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
{{hc|<nowiki>$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36</nowiki>|62}}<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli.<br />
<br />
==== Method 3 - nvclock ====<br />
<br />
Use {{AUR|nvclock}} which is available from the [[AUR]].<br />
{{Note|{{ic|nvclock}} cannot access thermal sensors on newer NVIDIA cards such as Geforce 200 series cards.}}<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
=== Set fan speed at login ===<br />
<br />
You can adjust the fan speed on your graphics card with ''nvidia-settings''' console interface. First ensure that your Xorg configuration sets the Coolbits option to {{ic|4}}, {{ic|5}} or {{ic|12}} for fermi and above in your {{ic|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GeForce 400/500 series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{ic|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace {{ic|''n''}} with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=''n''" \<br />
-a [fan:1]/GPUCurrentFanSpeed=''n''" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{ic|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change {{ic|''n''}} to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
=== Order of install/deinstall for changing drivers ===<br />
<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-libglN<br />
install nvidiaN<br />
install lib32-nvidia-libgl-N (if required)<br />
<br />
=== Switching between NVIDIA and nouveau drivers ===<br />
<br />
{{Warning|The {{ic|-Rdds}} switch is used as the installation otherwise fails due to unstatisfied dependencies.}}<br />
<br />
If you need to switch between drivers, you may use the following script, run as root (say yes to all confirmations):<br />
<br />
{{bc|1=<nowiki><br />
#!/bin/bash<br />
BRANCH=340xx<br />
#BRANCH=304xx<br />
<br />
NVIDIA="nvidia-$BRANCH"<br />
_NVIDIA="$(pacman -Qqs ^${NVIDIA}$)"<br />
NOUVEAU="xf86-video-nouveau mesa-libgl"<br />
_NOUVEAU="$(pacman -Qqs ^mesa-libgl$)"<br />
<br />
if [[ ! $_NVIDIA ]]; then<br />
pacman -Rdds "$NOUVEAU"<br />
pacman -S "$NVIDIA" #lib32-$NVIDIA-libgl #$NVIDIA-lts<br />
elif [[ ! $_NOUVEAU ]]; then<br />
pacman -Rdds "$_NVIDIA"<br />
pacman -S "$NOUVEAU" #lib32-mesa-libgl<br />
fi<br />
</nowiki>}}<br />
<br />
Uncomment the lib32 packages if you run a 64-bit system and require the 32-bit libraries (e.g. 32-bit games/Steam).<br />
<br />
=== Avoid tearing with GeForce 600/700 series cards === <br />
<br />
Adding the following line to the {{ic|"Screen"}} section of your X11 configuration file, for example {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, will eliminate tearing entirely, regardless of the compositor you are using. It has been reported to reduce the performance of some OpenGL applications, though.<br />
<br />
Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Gaming using TwinView ===<br />
<br />
In case you want to play fullscreen games when using TwinView, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropriate Metamodes to your xorg.conf in section {{ic|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
=== Vertical sync using TwinView ===<br />
<br />
If you're using TwinView and vertical sync (the "Sync to VBlank" option in '''nvidia-settings'''), you will notice that only one screen is being properly synced, unless you have two identical monitors. Although '''nvidia-settings''' does offer an option to change which screen is being synced (the "Sync to this display device" option), this does not always work. A solution is to add the following environment variables at startup, for example append in {{ic|/etc/profile}}:<br />
<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_SYNC_DISPLAY_DEVICE=DFP-0<br />
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DFP-0<br />
<br />
You can change {{ic|DFP-0}} with your preferred screen ({{ic|DFP-0}} is the DVI port and {{ic|CRT-0}} is the VGA port). You can find the identifier for your display from '''nvidia-settings''' in the "X Server XVideoSettings" section.<br />
<br />
=== Old Xorg settings ===<br />
<br />
If upgrading from an old installation, please remove old {{ic|/usr/X11R6/}} paths as it can cause trouble during installation.<br />
<br />
=== Corrupted screen: "Six screens" Problem ===<br />
<br />
For some users, using GeForce GT 100M's, the screen gets corrupted after X starts, divided into 6 sections with a resolution limited to 640x480.<br />
The same problem has been recently reported with Quadro 2000 and hi-res displays.<br />
<br />
To solve this problem, enable the Validation Mode {{ic|NoTotalSizeCheck}} in section {{ic|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
=== '/dev/nvidia0' input/output error ===<br />
<br />
{{Accuracy|Verify that the BIOS related suggestions work and are not coincidentally set while troubleshooting.|section='/dev/nvidia0' Input/Output error... suggested fixes}}<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the problem. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with {{ic|lspci -v}}) and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
If running a 64bit kernel, a driver defect can cause the NVIDIA module to fail initializing when IOMMU is on. Turning it off in the BIOS has been confirmed to work for some users. [http://www.nvnews.net/vbulletin/showthread.php?s=68bb2fabadcb53b10b286aa42d13c5bc&t=159335][[User:Clickthem#nvidia module]]<br />
<br />
Another thing to try is to change your BIOS IRQ routing from {{ic|Operating system controlled}} to {{ic|BIOS controlled}} or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The {{ic|noacpi}} kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
=== '/dev/nvidiactl' errors ===<br />
<br />
Trying to start an OpenGL application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropriate user to the {{ic|video}} group and log in again:<br />
# gpasswd -a username video<br />
<br />
=== 32-bit applications do not start ===<br />
<br />
Under 64-bit systems, installing {{ic|lib32-nvidia-libgl}} that corresponds to the same version installed for the 64-bit driver fixes the problem.<br />
<br />
=== Errors after updating the kernel ===<br />
<br />
If a custom build of NVIDIA's module is used instead of the package from the ''extra'' repository, a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
=== Crashing in general ===<br />
<br />
* Try disabling {{ic|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{ic|nopat}} at the end of the {{ic|kernel}} line in {{ic|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{ic|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{ic|nopat}} to [[kernel parameters]].<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
=== Bad performance after installing a new driver version ===<br />
<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on (glxinfo is included in {{Pkg|mesa-demos}}):<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
=== CPU spikes with 400 series cards ===<br />
<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the {{ic|Device}} section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
=== Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace ===<br />
<br />
If, while using the legacy NVIDIA drivers, Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via {{ic|Ctrl+Alt+Backspace}} (or whatever the new "kill X" key binding is), try adding this in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{ic|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's README: Appendix K] for more information.<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [[http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html]] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
==== Possible Workaround ====<br />
<br />
Enter the BIOS and changed the default graphics setting from 'Optimus' to 'Discrete' and the install NVIDIA drivers (295.20-1 at time of writing) recognized the screens.<br />
<br />
Steps:<br />
# Enter BIOS.<br />
# Find Graphics Settings (should be in tab ''Config > Display'').<br />
# Change 'Graphics Device' to 'Discrete Graphics' (Disables Intel integrated graphics).<br />
# Change OS Detection for Nvidia Optimus to "Disabled".<br />
# Save and exit.<br />
<br />
Tested on a Lenovo W520 with a Quadro 1000M and Nvidia Optimus<br />
<br />
=== Screen(s) found, but none have a usable configuration ===<br />
<br />
On a laptop, sometimes NVIDIA driver cannot find the active screen.<br />
It may be caused because you own a graphic card with vga/tv outs.<br />
You should examine Xorg.0.log to see what is wrong.<br />
<br />
Another thing to try is adding invalid {{ic|"ConnectedMonitor" Option}} to {{ic|Section "Device"}}<br />
to force Xorg throws error and shows you how correct it.<br />
[http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html Here]<br />
more about ConnectedMonitor setting.<br />
<br />
After re-run X see Xorg.0.log to get valid CRT-x,DFP-x,TV-x values.<br />
<br />
{{ic|nvidia-xconfig --query-gpu-info}} could be helpful.<br />
<br />
=== Blackscreen at X startup with new driver ===<br />
<br />
If you have installed an update of Nvidia and you screen stay black after launching Xorg. You have to use the {{ic|<nowiki>rcutree.rcu_idle_gp_delay=1</nowiki>}} [[kernel parameter]].<br />
<br />
You can also try to add the {{ic|nvidia}} module directly to your [[mkinitcpio]] config file.<br />
<br />
=== No brightness control on laptops ===<br />
<br />
Try to add the following line in {{ic|20-nvidia.conf}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
if the Xorg can't start an tested {{ic|20-nvidia.conf}} is:<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
#BoardName "Quadro NVS 3100M"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
}}<br />
<br />
<br />
<br />
If it is still not working, you can try installing {{AUR|nvidia-bl}} or {{AUR|nvidiabl}}.<br />
<br />
=== Backlight is not turning off in some occasions ===<br />
<br />
By default, DPMS should turn off backlight with the timeouts set or by running xset. However, probably due to a bug in the proprietary Nvidia drivers the result is a blank screen with no powersaving whatsoever. To workaround it, until the bug has been fixed you can use the {{ic|vbetool}} as root.<br />
<br />
Install the {{Pkg|vbetool}} package.<br />
<br />
Turn off your screen on demand and then by pressing a random key backlight turns on again:<br />
<br />
vbetool dpms off && read -n1; vbetool dpms on<br />
<br />
Alternatively, xrandr is able to disable and re-enable monitor outputs without requiring root.<br />
<br />
xrandr --output DP-1 --off; read -n1; xrandr --output DP-1 --auto<br />
<br />
=== Blue tint on videos with Flash ===<br />
<br />
A problem with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
# Install the latest {{Pkg|libvdpau}}.<br />
# Patch {{ic|vdpau_trace.so}} with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
# Right click on a video, select "Settings..." and uncheck "Enable hardware acceleration". Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
# [[Downgrading packages|Downgrade]] the {{Pkg|flashplugin}} package to version 11.1.102.63-1 at most.<br />
# Use {{AUR|google-chrome}} with the new Pepper API {{AUR|chromium-pepper-flash}}.<br />
# Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread].<br />
<br />
=== Bleeding overlay with Flash ===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this problem simply install the latest {{Pkg|libvdpau}} or export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}<br />
<br />
=== Full system freeze using Flash ===<br />
<br />
If you experience occasional full system freezes (only the mouse is moving) using flashplugin<br />
and get:<br />
<br />
{{hc|/var/log/errors.log|<br />
NVRM: Xid (0000:01:00): 31, Ch 00000007, engmask 00000120, intr 10000000<br />
}}<br />
<br />
A possible workaround is to switch off Hardware Acceleration in Flash, setting<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
Or, if you want to keep Hardware acceleration enabled, you may try to::<br />
export VDPAU_NVIDIA_NO_OVERLAY=1<br />
<br />
...before starting the browser.<br />
Note that this may introduce tearing.<br />
<br />
=== Xorg fails to load or Red Screen of Death ===<br />
<br />
If you get a red screen and use GRUB disable the GRUB framebuffer by editing {{ic|/etc/default/grub}} and uncomment GRUB_TERMINAL_OUTPUT. For more information see [[GRUB#Disable_framebuffer|GRUB]].<br />
<br />
=== Black screen on systems with Intel integrated GPU ===<br />
<br />
If you have an Intel CPU with an integrated GPU (e.g. Intel HD 4000) and have installed the {{Pkg|nvidia}} package, you may experience a black screen on boot, when changing virtual terminal, or when exiting an X session. This may be caused by a conflict between the graphics modules. This is solved by blacklisting the Intel GPU modules. Create the file {{ic|/etc/modprobe.d/blacklist.conf}} and prevent the ''i915'' and ''intel_agp'' modules from loading on boot:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install i915 /usr/bin/false<br />
install intel_agp /usr/bin/false<br />
}}<br />
<br />
=== Black screen on systems with VIA integrated GPU ===<br />
<br />
As above, blacklisting the ''viafb'' module may resolve conflicts with NVIDIA drivers:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install viafb /usr/bin/false<br />
}}<br />
<br />
=== X fails with "no screens found" with Intel iGPU ===<br />
<br />
Like above, if you have an Intel CPU with an integrated GPU and X fails to start with <br />
<br />
[ 76.633] (EE) No devices detected.<br />
[ 76.633] Fatal server error:<br />
[ 76.633] no screens found<br />
<br />
then you need to add your discrete card's BusID to your X configuration. Find it:<br />
<br />
{{hc|<nowiki># lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)<br />
}}<br />
<br />
then you fix it by adding it to the card's Device section in your X configuration. In my case:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
Note how {{ic|01:00.0}} is written as {{ic|1:0:0}}.<br />
<br />
=== Xorg fails during boot, but otherwise starts fine ===<br />
<br />
On very fast booting systems, systemd may attempt to start the display manager before the NVIDIA driver has fully initialized. You will see a message like the following in your logs only when Xorg runs during boot.<br />
{{hc|/var/log/Xorg.0.log|output=<br />
[ 1.807] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the<br />
[ 1.807] (EE) NVIDIA(0): system's kernel log for additional error messages and<br />
[ 1.808] (EE) NVIDIA(0): consult the NVIDIA README for details.<br />
[ 1.808] (EE) NVIDIA(0): *** Aborting ***<br />
}}<br />
In this case you will need to establish an ordering dependency from the display manager to the DRI device. First create device units for DRI devices by creating a new udev rules file.<br />
{{hc|/etc/udev/rules.d/99-systemd-dri-devices.rules|output=<br />
ACTION=="add", KERNEL=="card*", SUBSYSTEM=="drm", TAG+="systemd"<br />
}}<br />
Then create dependencies from the display manager to the device(s).<br />
{{hc|/etc/systemd/system/display-manager.service.d/10-wait-for-dri-devices.conf|output=<br />
[Unit]<br />
Wants=dev-dri-card0.device<br />
After=dev-dri-card0.device<br />
}}<br />
If you have additional cards needed for the desktop then list them in Wants and After seperated by spaces.<br />
<br />
=== Flash video players crashes ===<br />
<br />
If you are getting frequent crashes of Flash video players, try to switch off Hardware Acceleration:<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
(This problem appeared after installing the proprietary nvidia driver, and was fixed by changing this setting.)<br />
<br />
== See also ==<br />
<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=343897NVIDIA2014-11-08T16:36:45Z<p>Yafengabc: /* No brightness control on laptops */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
[[zh-CN:NVIDIA]]<br />
{{Related articles start}}<br />
{{Related|Nouveau}}<br />
{{Related|Bumblebee}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]]. See instead [[NVIDIA Optimus]] if you have a laptop based on such technology.<br />
<br />
== Installing ==<br />
<br />
These instructions are for those using the stock {{Pkg|linux}} or {{Pkg|linux-lts}} packages. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
{{Warning| Mixing driver versions does NOT work. You can't use the current branch and the 32-Bit libGL package of the legacy branches or any combination.}}<br />
<br />
1. If you do not know what graphics card you have, find out by issuing:<br />
:{{bc|<nowiki>$ lspci -k | grep -A 2 -i "VGA"</nowiki>}}<br />
<br />
2. Determine the necessary driver version for your card by visiting NVIDIA's [http://www.nvidia.com/Download/index.aspx driver download site], looking up the name in NVIDIA's [http://www.nvidia.com/object/IO_32667.html legacy card list], or finding the code name on [http://nouveau.freedesktop.org/wiki/CodeNames nouveau wiki's code names page].<br />
<br />
3. Install the appropriate driver for your card:<br />
:* For GeForce 400 series cards and newer [NVCx and newer], install the {{Pkg|nvidia}} or {{Pkg|nvidia-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 8000/9000 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx] from around 2006-2010, install the {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-340xx-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 6000/7000 series cards [NV4x and NV6x] from around 2004-2006, install the {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} package, available in the [[official repositories]].<br />
<br />
:* For even older cards, have a look at [[#Unsupported drivers]].<br />
:* For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[Arch User Repository]], since the stable drivers may not support the newly introduced features.<br />
<br />
:If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent ''lib32'' package from the [[multilib]] repository (e.g. {{Pkg|lib32-nvidia-libgl}}, {{Pkg|lib32-nvidia-340xx-libgl}} or {{Pkg|lib32-nvidia-304xx-libgl}}).<br />
<br />
4. Reboot. The {{Pkg|nvidia}} package contains a file which blacklists the ''nouveau'' module, so rebooting is necessary.<br />
<br />
Once the driver has been installed, continue to [[#Configuring]].<br />
<br />
=== Unsupported drivers ===<br />
<br />
If you have a GeForce 5 FX series card or older, Nvidia no longer supports drivers for you card. This means that these drivers [http://nvidia.custhelp.com/app/answers/detail/a_id/3142/ do not support the current Xorg version]. It thus might be easier if you use the [[nouveau]] driver, which supports the old cards with the current Xorg.<br />
<br />
However, Nvidia's drivers might provide better 3D performance/stability. If you want to use them, you can install them (together with an old Xorg version) from the [[Arch User Repository]]:<br />
<br />
* For GeForce 5 FX series cards [NV30-NV36], install the {{AUR|nvidia-173xx}} package. Last supported Xorg version is 1.15.<br />
* For GeForce 2/3/4 MX/Ti series cards [NV11, NV17-NV28], install the {{AUR|nvidia-96xx}} package. Last supported Xorg version is 1.12.<br />
<br />
{{Tip|The legacy nvidia-96xx and nvidia-173xx drivers can also be installed from the unofficial [http://pkgbuild.com/~bgyorgy/city.html <nowiki>[city] repository</nowiki>]. (It's strongly advised that you don't skip any dependencies restriction when installing from here)}}<br />
<br />
=== Alternate install: custom kernel ===<br />
<br />
First of all, it's good to know how the ABS works by reading some of the other articles about it:<br />
<br />
* Main article for [[Arch Build System|ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating packages]]<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
[[Pacman|Install]] {{Pkg|abs}} from the [[official repositories]] and generate the tree with:<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/abs<br />
Make a copy of the {{ic|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/abs/<br />
Go into the temporary {{ic|nvidia}} build directory:<br />
$ cd ~/abs/nvidia<br />
It is required to edit the files {{ic|nvidia.install}} and {{ic|PKGBUILD}} so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are multiple kernels installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nouveau module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{ic|-c}} operand tells makepkg to clean left over files after building the package, whereas {{ic|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
=== Automatic re-compilation of the NVIDIA module with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|nvidia-hook}} from the [[AUR]]. You will need to install the module sources: {{AUR|nvidia-dkms}}. In '''nvidia-hook''', the 'automatic re-compilation' functionality is done by a '''nvidia hook''' on [[mkinitcpio]] after forcing to update the '''linux-headers''' package. You will need to add 'nvidia' to the HOOKS array in /etc/mkinitcpio.conf.<br />
<br />
The hook will call the '''dkms''' command to update the NVIDIA module for the version of your new kernel.<br />
<br />
{{Note|<br />
* If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. nvidia hook will tell you if anything goes wrong.<br />
* If you would like to do this manually please see this section [[Dynamic Kernel Module Support#Usage| in the dkms arch wiki.]]<br />
}}<br />
<br />
== Configuring ==<br />
<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a configuration file (prefer {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} over {{ic|/etc/X11/xorg.conf}}) in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a number of settings that can bypass Xorg's auto-discovered or pre-configured options.<br />
{{Note|Since 1.8.x Xorg uses separate configuration files in {{ic|/etc/X11/xorg.conf.d/}} - check out [[NVIDIA#Advanced: 20-nvidia.conf|advanced configuration]] section.}}<br />
<br />
=== Minimal configuration ===<br />
<br />
A basic configuration block in {{ic|20-nvidia.conf}} (or deprecated in {{ic|xorg.conf}}) would look like this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Nvidia Card"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "NoLogo" "true"<br />
#Option "UseEDID" "false"<br />
#Option "ConnectedMonitor" "DFP"<br />
# ...<br />
EndSection<br />
}}<br />
<br />
{{Tip|If upgrading from nouveau make sure to remove "{{ic|nouveau}}" from {{ic|/etc/mkinitcpio.conf}}. See [[NVIDIA#Switching between NVIDIA and nouveau drivers|Switching between NVIDIA and nouveau drivers]], if switching between the open and proprietary drivers often.}}<br />
<br />
=== Automatic configuration ===<br />
<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{ic|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{ic|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{ic|/etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning|That may still not work properly with Xorg-server 1.8 }}<br />
<br />
=== Multiple monitors ===<br />
<br />
:''See [[Multihead]] for more general information''<br />
{{Warning|1=As of August 2013, Xinerama is broken when using the proprietary NVIDIA driver from 319 upwards. Users wishing to use Xinerama with the NVIDIA driver should use the NVIDIA 313 driver, which works only with Linux kernels earlier than 3.10. See [https://bbs.archlinux.org/viewtopic.php?id=163319 this thread] for more information.}}<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
TwinView only works on a per card basis: If you have multiple cards, you'll have to use xinerama or zaphod mode (multiple X screens). You can combine TwinView with zaphod mode, ending up, for example, with two X screens covering two monitors each. Most window managers fail miserably in zaphod mode. Awesome is the shining exception, and KDE almost works.<br />
<br />
Example configuration:<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "TwinLayout"<br />
Screen 0 "metaScreen" 0 0<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
<br />
#refer to the link below for more information on each of the following options.<br />
Option "HorizSync" "DFP-0: 28-33; DFP-1 28-33"<br />
Option "VertRefresh" "DFP-0: 43-73; DFP-1 43-73"<br />
Option "MetaModes" "1920x1080, 1920x1080"<br />
Option "ConnectedMonitor" "DFP-0, DFP-1"<br />
Option "MetaModeOrientation" "DFP-1 LeftOf DFP-0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "metaScreen"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "True"<br />
SubSection "Display"<br />
Modes "1920x1080"<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
[http://us.download.nvidia.com/XFree86/Linux-x86/304.51/README/configtwinview.html Device option information].<br />
<br />
If you have multiple cards that are SLI capable, it is possible to run more than one monitor attached to separate cards (for example: two cards in SLI with one monitor attached to each). The "MetaModes" option in conjunction with SLI Mosaic mode enables this. Below is a configuration which works for the aforementioned example and runs [[GNOME]] flawlessly.<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Device"<br />
Identifier "Card A"<br />
Driver "nvidia"<br />
BusID "PCI:1:00:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card B"<br />
Driver "nvidia"<br />
BusID "PCI:2:00:0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Right Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Left Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Right Screen"<br />
Device "Card A"<br />
Monitor "Right Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Left Screen"<br />
Device "Card B"<br />
Monitor "Left Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default"<br />
Screen 0 "Right Screen" 0 0<br />
Option "Xinerama" "0"<br />
EndSection}}<br />
<br />
===== Manual CLI configuration with xrandr =====<br />
<br />
If the latest solutions don't work for you, you can use your window manager's ''autostart'' implementation with {{Pkg|xorg-xrandr}}.<br />
<br />
Some {{ic|xrandr}} examples could be:<br />
<br />
xrandr --output DVI-I-0 --auto --primary --left-of DVI-I-1<br />
<br />
or:<br />
<br />
xrandr --output DVI-I-1 --pos 1440x0 --mode 1440x900 --rate 75.0<br />
<br />
When:<br />
<br />
* {{ic|--output}} is used to indicate the "monitor" to which the options are set.<br />
* {{ic|DVI-I-1}} is the name of the second monitor.<br />
* {{ic|--pos}} is the position of the second monitor relative to the first.<br />
* {{ic|--mode}} is the resolution of the second monitor.<br />
* {{ic|--rate}} is the refresh rate (in Hz).<br />
<br />
You can find the proper options by running {{ic|xrandr}} without any arguments.<br />
<br />
==== Using NVIDIA Settings ====<br />
<br />
You can also use the {{ic|nvidia-settings}} tool provided by {{Pkg|nvidia-utils}}. With this method, you will use the proprietary software NVIDIA provides with their drivers. Simply run {{ic|nvidia-settings}} as root, then configure as you wish, and then save the configuration to {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
==== ConnectedMonitor ====<br />
<br />
If the driver doesn't properly detect a second monitor, you can force it to do so with ConnectedMonitor. <br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
VendorName "Panasonic"<br />
ModelName "Panasonic MICRON 2100Ex"<br />
HorizSync 30.0 - 121.0 # this monitor has incorrect EDID, hence Option "UseEDIDFreqs" "false"<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor2"<br />
VendorName "Gateway"<br />
ModelName "GatewayVX1120"<br />
HorizSync 30.0 - 121.0<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device2"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 1<br />
EndSection<br />
<br />
}}<br />
<br />
The duplicated device with {{ic|Screen}} is how you get X to use two monitors on one card without {{ic|TwinView}}. Note that {{ic|nvidia-settings}} will strip out any {{ic|ConnectedMonitor}} options you have added.<br />
<br />
==== Mosaic mode ====<br />
<br />
Mosaic mode is the only way to use more than 2 monitors across multiple graphics cards with compositing. Your window manager may or may not recognize the distinction between each monitor.<br />
<br />
===== Base mosaic =====<br />
<br />
Base mosaic mode works on any set of Geforce 8000 series or higher GPUs. It cannot be enabled from withing the nvidia-setting GUI. You must either use the nvidia-xconfig command line program or edit xorg.conf by hand. Metamodes must be specified. The following is an example for four DFPs in a 2x2 configuration, each running at 1920x1024, with two DFPs connected to two cards:<br />
$ nvidia-xconfig --base-mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
{{Note|While the documentation lists a 2x2 configuration of monitors, Nvidia has reduced that ability to just 3 monitors in base mosaic mode as of driver version 304. More monitors are available with a Quadro card, but with standard consumer cards, it is limited to three. The explanation given for this reduction is "Feature parity with the Windows driver". As of 9/14/2014, Windows has no restriction on the number of monitors, even on the same driver version. This is not a bug, this is entirely by design.}}<br />
<br />
===== SLI Mosaic =====<br />
<br />
If you have an SLI configuration and each GPU is a Quadro FX 5800, Quadro Fermi or newer then you can use SLI Mosaic mode. It can be enabled from within the nvidia-settings GUI or from the command line with:<br />
$ nvidia-xconfig --sli=Mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
== Tweaking ==<br />
<br />
=== GUI: nvidia-settings ===<br />
<br />
The NVIDIA package includes the {{ic|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
The desktop environment's auto-startup method 'may' not work for loading nvidia-settings properly (KDE). To be sure that settings are really loaded put the command in ~/.xinitrc file (create if not present).<br />
<br />
{{Tip|On rare occasions the {{ic|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the problem.}}<br />
<br />
=== Advanced: 20-nvidia.conf ===<br />
<br />
Edit {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and add the option to the correct section. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/ NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.<br />
<br />
==== Disabling the logo on startup ====<br />
<br />
Add the {{ic|"NoLogo"}} option under section {{ic|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
==== Overriding monitor detection ====<br />
<br />
The {{ic|"ConnectedMonitor"}} option under section {{ic|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{ic|"CRT"}} for analog connections, {{ic|"DFP"}} for digital monitors and {{ic|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
==== Enabling brightness control ====<br />
<br />
Add under section {{ic|Device}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
{{Note|If you already have this enabled<br />
and your brightness control doesn't work try to comment it out.}}<br />
<br />
==== Enabling SLI ====<br />
<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A "supported configuration" is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{ic|lspci}}:<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
}}<br />
<br />
Add the BusID (3 in the previous example) under section {{ic|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{ic|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{ic|Screen}}:<br />
Option "SLI" "AA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| class="wikitable"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| AA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
Alternatively, you can use the {{ic|nvidia-xconfig}} utility to insert these changes into {{ic|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=AA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
{{hc|<nowiki>$ nvidia-settings -q all | grep SLIMode</nowiki>|<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
}}<br />
<br />
{{Warning| After enabling SLI, your system may become frozen/non-responsive upon starting xorg. It is advisable that you disable your display manager before restarting.}}<br />
<br />
==== Enabling overclocking ====<br />
<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{ic|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
{{Note|GeForce 400/500/600/700 series Fermi/Kepler cores CAN now, as of version 337.12, be overclocked! Now {{ic|Option "Coolbits" "8"}} needs to be set within the device section of the X configuration file to enable the new overclocking support. If you also want to enable manual GPU fan controls, you need to set {{ic|Option "Coolbits" "12"}}.}}<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|An alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]{{Dead link|2013|05|25}} and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]{{Dead link|2013|05|25}}. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits. [http://ivanvojtko.blogspot.sk/2014/03/how-to-overclock-geforce-460gtx-fermi.html Fermi BIOS modification tutorial]}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
<br />
Set the following string in the {{ic|Device}} section to enable PowerMizer at its maximum performance level (VSync won't work without this line):<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{ic|Device}} section to enable manual GPU fan control within {{ic|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Fixing terminal resolution ===<br />
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.<br />
<br />
==== GRUB ====<br />
If you are using GRUB, a possible solution is to edit the {{ic|GRUB_GFXMODE}} line of {{ic|/etc/default/grub}} with desired display resolutions. Multiple resolutions can be specified, including the default {{ic|auto}}, so it is recommended that you edit the line to resemble {{ic|1=GRUB_GFXMODE=<desired resolution>,<fallback such as 1024x768>,auto}}. For more information, refer to [https://www.gnu.org/software/grub/manual/html_node/gfxmode.html#gfxmode the GRUB gfxmode documentation].<br />
<br />
=== Enabling Pure Video HD (VDPAU/VAAPI) ===<br />
<br />
{{Merge|VDPAU|Keep here only the specifics and merge the general information into the main article.}}<br />
<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/Nvidia_PureVideo#Table_of_PureVideo_.28HD.29_GPUs].<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with {{Pkg|libva-vdpau-driver}}.<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware.}}<br />
<br />
To enable hardware acceleration in [[VLC media player|VLC]] go:<br />
<br />
{{ic|Tools > Preferences > Input & Codecs}}, then select {{ic|VDPAU}} as {{ic|'''Hardware-accelerated decoding'''}}<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
{{ic|Options > Preferences > General > Video Tab}}, then select {{ic|vdpau}} as {{ic|'''output driver'''}}<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
{{ic|Edit > Preference}}, then set {{ic|'''video output'''}} to {{ic|vdpau}}<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>512MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{ic|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
=== Avoid screen tearing in KDE (KWin) ===<br />
<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export __GL_YIELD="USLEEP"<br />
</nowiki>}}<br />
<br />
Also if the above doesn't help, then try this:<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export KWIN_TRIPLE_BUFFER=1<br />
</nowiki>}}<br />
<br />
Do not have both of the above enabled at the same time.<br />
Also if you enable triple buffering make sure to enable TripleBuffering for the driver itself.<br />
Source: https://bugs.kde.org/show_bug.cgi?id=322060<br />
<br />
=== Hardware accelerated video decoding with XvMC ===<br />
<br />
Accelerated decoding of MPEG-1 and MPEG-2 videos via [[XvMC]] are supported on GeForce4, GeForce 5 FX, GeForce 6 and GeForce 7 series cards. To use it, create a new file {{ic|/etc/X11/XvMCConfig}} with the following content:<br />
libXvMCNVIDIA_dynamic.so.1<br />
<br />
See how to configure [[XvMC#Supported software|supported software]].<br />
<br />
=== Using TV-out ===<br />
<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here].<br />
<br />
=== X with a TV (DFP) as the only display ===<br />
<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the {{ic|DFP}} section (again, {{ic|DFP-0}} or similar), click on the {{ic|Acquire Edid}} Button and store it somewhere, for example, {{ic|/etc/X11/dfp0.edid}}.<br />
<br />
Edit {{ic|xorg.conf}} by adding to the {{ic|Device}} section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The {{ic|ConnectedMonitor}} option forces the driver to recognize the DFP as if it were connected. The {{ic|CustomEDID}} provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
=== Check the power source ===<br />
<br />
The NVIDIA X.org driver can also be used to detect the GPU's current source of power. To see the current power source, check the 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
{{hc|$ nvidia-settings -q GPUPowerSource -t|1}}<br />
<br />
If you're seeing an error message similiar to the one below, then you either need to install [[acpid]] or start the systemd service via {{ic|systemctl start acpid.service}}<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
(If you are not seeing this error, it is not necessary to install/run acpid soley for this purpose. My current power source is correctly reported without acpid even installed.)<br />
<br />
=== Displaying GPU temperature in the shell ===<br />
<br />
==== Method 1 - nvidia-settings ====<br />
<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use {{ic|nvidia-settings}} as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as {{ic|rrdtool}} or {{ic|conky}}, among others:<br />
{{hc|$ nvidia-settings -q gpucoretemp -t|41}}<br />
<br />
==== Method 2 - nvidia-smi ====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temperature in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi<br />
<br />
This should output something similar to the following:<br />
{{hc|$ nvidia-smi|<nowiki><br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki><br />
}}<br />
<br />
Only for temperature:<br />
{{hc|$ nvidia-smi -q -d TEMPERATURE|<nowiki><br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki><br />
}}<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
{{hc|<nowiki>$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36</nowiki>|62}}<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli.<br />
<br />
==== Method 3 - nvclock ====<br />
<br />
Use {{AUR|nvclock}} which is available from the [[AUR]].<br />
{{Note|{{ic|nvclock}} cannot access thermal sensors on newer NVIDIA cards such as Geforce 200 series cards.}}<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
=== Set fan speed at login ===<br />
<br />
You can adjust the fan speed on your graphics card with ''nvidia-settings''' console interface. First ensure that your Xorg configuration sets the Coolbits option to {{ic|4}}, {{ic|5}} or {{ic|12}} for fermi and above in your {{ic|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GeForce 400/500 series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{ic|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace {{ic|''n''}} with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=''n''" \<br />
-a [fan:1]/GPUCurrentFanSpeed=''n''" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{ic|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change {{ic|''n''}} to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
=== Order of install/deinstall for changing drivers ===<br />
<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-libglN<br />
install nvidiaN<br />
install lib32-nvidia-libgl-N (if required)<br />
<br />
=== Switching between NVIDIA and nouveau drivers ===<br />
<br />
{{Warning|The {{ic|-Rdds}} switch is used as the installation otherwise fails due to unstatisfied dependencies.}}<br />
<br />
If you need to switch between drivers, you may use the following script, run as root (say yes to all confirmations):<br />
<br />
{{bc|1=<nowiki><br />
#!/bin/bash<br />
BRANCH=340xx<br />
#BRANCH=304xx<br />
<br />
NVIDIA="nvidia-$BRANCH"<br />
_NVIDIA="$(pacman -Qqs ^${NVIDIA}$)"<br />
NOUVEAU="xf86-video-nouveau mesa-libgl"<br />
_NOUVEAU="$(pacman -Qqs ^mesa-libgl$)"<br />
<br />
if [[ ! $_NVIDIA ]]; then<br />
pacman -Rdds "$NOUVEAU"<br />
pacman -S "$NVIDIA" #lib32-$NVIDIA-libgl #$NVIDIA-lts<br />
elif [[ ! $_NOUVEAU ]]; then<br />
pacman -Rdds "$_NVIDIA"<br />
pacman -S "$NOUVEAU" #lib32-mesa-libgl<br />
fi<br />
</nowiki>}}<br />
<br />
Uncomment the lib32 packages if you run a 64-bit system and require the 32-bit libraries (e.g. 32-bit games/Steam).<br />
<br />
=== Avoid tearing with GeForce 600/700 series cards === <br />
<br />
Adding the following line to the {{ic|"Screen"}} section of your X11 configuration file, for example {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, will eliminate tearing entirely, regardless of the compositor you are using. It has been reported to reduce the performance of some OpenGL applications, though.<br />
<br />
Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Gaming using TwinView ===<br />
<br />
In case you want to play fullscreen games when using TwinView, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropriate Metamodes to your xorg.conf in section {{ic|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
=== Vertical sync using TwinView ===<br />
<br />
If you're using TwinView and vertical sync (the "Sync to VBlank" option in '''nvidia-settings'''), you will notice that only one screen is being properly synced, unless you have two identical monitors. Although '''nvidia-settings''' does offer an option to change which screen is being synced (the "Sync to this display device" option), this does not always work. A solution is to add the following environment variables at startup, for example append in {{ic|/etc/profile}}:<br />
<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_SYNC_DISPLAY_DEVICE=DFP-0<br />
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DFP-0<br />
<br />
You can change {{ic|DFP-0}} with your preferred screen ({{ic|DFP-0}} is the DVI port and {{ic|CRT-0}} is the VGA port). You can find the identifier for your display from '''nvidia-settings''' in the "X Server XVideoSettings" section.<br />
<br />
=== Old Xorg settings ===<br />
<br />
If upgrading from an old installation, please remove old {{ic|/usr/X11R6/}} paths as it can cause trouble during installation.<br />
<br />
=== Corrupted screen: "Six screens" Problem ===<br />
<br />
For some users, using GeForce GT 100M's, the screen gets corrupted after X starts, divided into 6 sections with a resolution limited to 640x480.<br />
The same problem has been recently reported with Quadro 2000 and hi-res displays.<br />
<br />
To solve this problem, enable the Validation Mode {{ic|NoTotalSizeCheck}} in section {{ic|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
=== '/dev/nvidia0' input/output error ===<br />
<br />
{{Accuracy|Verify that the BIOS related suggestions work and are not coincidentally set while troubleshooting.|section='/dev/nvidia0' Input/Output error... suggested fixes}}<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the problem. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with {{ic|lspci -v}}) and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
If running a 64bit kernel, a driver defect can cause the NVIDIA module to fail initializing when IOMMU is on. Turning it off in the BIOS has been confirmed to work for some users. [http://www.nvnews.net/vbulletin/showthread.php?s=68bb2fabadcb53b10b286aa42d13c5bc&t=159335][[User:Clickthem#nvidia module]]<br />
<br />
Another thing to try is to change your BIOS IRQ routing from {{ic|Operating system controlled}} to {{ic|BIOS controlled}} or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The {{ic|noacpi}} kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
=== '/dev/nvidiactl' errors ===<br />
<br />
Trying to start an OpenGL application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropriate user to the {{ic|video}} group and log in again:<br />
# gpasswd -a username video<br />
<br />
=== 32-bit applications do not start ===<br />
<br />
Under 64-bit systems, installing {{ic|lib32-nvidia-libgl}} that corresponds to the same version installed for the 64-bit driver fixes the problem.<br />
<br />
=== Errors after updating the kernel ===<br />
<br />
If a custom build of NVIDIA's module is used instead of the package from the ''extra'' repository, a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
=== Crashing in general ===<br />
<br />
* Try disabling {{ic|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{ic|nopat}} at the end of the {{ic|kernel}} line in {{ic|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{ic|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{ic|nopat}} to [[kernel parameters]].<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
=== Bad performance after installing a new driver version ===<br />
<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on (glxinfo is included in {{Pkg|mesa-demos}}):<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
=== CPU spikes with 400 series cards ===<br />
<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the {{ic|Device}} section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
=== Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace ===<br />
<br />
If, while using the legacy NVIDIA drivers, Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via {{ic|Ctrl+Alt+Backspace}} (or whatever the new "kill X" key binding is), try adding this in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{ic|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's README: Appendix K] for more information.<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [[http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html]] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
==== Possible Workaround ====<br />
<br />
Enter the BIOS and changed the default graphics setting from 'Optimus' to 'Discrete' and the install NVIDIA drivers (295.20-1 at time of writing) recognized the screens.<br />
<br />
Steps:<br />
# Enter BIOS.<br />
# Find Graphics Settings (should be in tab ''Config > Display'').<br />
# Change 'Graphics Device' to 'Discrete Graphics' (Disables Intel integrated graphics).<br />
# Change OS Detection for Nvidia Optimus to "Disabled".<br />
# Save and exit.<br />
<br />
Tested on a Lenovo W520 with a Quadro 1000M and Nvidia Optimus<br />
<br />
=== Screen(s) found, but none have a usable configuration ===<br />
<br />
On a laptop, sometimes NVIDIA driver cannot find the active screen.<br />
It may be caused because you own a graphic card with vga/tv outs.<br />
You should examine Xorg.0.log to see what is wrong.<br />
<br />
Another thing to try is adding invalid {{ic|"ConnectedMonitor" Option}} to {{ic|Section "Device"}}<br />
to force Xorg throws error and shows you how correct it.<br />
[http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html Here]<br />
more about ConnectedMonitor setting.<br />
<br />
After re-run X see Xorg.0.log to get valid CRT-x,DFP-x,TV-x values.<br />
<br />
{{ic|nvidia-xconfig --query-gpu-info}} could be helpful.<br />
<br />
=== Blackscreen at X startup with new driver ===<br />
<br />
If you have installed an update of Nvidia and you screen stay black after launching Xorg. You have to use the {{ic|<nowiki>rcutree.rcu_idle_gp_delay=1</nowiki>}} [[kernel parameter]].<br />
<br />
You can also try to add the {{ic|nvidia}} module directly to your [[mkinitcpio]] config file.<br />
<br />
=== No brightness control on laptops ===<br />
<br />
Try to add the following line in {{ic|20-nvidia.conf}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
if the Xorg can't start an tested {{ic|20-nvidia.conf}} is:<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
#BoardName "Quadro NVS 3100M"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
<br />
<br />
<br />
If it is still not working, you can try installing {{AUR|nvidia-bl}} or {{AUR|nvidiabl}}.<br />
<br />
=== Backlight is not turning off in some occasions ===<br />
<br />
By default, DPMS should turn off backlight with the timeouts set or by running xset. However, probably due to a bug in the proprietary Nvidia drivers the result is a blank screen with no powersaving whatsoever. To workaround it, until the bug has been fixed you can use the {{ic|vbetool}} as root.<br />
<br />
Install the {{Pkg|vbetool}} package.<br />
<br />
Turn off your screen on demand and then by pressing a random key backlight turns on again:<br />
<br />
vbetool dpms off && read -n1; vbetool dpms on<br />
<br />
Alternatively, xrandr is able to disable and re-enable monitor outputs without requiring root.<br />
<br />
xrandr --output DP-1 --off; read -n1; xrandr --output DP-1 --auto<br />
<br />
=== Blue tint on videos with Flash ===<br />
<br />
A problem with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
# Install the latest {{Pkg|libvdpau}}.<br />
# Patch {{ic|vdpau_trace.so}} with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
# Right click on a video, select "Settings..." and uncheck "Enable hardware acceleration". Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
# [[Downgrading packages|Downgrade]] the {{Pkg|flashplugin}} package to version 11.1.102.63-1 at most.<br />
# Use {{AUR|google-chrome}} with the new Pepper API {{AUR|chromium-pepper-flash}}.<br />
# Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread].<br />
<br />
=== Bleeding overlay with Flash ===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this problem simply install the latest {{Pkg|libvdpau}} or export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}<br />
<br />
=== Full system freeze using Flash ===<br />
<br />
If you experience occasional full system freezes (only the mouse is moving) using flashplugin<br />
and get:<br />
<br />
{{hc|/var/log/errors.log|<br />
NVRM: Xid (0000:01:00): 31, Ch 00000007, engmask 00000120, intr 10000000<br />
}}<br />
<br />
A possible workaround is to switch off Hardware Acceleration in Flash, setting<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
Or, if you want to keep Hardware acceleration enabled, you may try to::<br />
export VDPAU_NVIDIA_NO_OVERLAY=1<br />
<br />
...before starting the browser.<br />
Note that this may introduce tearing.<br />
<br />
=== Xorg fails to load or Red Screen of Death ===<br />
<br />
If you get a red screen and use GRUB disable the GRUB framebuffer by editing {{ic|/etc/default/grub}} and uncomment GRUB_TERMINAL_OUTPUT. For more information see [[GRUB#Disable_framebuffer|GRUB]].<br />
<br />
=== Black screen on systems with Intel integrated GPU ===<br />
<br />
If you have an Intel CPU with an integrated GPU (e.g. Intel HD 4000) and have installed the {{Pkg|nvidia}} package, you may experience a black screen on boot, when changing virtual terminal, or when exiting an X session. This may be caused by a conflict between the graphics modules. This is solved by blacklisting the Intel GPU modules. Create the file {{ic|/etc/modprobe.d/blacklist.conf}} and prevent the ''i915'' and ''intel_agp'' modules from loading on boot:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install i915 /usr/bin/false<br />
install intel_agp /usr/bin/false<br />
}}<br />
<br />
=== Black screen on systems with VIA integrated GPU ===<br />
<br />
As above, blacklisting the ''viafb'' module may resolve conflicts with NVIDIA drivers:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install viafb /usr/bin/false<br />
}}<br />
<br />
=== X fails with "no screens found" with Intel iGPU ===<br />
<br />
Like above, if you have an Intel CPU with an integrated GPU and X fails to start with <br />
<br />
[ 76.633] (EE) No devices detected.<br />
[ 76.633] Fatal server error:<br />
[ 76.633] no screens found<br />
<br />
then you need to add your discrete card's BusID to your X configuration. Find it:<br />
<br />
{{hc|<nowiki># lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)<br />
}}<br />
<br />
then you fix it by adding it to the card's Device section in your X configuration. In my case:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
Note how {{ic|01:00.0}} is written as {{ic|1:0:0}}.<br />
<br />
=== Xorg fails during boot, but otherwise starts fine ===<br />
<br />
On very fast booting systems, systemd may attempt to start the display manager before the NVIDIA driver has fully initialized. You will see a message like the following in your logs only when Xorg runs during boot.<br />
{{hc|/var/log/Xorg.0.log|output=<br />
[ 1.807] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the<br />
[ 1.807] (EE) NVIDIA(0): system's kernel log for additional error messages and<br />
[ 1.808] (EE) NVIDIA(0): consult the NVIDIA README for details.<br />
[ 1.808] (EE) NVIDIA(0): *** Aborting ***<br />
}}<br />
In this case you will need to establish an ordering dependency from the display manager to the DRI device. First create device units for DRI devices by creating a new udev rules file.<br />
{{hc|/etc/udev/rules.d/99-systemd-dri-devices.rules|output=<br />
ACTION=="add", KERNEL=="card*", SUBSYSTEM=="drm", TAG+="systemd"<br />
}}<br />
Then create dependencies from the display manager to the device(s).<br />
{{hc|/etc/systemd/system/display-manager.service.d/10-wait-for-dri-devices.conf|output=<br />
[Unit]<br />
Wants=dev-dri-card0.device<br />
After=dev-dri-card0.device<br />
}}<br />
If you have additional cards needed for the desktop then list them in Wants and After seperated by spaces.<br />
<br />
=== Flash video players crashes ===<br />
<br />
If you are getting frequent crashes of Flash video players, try to switch off Hardware Acceleration:<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
(This problem appeared after installing the proprietary nvidia driver, and was fixed by changing this setting.)<br />
<br />
== See also ==<br />
<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=NVIDIA&diff=343896NVIDIA2014-11-08T16:35:44Z<p>Yafengabc: /* No brightness control on laptops */</p>
<hr />
<div>[[Category:Graphics]]<br />
[[Category:X Server]]<br />
[[cs:NVIDIA]]<br />
[[de:Nvidia]]<br />
[[es:NVIDIA]]<br />
[[fa:اِنویدیا]]<br />
[[fr:Nvidia]]<br />
[[it:NVIDIA]]<br />
[[ja:NVIDIA]]<br />
[[nl:NVIDIA]]<br />
[[ru:NVIDIA]]<br />
[[tr:Nvidia]]<br />
[[zh-CN:NVIDIA]]<br />
{{Related articles start}}<br />
{{Related|Nouveau}}<br />
{{Related|Bumblebee}}<br />
{{Related|NVIDIA Optimus}}<br />
{{Related|Xorg}}<br />
{{Related articles end}}<br />
<br />
This article covers installing and configuring [http://www.nvidia.com NVIDIA]'s ''proprietary'' graphic card driver. For information about the open-source drivers, see [[Nouveau]]. See instead [[NVIDIA Optimus]] if you have a laptop based on such technology.<br />
<br />
== Installing ==<br />
<br />
These instructions are for those using the stock {{Pkg|linux}} or {{Pkg|linux-lts}} packages. For custom kernel setup, skip to the [[#Alternate install: custom kernel|next]] subsection.<br />
<br />
{{Tip|It is usually beneficial to install the NVIDIA driver through [[pacman]] rather than through the package provided by the NVIDIA site, this allows the driver to be updated when upgrading the system.}}<br />
{{Warning| Mixing driver versions does NOT work. You can't use the current branch and the 32-Bit libGL package of the legacy branches or any combination.}}<br />
<br />
1. If you do not know what graphics card you have, find out by issuing:<br />
:{{bc|<nowiki>$ lspci -k | grep -A 2 -i "VGA"</nowiki>}}<br />
<br />
2. Determine the necessary driver version for your card by visiting NVIDIA's [http://www.nvidia.com/Download/index.aspx driver download site], looking up the name in NVIDIA's [http://www.nvidia.com/object/IO_32667.html legacy card list], or finding the code name on [http://nouveau.freedesktop.org/wiki/CodeNames nouveau wiki's code names page].<br />
<br />
3. Install the appropriate driver for your card:<br />
:* For GeForce 400 series cards and newer [NVCx and newer], install the {{Pkg|nvidia}} or {{Pkg|nvidia-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 8000/9000 and 100-300 series cards [NV5x, NV8x, NV9x and NVAx] from around 2006-2010, install the {{Pkg|nvidia-340xx}} or {{Pkg|nvidia-340xx-lts}} package, available in the [[official repositories]].<br />
:* For GeForce 6000/7000 series cards [NV4x and NV6x] from around 2004-2006, install the {{Pkg|nvidia-304xx}} or {{Pkg|nvidia-304xx-lts}} package, available in the [[official repositories]].<br />
<br />
:* For even older cards, have a look at [[#Unsupported drivers]].<br />
:* For the very latest GPU models, it may be required to install {{AUR|nvidia-beta}} from the [[Arch User Repository]], since the stable drivers may not support the newly introduced features.<br />
<br />
:If you are on 64-bit and also need 32-bit OpenGL support, you must also install the equivalent ''lib32'' package from the [[multilib]] repository (e.g. {{Pkg|lib32-nvidia-libgl}}, {{Pkg|lib32-nvidia-340xx-libgl}} or {{Pkg|lib32-nvidia-304xx-libgl}}).<br />
<br />
4. Reboot. The {{Pkg|nvidia}} package contains a file which blacklists the ''nouveau'' module, so rebooting is necessary.<br />
<br />
Once the driver has been installed, continue to [[#Configuring]].<br />
<br />
=== Unsupported drivers ===<br />
<br />
If you have a GeForce 5 FX series card or older, Nvidia no longer supports drivers for you card. This means that these drivers [http://nvidia.custhelp.com/app/answers/detail/a_id/3142/ do not support the current Xorg version]. It thus might be easier if you use the [[nouveau]] driver, which supports the old cards with the current Xorg.<br />
<br />
However, Nvidia's drivers might provide better 3D performance/stability. If you want to use them, you can install them (together with an old Xorg version) from the [[Arch User Repository]]:<br />
<br />
* For GeForce 5 FX series cards [NV30-NV36], install the {{AUR|nvidia-173xx}} package. Last supported Xorg version is 1.15.<br />
* For GeForce 2/3/4 MX/Ti series cards [NV11, NV17-NV28], install the {{AUR|nvidia-96xx}} package. Last supported Xorg version is 1.12.<br />
<br />
{{Tip|The legacy nvidia-96xx and nvidia-173xx drivers can also be installed from the unofficial [http://pkgbuild.com/~bgyorgy/city.html <nowiki>[city] repository</nowiki>]. (It's strongly advised that you don't skip any dependencies restriction when installing from here)}}<br />
<br />
=== Alternate install: custom kernel ===<br />
<br />
First of all, it's good to know how the ABS works by reading some of the other articles about it:<br />
<br />
* Main article for [[Arch Build System|ABS]]<br />
* Article on [[makepkg]]<br />
* Article on [[Creating packages]]<br />
<br />
The following is a short tutorial for making a custom NVIDIA driver package using [[ABS]]:<br />
<br />
[[Pacman|Install]] {{Pkg|abs}} from the [[official repositories]] and generate the tree with:<br />
# abs<br />
As a standard user, make a temporary directory for creating the new package:<br />
$ mkdir -p ~/abs<br />
Make a copy of the {{ic|nvidia}} package directory:<br />
$ cp -r /var/abs/extra/nvidia/ ~/abs/<br />
Go into the temporary {{ic|nvidia}} build directory:<br />
$ cd ~/abs/nvidia<br />
It is required to edit the files {{ic|nvidia.install}} and {{ic|PKGBUILD}} so that they contain the right kernel version variables.<br />
<br />
While running the custom kernel, get the appropriate kernel and local version names:<br />
$ uname -r<br />
# In nvidia.install, replace the {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4-ARCH'}} variable with the custom kernel version, such as {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4'}} or {{ic|EXTRAMODULES<nowiki>=</nowiki>'extramodules-3.4.4-custom'}} depending on what the kernel's version is and the local version's text/numbers. Do this for all instances of the version number within this file.<br />
# In PKGBUILD, change the {{ic|_extramodules<nowiki>=</nowiki>extramodules-3.4-ARCH}} variable to match the appropriate version, as above.<br />
# If there are multiple kernels installed in parallel (such as a custom kernel alongside the default -ARCH kernel), change the {{ic|pkgname<nowiki>=</nowiki>nvidia}} variable in the PKGBUILD to a unique identifier, such as nvidia-344 or nvidia-custom. This will allow both kernels to use the nvidia module, since the custom nvidia module has a different package name and will not overwrite the original. You will also need to comment the line in {{ic|package()}} that blacklists the nouveau module in {{ic|/usr/lib/modprobe.d/nvidia.conf}} (no need to do it again).<br />
<br />
Then do:<br />
$ makepkg -ci<br />
The {{ic|-c}} operand tells makepkg to clean left over files after building the package, whereas {{ic|-i}} specifies that makepkg should automatically run pacman to install the resulting package.<br />
<br />
=== Automatic re-compilation of the NVIDIA module with every update of any kernel ===<br />
<br />
This is possible thanks to {{AUR|nvidia-hook}} from the [[AUR]]. You will need to install the module sources: {{AUR|nvidia-dkms}}. In '''nvidia-hook''', the 'automatic re-compilation' functionality is done by a '''nvidia hook''' on [[mkinitcpio]] after forcing to update the '''linux-headers''' package. You will need to add 'nvidia' to the HOOKS array in /etc/mkinitcpio.conf.<br />
<br />
The hook will call the '''dkms''' command to update the NVIDIA module for the version of your new kernel.<br />
<br />
{{Note|<br />
* If you are using this functionality it's '''important''' to look at the installation process of the linux (or any other kernel) package. nvidia hook will tell you if anything goes wrong.<br />
* If you would like to do this manually please see this section [[Dynamic Kernel Module Support#Usage| in the dkms arch wiki.]]<br />
}}<br />
<br />
== Configuring ==<br />
<br />
It is possible that after installing the driver it may not be needed to create an Xorg server configuration file. You can run [[Xorg#Running| a test]] to see if the Xorg server will function correctly without a configuration file. However, it may be required to create a configuration file (prefer {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} over {{ic|/etc/X11/xorg.conf}}) in order to adjust various settings. This configuration can be generated by the NVIDIA Xorg configuration tool, or it can be created manually. If created manually, it can be a minimal configuration (in the sense that it will only pass the basic options to the [[Xorg]] server), or it can include a number of settings that can bypass Xorg's auto-discovered or pre-configured options.<br />
{{Note|Since 1.8.x Xorg uses separate configuration files in {{ic|/etc/X11/xorg.conf.d/}} - check out [[NVIDIA#Advanced: 20-nvidia.conf|advanced configuration]] section.}}<br />
<br />
=== Minimal configuration ===<br />
<br />
A basic configuration block in {{ic|20-nvidia.conf}} (or deprecated in {{ic|xorg.conf}}) would look like this:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/20-nvidia.conf|<br />
Section "Device"<br />
Identifier "Nvidia Card"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
Option "NoLogo" "true"<br />
#Option "UseEDID" "false"<br />
#Option "ConnectedMonitor" "DFP"<br />
# ...<br />
EndSection<br />
}}<br />
<br />
{{Tip|If upgrading from nouveau make sure to remove "{{ic|nouveau}}" from {{ic|/etc/mkinitcpio.conf}}. See [[NVIDIA#Switching between NVIDIA and nouveau drivers|Switching between NVIDIA and nouveau drivers]], if switching between the open and proprietary drivers often.}}<br />
<br />
=== Automatic configuration ===<br />
<br />
The NVIDIA package includes an automatic configuration tool to create an Xorg server configuration file ({{ic|xorg.conf}}) and can be run by:<br />
# nvidia-xconfig<br />
<br />
This command will auto-detect and create (or edit, if already present) the {{ic|/etc/X11/xorg.conf}} configuration according to present hardware.<br />
<br />
If there are instances of DRI, ensure they are commented out:<br />
# Load "dri"<br />
Double check your {{ic|/etc/X11/xorg.conf}} to make sure your default depth, horizontal sync, vertical refresh, and resolutions are acceptable.<br />
<br />
{{Warning|That may still not work properly with Xorg-server 1.8 }}<br />
<br />
=== Multiple monitors ===<br />
<br />
:''See [[Multihead]] for more general information''<br />
{{Warning|1=As of August 2013, Xinerama is broken when using the proprietary NVIDIA driver from 319 upwards. Users wishing to use Xinerama with the NVIDIA driver should use the NVIDIA 313 driver, which works only with Linux kernels earlier than 3.10. See [https://bbs.archlinux.org/viewtopic.php?id=163319 this thread] for more information.}}<br />
<br />
To activate dual screen support, you just need to edit the {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the NVIDIA proprietary driver automatically disables compositing. If you desire compositing, you should comment out the {{ic|Xinerama}} line in "{{ic|ServerLayout}}" and use TwinView (see below) instead.<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
==== TwinView ====<br />
<br />
You want only one big screen instead of two. Set the {{ic|TwinView}} argument to {{ic|1}}. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
TwinView only works on a per card basis: If you have multiple cards, you'll have to use xinerama or zaphod mode (multiple X screens). You can combine TwinView with zaphod mode, ending up, for example, with two X screens covering two monitors each. Most window managers fail miserably in zaphod mode. Awesome is the shining exception, and KDE almost works.<br />
<br />
Example configuration:<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "ServerLayout"<br />
Identifier "TwinLayout"<br />
Screen 0 "metaScreen" 0 0<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
<br />
#refer to the link below for more information on each of the following options.<br />
Option "HorizSync" "DFP-0: 28-33; DFP-1 28-33"<br />
Option "VertRefresh" "DFP-0: 43-73; DFP-1 43-73"<br />
Option "MetaModes" "1920x1080, 1920x1080"<br />
Option "ConnectedMonitor" "DFP-0, DFP-1"<br />
Option "MetaModeOrientation" "DFP-1 LeftOf DFP-0"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "metaScreen"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "True"<br />
SubSection "Display"<br />
Modes "1920x1080"<br />
EndSubSection<br />
EndSection<br />
}}<br />
<br />
[http://us.download.nvidia.com/XFree86/Linux-x86/304.51/README/configtwinview.html Device option information].<br />
<br />
If you have multiple cards that are SLI capable, it is possible to run more than one monitor attached to separate cards (for example: two cards in SLI with one monitor attached to each). The "MetaModes" option in conjunction with SLI Mosaic mode enables this. Below is a configuration which works for the aforementioned example and runs [[GNOME]] flawlessly.<br />
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<br />
Section "Device"<br />
Identifier "Card A"<br />
Driver "nvidia"<br />
BusID "PCI:1:00:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Card B"<br />
Driver "nvidia"<br />
BusID "PCI:2:00:0"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Right Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Left Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Right Screen"<br />
Device "Card A"<br />
Monitor "Right Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Left Screen"<br />
Device "Card B"<br />
Monitor "Left Monitor"<br />
DefaultDepth 24<br />
Option "SLI" "Mosaic"<br />
Option "Stereo" "0"<br />
Option "BaseMosaic" "True"<br />
Option "MetaModes" "GPU-0.DFP-0: 1920x1200+4480+0, GPU-1.DFP-0:1920x1200+0+0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default"<br />
Screen 0 "Right Screen" 0 0<br />
Option "Xinerama" "0"<br />
EndSection}}<br />
<br />
===== Manual CLI configuration with xrandr =====<br />
<br />
If the latest solutions don't work for you, you can use your window manager's ''autostart'' implementation with {{Pkg|xorg-xrandr}}.<br />
<br />
Some {{ic|xrandr}} examples could be:<br />
<br />
xrandr --output DVI-I-0 --auto --primary --left-of DVI-I-1<br />
<br />
or:<br />
<br />
xrandr --output DVI-I-1 --pos 1440x0 --mode 1440x900 --rate 75.0<br />
<br />
When:<br />
<br />
* {{ic|--output}} is used to indicate the "monitor" to which the options are set.<br />
* {{ic|DVI-I-1}} is the name of the second monitor.<br />
* {{ic|--pos}} is the position of the second monitor relative to the first.<br />
* {{ic|--mode}} is the resolution of the second monitor.<br />
* {{ic|--rate}} is the refresh rate (in Hz).<br />
<br />
You can find the proper options by running {{ic|xrandr}} without any arguments.<br />
<br />
==== Using NVIDIA Settings ====<br />
<br />
You can also use the {{ic|nvidia-settings}} tool provided by {{Pkg|nvidia-utils}}. With this method, you will use the proprietary software NVIDIA provides with their drivers. Simply run {{ic|nvidia-settings}} as root, then configure as you wish, and then save the configuration to {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
<br />
==== ConnectedMonitor ====<br />
<br />
If the driver doesn't properly detect a second monitor, you can force it to do so with ConnectedMonitor. <br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
VendorName "Panasonic"<br />
ModelName "Panasonic MICRON 2100Ex"<br />
HorizSync 30.0 - 121.0 # this monitor has incorrect EDID, hence Option "UseEDIDFreqs" "false"<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor2"<br />
VendorName "Gateway"<br />
ModelName "GatewayVX1120"<br />
HorizSync 30.0 - 121.0<br />
VertRefresh 50.0 - 160.0<br />
Option "DPMS"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device2"<br />
Driver "nvidia"<br />
Option "NoLogo"<br />
Option "UseEDIDFreqs" "false"<br />
Option "ConnectedMonitor" "CRT,CRT"<br />
VendorName "NVIDIA Corporation"<br />
BoardName "GeForce 6200 LE"<br />
BusID "PCI:3:0:0"<br />
Screen 1<br />
EndSection<br />
<br />
}}<br />
<br />
The duplicated device with {{ic|Screen}} is how you get X to use two monitors on one card without {{ic|TwinView}}. Note that {{ic|nvidia-settings}} will strip out any {{ic|ConnectedMonitor}} options you have added.<br />
<br />
==== Mosaic mode ====<br />
<br />
Mosaic mode is the only way to use more than 2 monitors across multiple graphics cards with compositing. Your window manager may or may not recognize the distinction between each monitor.<br />
<br />
===== Base mosaic =====<br />
<br />
Base mosaic mode works on any set of Geforce 8000 series or higher GPUs. It cannot be enabled from withing the nvidia-setting GUI. You must either use the nvidia-xconfig command line program or edit xorg.conf by hand. Metamodes must be specified. The following is an example for four DFPs in a 2x2 configuration, each running at 1920x1024, with two DFPs connected to two cards:<br />
$ nvidia-xconfig --base-mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
{{Note|While the documentation lists a 2x2 configuration of monitors, Nvidia has reduced that ability to just 3 monitors in base mosaic mode as of driver version 304. More monitors are available with a Quadro card, but with standard consumer cards, it is limited to three. The explanation given for this reduction is "Feature parity with the Windows driver". As of 9/14/2014, Windows has no restriction on the number of monitors, even on the same driver version. This is not a bug, this is entirely by design.}}<br />
<br />
===== SLI Mosaic =====<br />
<br />
If you have an SLI configuration and each GPU is a Quadro FX 5800, Quadro Fermi or newer then you can use SLI Mosaic mode. It can be enabled from within the nvidia-settings GUI or from the command line with:<br />
$ nvidia-xconfig --sli=Mosaic --metamodes="GPU-0.DFP-0: 1920x1024+0+0, GPU-0.DFP-1: 1920x1024+1920+0, GPU-1.DFP-0: 1920x1024+0+1024, GPU-1.DFP-1: 1920x1024+1920+1024"<br />
<br />
== Tweaking ==<br />
<br />
=== GUI: nvidia-settings ===<br />
<br />
The NVIDIA package includes the {{ic|nvidia-settings}} program that allows adjustment of several additional settings.<br />
<br />
For the settings to be loaded on login, run this command from the terminal:<br />
$ nvidia-settings --load-config-only<br />
<br />
The desktop environment's auto-startup method 'may' not work for loading nvidia-settings properly (KDE). To be sure that settings are really loaded put the command in ~/.xinitrc file (create if not present).<br />
<br />
{{Tip|On rare occasions the {{ic|~/.nvidia-settings-rc}} may become corrupt. If this happens, the Xorg server may crash and the file will have to be deleted to fix the problem.}}<br />
<br />
=== Advanced: 20-nvidia.conf ===<br />
<br />
Edit {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, and add the option to the correct section. The Xorg server will need to be restarted before any changes are applied.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/ NVIDIA Accelerated Linux Graphics Driver README and Installation Guide] for additional details and options.<br />
<br />
==== Disabling the logo on startup ====<br />
<br />
Add the {{ic|"NoLogo"}} option under section {{ic|Device}}:<br />
Option "NoLogo" "1"<br />
<br />
==== Overriding monitor detection ====<br />
<br />
The {{ic|"ConnectedMonitor"}} option under section {{ic|Device}} allows to override monitor detection when X server starts, which may save a significant amount of time at start up. The available options are: {{ic|"CRT"}} for analog connections, {{ic|"DFP"}} for digital monitors and {{ic|"TV"}} for televisions.<br />
<br />
The following statement forces the NVIDIA driver to bypass startup checks and recognize the monitor as DFP:<br />
Option "ConnectedMonitor" "DFP"<br />
{{Note| Use "CRT" for all analog 15 pin VGA connections, even if the display is a flat panel. "DFP" is intended for DVI digital connections only.}}<br />
<br />
==== Enabling brightness control ====<br />
<br />
Add under section {{ic|Device}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
{{Note|If you already have this enabled<br />
and your brightness control doesn't work try to comment it out.}}<br />
<br />
==== Enabling SLI ====<br />
<br />
{{Warning|As of May 7, 2011, you may experience sluggish video performance in GNOME 3 after enabling SLI.}}<br />
<br />
Taken from the NVIDIA driver's [http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html README] appendix: ''This option controls the configuration of SLI rendering in supported configurations.'' A "supported configuration" is a computer equipped with an SLI-Certified Motherboard and 2 or 3 SLI-Certified GeForce GPUs. See NVIDIA's [http://www.slizone.com/page/home.html SLI Zone] for more information.<br />
<br />
Find the first GPU's PCI Bus ID using {{ic|lspci}}:<br />
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<br />
03:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
05:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GTS 512] (rev a2)<br />
}}<br />
<br />
Add the BusID (3 in the previous example) under section {{ic|Device}}:<br />
BusID "PCI:3:0:0"<br />
<br />
{{Note|The format is important. The BusID value must be specified as {{ic|"PCI:<BusID>:0:0"}}}}<br />
<br />
Add the desired SLI rendering mode value under section {{ic|Screen}}:<br />
Option "SLI" "AA"<br />
<br />
The following table presents the available rendering modes.<br />
<br />
{| class="wikitable"<br />
! Value !! Behavior<br />
|-<br />
| 0, no, off, false, Single || Use only a single GPU when rendering.<br />
|-<br />
| 1, yes, on, true, Auto || Enable SLI and allow the driver to automatically select the appropriate rendering mode.<br />
|-<br />
| AFR || Enable SLI and use the alternate frame rendering mode.<br />
|-<br />
| SFR || Enable SLI and use the split frame rendering mode.<br />
|-<br />
| AA || Enable SLI and use SLI antialiasing. Use this in conjunction with full scene antialiasing to improve visual quality.<br />
|}<br />
<br />
Alternatively, you can use the {{ic|nvidia-xconfig}} utility to insert these changes into {{ic|xorg.conf}} with a single command:<br />
# nvidia-xconfig --busid=PCI:3:0:0 --sli=AA<br />
<br />
To verify that SLI mode is enabled from a shell:<br />
{{hc|<nowiki>$ nvidia-settings -q all | grep SLIMode</nowiki>|<br />
Attribute 'SLIMode' (arch:0.0): AA <br />
'SLIMode' is a string attribute.<br />
'SLIMode' is a read-only attribute.<br />
'SLIMode' can use the following target types: X Screen.<br />
}}<br />
<br />
{{Warning| After enabling SLI, your system may become frozen/non-responsive upon starting xorg. It is advisable that you disable your display manager before restarting.}}<br />
<br />
==== Enabling overclocking ====<br />
<br />
{{Warning|Please note that overclocking may damage hardware and that no responsibility may be placed on the authors of this page due to any damage to any information technology equipment from operating products out of specifications set by the manufacturer.}}<br />
To enable GPU and memory overclocking, place the following line in the {{ic|Device}} section:<br />
Option "Coolbits" "1"<br />
<br />
{{Note|GeForce 400/500/600/700 series Fermi/Kepler cores CAN now, as of version 337.12, be overclocked! Now {{ic|Option "Coolbits" "8"}} needs to be set within the device section of the X configuration file to enable the new overclocking support. If you also want to enable manual GPU fan controls, you need to set {{ic|Option "Coolbits" "12"}}.}}<br />
<br />
This will enable on-the-fly overclocking within an X session by running:<br />
$ nvidia-settings<br />
{{Note|An alternative is to edit and reflash the GPU BIOS either under DOS (preferred), or within a Win32 environment by way of [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,127/orderby,2/page,1/ nvflash]{{Dead link|2013|05|25}} and [http://www.mvktech.net/component/option,com_remository/Itemid,26/func,select/id,135/orderby,2/page,1/ NiBiTor 6.0]{{Dead link|2013|05|25}}. The advantage of BIOS flashing is that not only can voltage limits be raised, but stability is generally improved over software overclocking methods such as Coolbits. [http://ivanvojtko.blogspot.sk/2014/03/how-to-overclock-geforce-460gtx-fermi.html Fermi BIOS modification tutorial]}}<br />
<br />
===== Setting static 2D/3D clocks =====<br />
<br />
Set the following string in the {{ic|Device}} section to enable PowerMizer at its maximum performance level (VSync won't work without this line):<br />
Option "RegistryDwords" "PerfLevelSrc=0x2222"<br />
Set one of the following two strings in the {{ic|Device}} section to enable manual GPU fan control within {{ic|nvidia-settings}}:<br />
Option "Coolbits" "4"<br />
<br />
Option "Coolbits" "5"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Fixing terminal resolution ===<br />
Transitioning from nouveau may cause your startup terminal to display at a lower resolution.<br />
<br />
==== GRUB ====<br />
If you are using GRUB, a possible solution is to edit the {{ic|GRUB_GFXMODE}} line of {{ic|/etc/default/grub}} with desired display resolutions. Multiple resolutions can be specified, including the default {{ic|auto}}, so it is recommended that you edit the line to resemble {{ic|1=GRUB_GFXMODE=<desired resolution>,<fallback such as 1024x768>,auto}}. For more information, refer to [https://www.gnu.org/software/grub/manual/html_node/gfxmode.html#gfxmode the GRUB gfxmode documentation].<br />
<br />
=== Enabling Pure Video HD (VDPAU/VAAPI) ===<br />
<br />
{{Merge|VDPAU|Keep here only the specifics and merge the general information into the main article.}}<br />
<br />
'''Hardware Required:''' <br />
<br />
At least a video card with second generation PureVideo HD [http://en.wikipedia.org/wiki/Nvidia_PureVideo#Table_of_PureVideo_.28HD.29_GPUs].<br />
<br />
'''Software Required:'''<br />
<br />
Nvidia video cards with the proprietary driver installed will provide video decoding capabilities with the VDPAU interface at different levels according to PureVideo generation.<br />
<br />
You can also add support for the VA-API interface with {{Pkg|libva-vdpau-driver}}.<br />
<br />
Check VA-API support with:<br />
$ vainfo<br />
<br />
To take full advantage of the hardware decoding capability of your video card you will need a media player that supports VDPAU or VA-API.<br />
<br />
To enable hardware acceleration in [[MPlayer]] edit {{ic|~/.mplayer/config}}<br />
<br />
vo=vdpau<br />
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,<br />
<br />
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware.}}<br />
<br />
To enable hardware acceleration in [[VLC media player|VLC]] go:<br />
<br />
{{ic|Tools > Preferences > Input & Codecs}}, then select {{ic|VDPAU}} as {{ic|'''Hardware-accelerated decoding'''}}<br />
<br />
To enable hardware acceleration in '''smplayer''' go:<br />
<br />
{{ic|Options > Preferences > General > Video Tab}}, then select {{ic|vdpau}} as {{ic|'''output driver'''}}<br />
<br />
To enable hardware acceleration in '''gnome-mplayer''' go:<br />
<br />
{{ic|Edit > Preference}}, then set {{ic|'''video output'''}} to {{ic|vdpau}}<br />
<br />
'''Playing HD movies on cards with low memory:'''<br />
<br />
If your graphic card does not have a lot of memory (>512MB?), you can experience glitches when watching 1080p or even 720p movies.<br />
To avoid that start simple window manager like TWM or MWM.<br />
<br />
Additionally increasing the MPlayer's cache size in {{ic|~/.mplayer/config}} can help, when your hard drive is spinning down when watching HD movies.<br />
<br />
=== Avoid screen tearing in KDE (KWin) ===<br />
<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export __GL_YIELD="USLEEP"<br />
</nowiki>}}<br />
<br />
Also if the above doesn't help, then try this:<br />
{{hc|/etc/profile.d/kwin.sh|<nowiki><br />
export KWIN_TRIPLE_BUFFER=1<br />
</nowiki>}}<br />
<br />
Do not have both of the above enabled at the same time.<br />
Also if you enable triple buffering make sure to enable TripleBuffering for the driver itself.<br />
Source: https://bugs.kde.org/show_bug.cgi?id=322060<br />
<br />
=== Hardware accelerated video decoding with XvMC ===<br />
<br />
Accelerated decoding of MPEG-1 and MPEG-2 videos via [[XvMC]] are supported on GeForce4, GeForce 5 FX, GeForce 6 and GeForce 7 series cards. To use it, create a new file {{ic|/etc/X11/XvMCConfig}} with the following content:<br />
libXvMCNVIDIA_dynamic.so.1<br />
<br />
See how to configure [[XvMC#Supported software|supported software]].<br />
<br />
=== Using TV-out ===<br />
<br />
A good article on the subject can be found [http://en.wikibooks.org/wiki/NVidia/TV-OUT here].<br />
<br />
=== X with a TV (DFP) as the only display ===<br />
<br />
The X server falls back to CRT-0 if no monitor is automatically detected. This can be a problem when using a DVI connected TV as the main display, and X is started while the TV is turned off or otherwise disconnected.<br />
<br />
To force NVIDIA to use DFP, store a copy of the EDID somewhere in the filesystem so that X can parse the file instead of reading EDID from the TV/DFP.<br />
<br />
To acquire the EDID, start nvidia-settings. It will show some information in tree format, ignore the rest of the settings for now and select the GPU (the corresponding entry should be titled "GPU-0" or similar), click the {{ic|DFP}} section (again, {{ic|DFP-0}} or similar), click on the {{ic|Acquire Edid}} Button and store it somewhere, for example, {{ic|/etc/X11/dfp0.edid}}.<br />
<br />
Edit {{ic|xorg.conf}} by adding to the {{ic|Device}} section:<br />
Option "ConnectedMonitor" "DFP"<br />
Option "CustomEDID" "DFP-0:/etc/X11/dfp0.edid"<br />
The {{ic|ConnectedMonitor}} option forces the driver to recognize the DFP as if it were connected. The {{ic|CustomEDID}} provides EDID data for the device, meaning that it will start up just as if the TV/DFP was connected during X the process.<br />
<br />
This way, one can automatically start a display manager at boot time and still have a working and properly configured X screen by the time the TV gets powered on.<br />
<br />
=== Check the power source ===<br />
<br />
The NVIDIA X.org driver can also be used to detect the GPU's current source of power. To see the current power source, check the 'GPUPowerSource' read-only parameter (0 - AC, 1 - battery):<br />
<br />
{{hc|$ nvidia-settings -q GPUPowerSource -t|1}}<br />
<br />
If you're seeing an error message similiar to the one below, then you either need to install [[acpid]] or start the systemd service via {{ic|systemctl start acpid.service}}<br />
ACPI: failed to connect to the ACPI event daemon; the daemon<br />
may not be running or the "AcpidSocketPath" X<br />
configuration option may not be set correctly. When the<br />
ACPI event daemon is available, the NVIDIA X driver will<br />
try to use it to receive ACPI event notifications. For<br />
details, please see the "ConnectToAcpid" and<br />
"AcpidSocketPath" X configuration options in Appendix B: X<br />
Config Options in the README.<br />
(If you are not seeing this error, it is not necessary to install/run acpid soley for this purpose. My current power source is correctly reported without acpid even installed.)<br />
<br />
=== Displaying GPU temperature in the shell ===<br />
<br />
==== Method 1 - nvidia-settings ====<br />
<br />
{{Note|This method requires that you are using X. Use Method 2 or Method 3 if you are not. Also note that Method 3 currently does not not work with newer NVIDIA cards such as GeForce 200 series cards as well as embedded GPUs such as the Zotac IONITX's 8800GS.}}<br />
<br />
To display the GPU temp in the shell, use {{ic|nvidia-settings}} as follows:<br />
$ nvidia-settings -q gpucoretemp<br />
<br />
This will output something similar to the following:<br />
Attribute 'GPUCoreTemp' (hostname:0.0): 41.<br />
'GPUCoreTemp' is an integer attribute.<br />
'GPUCoreTemp' is a read-only attribute.<br />
'GPUCoreTemp' can use the following target types: X Screen, GPU.<br />
<br />
The GPU temps of this board is 41 C.<br />
<br />
In order to get just the temperature for use in utils such as {{ic|rrdtool}} or {{ic|conky}}, among others:<br />
{{hc|$ nvidia-settings -q gpucoretemp -t|41}}<br />
<br />
==== Method 2 - nvidia-smi ====<br />
<br />
Use nvidia-smi which can read temps directly from the GPU without the need to use X at all. This is important for a small group of users who do not have X running on their boxes, perhaps because the box is headless running server apps. <br />
To display the GPU temperature in the shell, use nvidia-smi as follows:<br />
<br />
$ nvidia-smi<br />
<br />
This should output something similar to the following:<br />
{{hc|$ nvidia-smi|<nowiki><br />
Fri Jan 6 18:53:54 2012 <br />
+------------------------------------------------------+ <br />
| NVIDIA-SMI 2.290.10 Driver Version: 290.10 | <br />
|-------------------------------+----------------------+----------------------+<br />
| Nb. Name | Bus Id Disp. | Volatile ECC SB / DB |<br />
| Fan Temp Power Usage /Cap | Memory Usage | GPU Util. Compute M. |<br />
|===============================+======================+======================|<br />
| 0. GeForce 8500 GT | 0000:01:00.0 N/A | N/A N/A |<br />
| 30% 62 C N/A N/A / N/A | 17% 42MB / 255MB | N/A Default |<br />
|-------------------------------+----------------------+----------------------|<br />
| Compute processes: GPU Memory |<br />
| GPU PID Process name Usage |<br />
|=============================================================================|<br />
| 0. ERROR: Not Supported |<br />
+-----------------------------------------------------------------------------+<br />
</nowiki><br />
}}<br />
<br />
Only for temperature:<br />
{{hc|$ nvidia-smi -q -d TEMPERATURE|<nowiki><br />
<br />
==============NVSMI LOG==============<br />
<br />
Timestamp : Fri Jan 6 18:50:57 2012<br />
<br />
Driver Version : 290.10<br />
<br />
Attached GPUs : 1<br />
<br />
GPU 0000:01:00.0<br />
Temperature<br />
Gpu : 62 C<br />
<br />
</nowiki><br />
}}<br />
<br />
In order to get just the temperature for use in utils such as rrdtool or conky, among others:<br />
<br />
{{hc|<nowiki>$ nvidia-smi -q -d TEMPERATURE | grep Gpu | cut -c35-36</nowiki>|62}}<br />
<br />
Reference: http://www.question-defense.com/2010/03/22/gpu-linux-shell-temp-get-nvidia-gpu-temperatures-via-linux-cli.<br />
<br />
==== Method 3 - nvclock ====<br />
<br />
Use {{AUR|nvclock}} which is available from the [[AUR]].<br />
{{Note|{{ic|nvclock}} cannot access thermal sensors on newer NVIDIA cards such as Geforce 200 series cards.}}<br />
<br />
There can be significant differences between the temperatures reported by nvclock and nvidia-settings/nv-control. According to [http://sourceforge.net/projects/nvclock/forums/forum/67426/topic/1906899 this post] by the author (thunderbird) of nvclock, the nvclock values should be more accurate.<br />
<br />
=== Set fan speed at login ===<br />
<br />
You can adjust the fan speed on your graphics card with ''nvidia-settings''' console interface. First ensure that your Xorg configuration sets the Coolbits option to {{ic|4}}, {{ic|5}} or {{ic|12}} for fermi and above in your {{ic|Device}} section to enable fan control.<br />
<br />
Option "Coolbits" "4"<br />
<br />
{{Note|GeForce 400/500 series cards cannot currently set fan speeds at login using this method. This method only allows for the setting of fan speeds within the current X session by way of nvidia-settings.}}<br />
<br />
Place the following line in your [[xinitrc|{{ic|~/.xinitrc}}]] file to adjust the fan when you launch Xorg. Replace {{ic|''n''}} with the fan speed percentage you want to set.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
<br />
You can also configure a second GPU by incrementing the GPU and fan number.<br />
<br />
nvidia-settings -a "[gpu:0]/GPUFanControlState=1" \ <br />
-a "[gpu:1]/GPUFanControlState=1" \<br />
-a "[fan:0]/GPUCurrentFanSpeed=''n''" \<br />
-a [fan:1]/GPUCurrentFanSpeed=''n''" &<br />
<br />
If you use a login manager such as GDM or KDM, you can create a desktop entry file to process this setting. Create {{ic|~/.config/autostart/nvidia-fan-speed.desktop}} and place this text inside it. Again, change {{ic|''n''}} to the speed percentage you want.<br />
<br />
[Desktop Entry]<br />
Type=Application<br />
Exec=nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan:0]/GPUCurrentFanSpeed=''n''"<br />
X-GNOME-Autostart-enabled=true<br />
Name=nvidia-fan-speed<br />
<br />
=== Order of install/deinstall for changing drivers ===<br />
<br />
Where the old driver is nvidiaO and the new driver is nvidiaN.<br />
remove nvidiaO<br />
install nvidia-libglN<br />
install nvidiaN<br />
install lib32-nvidia-libgl-N (if required)<br />
<br />
=== Switching between NVIDIA and nouveau drivers ===<br />
<br />
{{Warning|The {{ic|-Rdds}} switch is used as the installation otherwise fails due to unstatisfied dependencies.}}<br />
<br />
If you need to switch between drivers, you may use the following script, run as root (say yes to all confirmations):<br />
<br />
{{bc|1=<nowiki><br />
#!/bin/bash<br />
BRANCH=340xx<br />
#BRANCH=304xx<br />
<br />
NVIDIA="nvidia-$BRANCH"<br />
_NVIDIA="$(pacman -Qqs ^${NVIDIA}$)"<br />
NOUVEAU="xf86-video-nouveau mesa-libgl"<br />
_NOUVEAU="$(pacman -Qqs ^mesa-libgl$)"<br />
<br />
if [[ ! $_NVIDIA ]]; then<br />
pacman -Rdds "$NOUVEAU"<br />
pacman -S "$NVIDIA" #lib32-$NVIDIA-libgl #$NVIDIA-lts<br />
elif [[ ! $_NOUVEAU ]]; then<br />
pacman -Rdds "$_NVIDIA"<br />
pacman -S "$NOUVEAU" #lib32-mesa-libgl<br />
fi<br />
</nowiki>}}<br />
<br />
Uncomment the lib32 packages if you run a 64-bit system and require the 32-bit libraries (e.g. 32-bit games/Steam).<br />
<br />
=== Avoid tearing with GeForce 600/700 series cards === <br />
<br />
Adding the following line to the {{ic|"Screen"}} section of your X11 configuration file, for example {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}}, will eliminate tearing entirely, regardless of the compositor you are using. It has been reported to reduce the performance of some OpenGL applications, though.<br />
<br />
Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"<br />
<br />
== Troubleshooting ==<br />
<br />
=== Gaming using TwinView ===<br />
<br />
In case you want to play fullscreen games when using TwinView, you will notice that games recognize the two screens as being one big screen. While this is technically correct (the virtual X screen really is the size of your screens combined), you probably do not want to play on both screens at the same time. <br />
<br />
To correct this behavior for SDL, try:<br />
export SDL_VIDEO_FULLSCREEN_HEAD=1<br />
<br />
For OpenGL, add the appropriate Metamodes to your xorg.conf in section {{ic|Device}} and restart X:<br />
Option "Metamodes" "1680x1050,1680x1050; 1280x1024,1280x1024; 1680x1050,NULL; 1280x1024,NULL;"<br />
<br />
Another method that may either work alone or in conjunction with those mentioned above is [[Gaming#Starting_games_in_a_separate_X_server|starting games in a separate X server]].<br />
<br />
=== Vertical sync using TwinView ===<br />
<br />
If you're using TwinView and vertical sync (the "Sync to VBlank" option in '''nvidia-settings'''), you will notice that only one screen is being properly synced, unless you have two identical monitors. Although '''nvidia-settings''' does offer an option to change which screen is being synced (the "Sync to this display device" option), this does not always work. A solution is to add the following environment variables at startup, for example append in {{ic|/etc/profile}}:<br />
<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_SYNC_DISPLAY_DEVICE=DFP-0<br />
export __VDPAU_NVIDIA_SYNC_DISPLAY_DEVICE=DFP-0<br />
<br />
You can change {{ic|DFP-0}} with your preferred screen ({{ic|DFP-0}} is the DVI port and {{ic|CRT-0}} is the VGA port). You can find the identifier for your display from '''nvidia-settings''' in the "X Server XVideoSettings" section.<br />
<br />
=== Old Xorg settings ===<br />
<br />
If upgrading from an old installation, please remove old {{ic|/usr/X11R6/}} paths as it can cause trouble during installation.<br />
<br />
=== Corrupted screen: "Six screens" Problem ===<br />
<br />
For some users, using GeForce GT 100M's, the screen gets corrupted after X starts, divided into 6 sections with a resolution limited to 640x480.<br />
The same problem has been recently reported with Quadro 2000 and hi-res displays.<br />
<br />
To solve this problem, enable the Validation Mode {{ic|NoTotalSizeCheck}} in section {{ic|Device}}:<br />
Section "Device"<br />
...<br />
Option "ModeValidation" "NoTotalSizeCheck"<br />
...<br />
EndSection<br />
<br />
=== '/dev/nvidia0' input/output error ===<br />
<br />
{{Accuracy|Verify that the BIOS related suggestions work and are not coincidentally set while troubleshooting.|section='/dev/nvidia0' Input/Output error... suggested fixes}}<br />
This error can occur for several different reasons, and the most common solution given for this error is to check for group/file permissions, which in almost every case is ''not'' the problem. The NVIDIA documentation does not talk in detail on what you should<br />
do to correct this problem but there are a few things that have worked for some people. The problem can be a IRQ conflict with another device or bad routing by either the kernel or your BIOS.<br />
<br />
First thing to try is to remove other video devices such as video capture cards and see if the problem goes away. If there are too many video processors on the same system it can lead into the kernel being unable to start them because of memory allocation problems with the video controller. In particular on systems with low video memory this can occur even if there is only one video processor. In such case you should find out the amount of your system's video memory (e.g. with {{ic|lspci -v}}) and pass allocation parameters to the kernel, e.g.:<br />
vmalloc=64M<br />
or<br />
vmalloc=256M<br />
<br />
If running a 64bit kernel, a driver defect can cause the NVIDIA module to fail initializing when IOMMU is on. Turning it off in the BIOS has been confirmed to work for some users. [http://www.nvnews.net/vbulletin/showthread.php?s=68bb2fabadcb53b10b286aa42d13c5bc&t=159335][[User:Clickthem#nvidia module]]<br />
<br />
Another thing to try is to change your BIOS IRQ routing from {{ic|Operating system controlled}} to {{ic|BIOS controlled}} or the other way around. The first one can be passed as a kernel parameter:<br />
PCI=biosirq<br />
<br />
The {{ic|noacpi}} kernel parameter has also been suggested as a solution but since it disables ACPI completely it should be used with caution. Some hardware are easily damaged by overheating.<br />
<br />
{{Note|The kernel parameters can be passed either through the kernel command line or the bootloader configuration file. See your bootloader Wiki page for more information.}}<br />
<br />
=== '/dev/nvidiactl' errors ===<br />
<br />
Trying to start an OpenGL application might result in errors such as:<br />
Error: Could not open /dev/nvidiactl because the permissions are too<br />
restrictive. Please see the {{ic|FREQUENTLY ASKED QUESTIONS}} <br />
section of {{ic|/usr/share/doc/NVIDIA_GLX-1.0/README}} <br />
for steps to correct.<br />
<br />
Solve by adding the appropriate user to the {{ic|video}} group and log in again:<br />
# gpasswd -a username video<br />
<br />
=== 32-bit applications do not start ===<br />
<br />
Under 64-bit systems, installing {{ic|lib32-nvidia-libgl}} that corresponds to the same version installed for the 64-bit driver fixes the problem.<br />
<br />
=== Errors after updating the kernel ===<br />
<br />
If a custom build of NVIDIA's module is used instead of the package from the ''extra'' repository, a recompile is required every time the kernel is updated. Rebooting is generally recommended after updating kernel and graphic drivers.<br />
<br />
=== Crashing in general ===<br />
<br />
* Try disabling {{ic|RenderAccel}} in xorg.conf.<br />
* If Xorg outputs an error about "conflicting memory type" or "failed to allocate primary buffer: out of memory", add {{ic|nopat}} at the end of the {{ic|kernel}} line in {{ic|/boot/grub/menu.lst}}.<br />
* If the NVIDIA compiler complains about different versions of GCC between the current one and the one used for compiling the kernel, add in {{ic|/etc/profile}}:<br />
export IGNORE_CC_MISMATCH=1<br />
* If Xorg is crashing with a "Signal 11" while using nvidia-96xx drivers, try disabling PAT. Pass the argument {{ic|nopat}} to [[kernel parameters]].<br />
More information about troubleshooting the driver can be found in the [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums.]<br />
<br />
=== Bad performance after installing a new driver version ===<br />
<br />
If FPS have dropped in comparison with older drivers, first check if direct rendering is turned on (glxinfo is included in {{Pkg|mesa-demos}}):<br />
$ glxinfo | grep direct<br />
If the command prints:<br />
direct rendering: No<br />
then that could be an indication for the sudden FPS drop.<br />
<br />
A possible solution could be to regress to the previously installed driver version and rebooting afterwards.<br />
<br />
=== CPU spikes with 400 series cards ===<br />
<br />
If you are experiencing intermittent CPU spikes with a 400 series card, it may be caused by PowerMizer constantly changing the GPU's clock frequency. Switching PowerMizer's setting from Adaptive to Performance, add the following to the {{ic|Device}} section of your Xorg configuration:<br />
<br />
Option "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x3322; PowerMizerDefaultAC=0x1"<br />
<br />
=== Laptops: X hangs on login/out, worked around with Ctrl+Alt+Backspace ===<br />
<br />
If, while using the legacy NVIDIA drivers, Xorg hangs on login and logout (particularly with an odd screen split into two black and white/gray pieces), but logging in is still possible via {{ic|Ctrl+Alt+Backspace}} (or whatever the new "kill X" key binding is), try adding this in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options nvidia NVreg_Mobile=1<br />
<br />
One user had luck with this instead, but it makes performance drop significantly for others:<br />
options nvidia NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=33 NVreg_DeviceFileMode=0660 NVreg_SoftEDIDs=0 NVreg_Mobile=1<br />
<br />
Note that {{ic|NVreg_Mobile}} needs to be changed according to the laptop:<br />
* 1 for Dell laptops.<br />
* 2 for non-Compal Toshiba laptops.<br />
* 3 for other laptops.<br />
* 4 for Compal Toshiba laptops.<br />
* 5 for Gateway laptops.<br />
<br />
See [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt NVIDIA Driver's README: Appendix K] for more information.<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
On a laptop, if the NVIDIA driver cannot find any screens, you may have an NVIDIA Optimus setup : an Intel chipset connected to the screen and the video outputs, and a NVIDIA card that does all the hard work and writes to the chipset's video memory.<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [[http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html]] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
==== Possible Workaround ====<br />
<br />
Enter the BIOS and changed the default graphics setting from 'Optimus' to 'Discrete' and the install NVIDIA drivers (295.20-1 at time of writing) recognized the screens.<br />
<br />
Steps:<br />
# Enter BIOS.<br />
# Find Graphics Settings (should be in tab ''Config > Display'').<br />
# Change 'Graphics Device' to 'Discrete Graphics' (Disables Intel integrated graphics).<br />
# Change OS Detection for Nvidia Optimus to "Disabled".<br />
# Save and exit.<br />
<br />
Tested on a Lenovo W520 with a Quadro 1000M and Nvidia Optimus<br />
<br />
=== Screen(s) found, but none have a usable configuration ===<br />
<br />
On a laptop, sometimes NVIDIA driver cannot find the active screen.<br />
It may be caused because you own a graphic card with vga/tv outs.<br />
You should examine Xorg.0.log to see what is wrong.<br />
<br />
Another thing to try is adding invalid {{ic|"ConnectedMonitor" Option}} to {{ic|Section "Device"}}<br />
to force Xorg throws error and shows you how correct it.<br />
[http://http.download.nvidia.com/XFree86/Linux-x86/304.51/README/xconfigoptions.html Here]<br />
more about ConnectedMonitor setting.<br />
<br />
After re-run X see Xorg.0.log to get valid CRT-x,DFP-x,TV-x values.<br />
<br />
{{ic|nvidia-xconfig --query-gpu-info}} could be helpful.<br />
<br />
=== Blackscreen at X startup with new driver ===<br />
<br />
If you have installed an update of Nvidia and you screen stay black after launching Xorg. You have to use the {{ic|<nowiki>rcutree.rcu_idle_gp_delay=1</nowiki>}} [[kernel parameter]].<br />
<br />
You can also try to add the {{ic|nvidia}} module directly to your [[mkinitcpio]] config file.<br />
<br />
=== No brightness control on laptops ===<br />
<br />
Try to add the following line in {{ic|20-nvidia.conf}}:<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
<br />
if the Xorg can't start an tested {{ic|20-nvidia.conf}} is:<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
#BoardName "Quadro NVS 3100M"<br />
Option "RegistryDwords" "EnableBrightnessControl=1"<br />
EndSection<br />
<br />
<br />
<br />
If it is still not working, you can try installing {{AUR|nvidia-bl}} or {{AUR|nvidiabl}}.<br />
<br />
=== Backlight is not turning off in some occasions ===<br />
<br />
By default, DPMS should turn off backlight with the timeouts set or by running xset. However, probably due to a bug in the proprietary Nvidia drivers the result is a blank screen with no powersaving whatsoever. To workaround it, until the bug has been fixed you can use the {{ic|vbetool}} as root.<br />
<br />
Install the {{Pkg|vbetool}} package.<br />
<br />
Turn off your screen on demand and then by pressing a random key backlight turns on again:<br />
<br />
vbetool dpms off && read -n1; vbetool dpms on<br />
<br />
Alternatively, xrandr is able to disable and re-enable monitor outputs without requiring root.<br />
<br />
xrandr --output DP-1 --off; read -n1; xrandr --output DP-1 --auto<br />
<br />
=== Blue tint on videos with Flash ===<br />
<br />
A problem with {{Pkg|flashplugin}} versions 11.2.202.228-1 and 11.2.202.233-1 causes it to send the U/V panes in the incorrect order resulting in a blue tint on certain videos. There are a few potential fixes for this bug:<br />
<br />
# Install the latest {{Pkg|libvdpau}}.<br />
# Patch {{ic|vdpau_trace.so}} with [https://bbs.archlinux.org/viewtopic.php?pid=1078368#p1078368 this makepkg].<br />
# Right click on a video, select "Settings..." and uncheck "Enable hardware acceleration". Reload the page for it to take affect. Note that this disables GPU acceleration.<br />
# [[Downgrading packages|Downgrade]] the {{Pkg|flashplugin}} package to version 11.1.102.63-1 at most.<br />
# Use {{AUR|google-chrome}} with the new Pepper API {{AUR|chromium-pepper-flash}}.<br />
# Try one of the few Flash alternatives.<br />
<br />
The merits of each are discussed in [https://bbs.archlinux.org/viewtopic.php?id=137877 this thread].<br />
<br />
=== Bleeding overlay with Flash ===<br />
<br />
This bug is due to the incorrect colour key being used by the {{Pkg|flashplugin}} version 11.2.202.228-1 and causes the flash content to "leak" into other pages or solid black backgrounds. To avoid this problem simply install the latest {{Pkg|libvdpau}} or export {{ic|1=VDPAU_NVIDIA_NO_OVERLAY=1}} within either your shell profile (E.g. {{ic|~/.bash_profile}} or {{ic|~/.zprofile}}) or {{ic|~/.xinitrc}}<br />
<br />
=== Full system freeze using Flash ===<br />
<br />
If you experience occasional full system freezes (only the mouse is moving) using flashplugin<br />
and get:<br />
<br />
{{hc|/var/log/errors.log|<br />
NVRM: Xid (0000:01:00): 31, Ch 00000007, engmask 00000120, intr 10000000<br />
}}<br />
<br />
A possible workaround is to switch off Hardware Acceleration in Flash, setting<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
Or, if you want to keep Hardware acceleration enabled, you may try to::<br />
export VDPAU_NVIDIA_NO_OVERLAY=1<br />
<br />
...before starting the browser.<br />
Note that this may introduce tearing.<br />
<br />
=== Xorg fails to load or Red Screen of Death ===<br />
<br />
If you get a red screen and use GRUB disable the GRUB framebuffer by editing {{ic|/etc/default/grub}} and uncomment GRUB_TERMINAL_OUTPUT. For more information see [[GRUB#Disable_framebuffer|GRUB]].<br />
<br />
=== Black screen on systems with Intel integrated GPU ===<br />
<br />
If you have an Intel CPU with an integrated GPU (e.g. Intel HD 4000) and have installed the {{Pkg|nvidia}} package, you may experience a black screen on boot, when changing virtual terminal, or when exiting an X session. This may be caused by a conflict between the graphics modules. This is solved by blacklisting the Intel GPU modules. Create the file {{ic|/etc/modprobe.d/blacklist.conf}} and prevent the ''i915'' and ''intel_agp'' modules from loading on boot:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install i915 /usr/bin/false<br />
install intel_agp /usr/bin/false<br />
}}<br />
<br />
=== Black screen on systems with VIA integrated GPU ===<br />
<br />
As above, blacklisting the ''viafb'' module may resolve conflicts with NVIDIA drivers:<br />
<br />
{{hc|/etc/modprobe.d/blacklist.conf|<br />
install viafb /usr/bin/false<br />
}}<br />
<br />
=== X fails with "no screens found" with Intel iGPU ===<br />
<br />
Like above, if you have an Intel CPU with an integrated GPU and X fails to start with <br />
<br />
[ 76.633] (EE) No devices detected.<br />
[ 76.633] Fatal server error:<br />
[ 76.633] no screens found<br />
<br />
then you need to add your discrete card's BusID to your X configuration. Find it:<br />
<br />
{{hc|<nowiki># lspci | grep VGA</nowiki>|<br />
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)<br />
01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1)<br />
}}<br />
<br />
then you fix it by adding it to the card's Device section in your X configuration. In my case:<br />
<br />
{{hc|/etc/X11/xorg.conf.d/10-nvidia.conf|<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
VendorName "NVIDIA Corporation"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
}}<br />
<br />
Note how {{ic|01:00.0}} is written as {{ic|1:0:0}}.<br />
<br />
=== Xorg fails during boot, but otherwise starts fine ===<br />
<br />
On very fast booting systems, systemd may attempt to start the display manager before the NVIDIA driver has fully initialized. You will see a message like the following in your logs only when Xorg runs during boot.<br />
{{hc|/var/log/Xorg.0.log|output=<br />
[ 1.807] (EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module. Please see the<br />
[ 1.807] (EE) NVIDIA(0): system's kernel log for additional error messages and<br />
[ 1.808] (EE) NVIDIA(0): consult the NVIDIA README for details.<br />
[ 1.808] (EE) NVIDIA(0): *** Aborting ***<br />
}}<br />
In this case you will need to establish an ordering dependency from the display manager to the DRI device. First create device units for DRI devices by creating a new udev rules file.<br />
{{hc|/etc/udev/rules.d/99-systemd-dri-devices.rules|output=<br />
ACTION=="add", KERNEL=="card*", SUBSYSTEM=="drm", TAG+="systemd"<br />
}}<br />
Then create dependencies from the display manager to the device(s).<br />
{{hc|/etc/systemd/system/display-manager.service.d/10-wait-for-dri-devices.conf|output=<br />
[Unit]<br />
Wants=dev-dri-card0.device<br />
After=dev-dri-card0.device<br />
}}<br />
If you have additional cards needed for the desktop then list them in Wants and After seperated by spaces.<br />
<br />
=== Flash video players crashes ===<br />
<br />
If you are getting frequent crashes of Flash video players, try to switch off Hardware Acceleration:<br />
<br />
{{hc|/etc/adobe/mms.cfg|2=<br />
EnableLinuxHWVideoDecode=0<br />
}}<br />
<br />
(This problem appeared after installing the proprietary nvidia driver, and was fixed by changing this setting.)<br />
<br />
== See also ==<br />
<br />
* [http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14 NVIDIA forums]<br />
* [http://http.download.nvidia.com/XFree86/Linux-x86/1.0-7182/README/readme.txt Official readme for NVIDIA drivers]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260847GUID Partition Table (简体中文)2013-06-03T07:41:37Z<p>Yafengabc: /* GUID Partition Table(GPT 分区表) */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 作用<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# 扩展分区中的逻辑分区的元数据被存储在一个链表结构。如果一条链路丢失,所有的逻辑分区后的元数据都将丢失。<br />
# MBR只支持1字节的分区类型代码,从而导致一些冲突。<br />
# MBR分区扇区存储信息使用32位LBA值。LBA 使用扇区为 512 比特(较常用)导致 2 TiB 为的磁盘的最大寻址。如果使用 MBR 超过 2 TiB 的磁盘便不能被识别或者是分区。<br />
<br />
== GUID Partition Table(GPT 分区表) ==<br />
GUID 分区表(GPT)使用 GUID 分区定义及其类型(Linux中叫做 UUID ),因此得名。GPT 分区表包括:<br />
{| border="1"<br />
! 硬盘上的位置 !! 作用<br />
|-<br />
| 磁盘的第一逻辑扇区或前 512 字节 || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| 磁盘的第二个逻辑扇区或下一个 512 直接 || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| 最后一个逻辑扇区或最后 512 字节 || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260846GUID Partition Table (简体中文)2013-06-03T07:39:45Z<p>Yafengabc: /* GUID Partition Table */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 作用<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# 扩展分区中的逻辑分区的元数据被存储在一个链表结构。如果一条链路丢失,所有的逻辑分区后的元数据都将丢失。<br />
# MBR只支持1字节的分区类型代码,从而导致一些冲突。<br />
# MBR分区扇区存储信息使用32位LBA值。LBA 使用扇区为 512 比特(较常用)导致 2 TiB 为的磁盘的最大寻址。如果使用 MBR 超过 2 TiB 的磁盘便不能被识别或者是分区。<br />
<br />
== GUID Partition Table(GPT 分区表) ==<br />
GUID 分区表(GPT)使用 GUID 分区定义及其类型(Linux中叫做 UUID ),因此得名。GPT 分区表包括:<br />
{| border="1"<br />
! 硬盘上的位置 !! 作用<br />
|-<br />
| 磁盘的第一逻辑扇区或前 512 字节 || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| 磁盘的第二个逻辑扇区或下一个 512 直接 || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260845GUID Partition Table (简体中文)2013-06-03T07:37:31Z<p>Yafengabc: /* GUID Partition Table */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 作用<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# 扩展分区中的逻辑分区的元数据被存储在一个链表结构。如果一条链路丢失,所有的逻辑分区后的元数据都将丢失。<br />
# MBR只支持1字节的分区类型代码,从而导致一些冲突。<br />
# MBR分区扇区存储信息使用32位LBA值。LBA 使用扇区为 512 比特(较常用)导致 2 TiB 为的磁盘的最大寻址。如果使用 MBR 超过 2 TiB 的磁盘便不能被识别或者是分区。<br />
<br />
== GUID Partition Table ==<br />
GUID 分区表(GPT)使用 GUID 分区定义及其类型(Linux中叫做 UUID ),因此得名。GPT 分区表包括:<br />
{| border="1"<br />
! 硬盘上的位置 !! 作用<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260844GUID Partition Table (简体中文)2013-06-03T07:35:11Z<p>Yafengabc: /* Master Boot Record */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 作用<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# 扩展分区中的逻辑分区的元数据被存储在一个链表结构。如果一条链路丢失,所有的逻辑分区后的元数据都将丢失。<br />
# MBR只支持1字节的分区类型代码,从而导致一些冲突。<br />
# MBR分区扇区存储信息使用32位LBA值。LBA 使用扇区为 512 比特(较常用)导致 2 TiB 为的磁盘的最大寻址。如果使用 MBR 超过 2 TiB 的磁盘便不能被识别或者是分区。<br />
<br />
== GUID Partition Table ==<br />
GUID Partition Table (GPT) uses GUIDs (or UUIDs in linux world) to define partitions and its types, hence the name. The GPT consists of a:<br />
{| border="1"<br />
! Location in the HDD !! Purpose<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260843GUID Partition Table (简体中文)2013-06-03T07:33:51Z<p>Yafengabc: /* MBR 带来的问题 */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 描述<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# 扩展分区中的逻辑分区的元数据被存储在一个链表结构。如果一条链路丢失,所有的逻辑分区后的元数据都将丢失。<br />
# MBR只支持1字节的分区类型代码,从而导致一些冲突。<br />
# MBR分区扇区存储信息使用32位LBA值。LBA 使用扇区为 512 比特(较常用)导致 2 TiB 为的磁盘的最大寻址。如果使用 MBR 超过 2 TiB 的磁盘便不能被识别或者是分区。<br />
<br />
== GUID Partition Table ==<br />
GUID Partition Table (GPT) uses GUIDs (or UUIDs in linux world) to define partitions and its types, hence the name. The GPT consists of a:<br />
{| border="1"<br />
! Location in the HDD !! Purpose<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260842GUID Partition Table (简体中文)2013-06-03T07:32:04Z<p>Yafengabc: /* MBR 带来的问题 */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 描述<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# 扩展分区中的逻辑分区的元数据被存储在一个链表结构。如果一条链路丢失,所有的逻辑分区后的元数据都将丢失。<br />
# MBR只支持1字节的分区类型代码,从而导致一些冲突。<br />
# MBR分区扇区存储信息使用32位LBA值。LBA 使用扇区为512 比特(较常用)导致 2 TiB 为的磁盘的最大寻址。如果使用 MBR 超过 2 TiB 的磁盘便不能被识别或者是分区。<br />
<br />
== GUID Partition Table ==<br />
GUID Partition Table (GPT) uses GUIDs (or UUIDs in linux world) to define partitions and its types, hence the name. The GPT consists of a:<br />
{| border="1"<br />
! Location in the HDD !! Purpose<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260841GUID Partition Table (简体中文)2013-06-03T07:21:06Z<p>Yafengabc: /* MBR 带来的问题 */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 描述<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# Within the extended partition, the logical partitions meta-data is stored in a linked-list structure. If one link is lost, all the logical partitions following that metadata is lost.<br />
# MBR supports only 1 byte partition type codes which leads to many collisions.<br />
# MBR stores partition sector information using 32-bit LBA values. This LBA length along with 512 byte sector size (more commonly used) limits the maximum addressable size of the disk to be 2 TiB. Any space beyond 2 TiB cannot be defined as a partition if MBR partitioning is used.<br />
<br />
== GUID Partition Table ==<br />
GUID Partition Table (GPT) uses GUIDs (or UUIDs in linux world) to define partitions and its types, hence the name. The GPT consists of a:<br />
{| border="1"<br />
! Location in the HDD !! Purpose<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260840GUID Partition Table (简体中文)2013-06-03T07:19:59Z<p>Yafengabc: /* Master Boot Record */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 描述<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
有64字节的空间用来描述主分区的信息。为了扩展它,启用了扩展分区的概念。 An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== MBR 带来的问题 ===<br />
#一块磁盘只能存在 4 个主分区或者是最多 3 个主分区加上 1 个扩展分区(扩展分区里面可以建立任意数量的逻辑分区)。 如果你已经有 3 3个主分区加上一个扩展分区,就算硬盘上还存在一些自由空间,你也不能在上面新建任何的分区。<br />
# Within the extended partition, the logical partitions meta-data is stored in a linked-list structure. If one link is lost, all the logical partitions following that metadata is lost.<br />
# MBR supports only 1 byte partition type codes which leads to many collisions.<br />
# MBR stores partition sector information using 32-bit LBA values. This LBA length along with 512 byte sector size (more commonly used) limits the maximum addressable size of the disk to be 2 TiB. Any space beyond 2 TiB cannot be defined as a partition if MBR partitioning is used.<br />
<br />
== GUID Partition Table ==<br />
GUID Partition Table (GPT) uses GUIDs (or UUIDs in linux world) to define partitions and its types, hence the name. The GPT consists of a:<br />
{| border="1"<br />
! Location in the HDD !! Purpose<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=GUID_Partition_Table_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=260838GUID Partition Table (简体中文)2013-06-03T06:59:03Z<p>Yafengabc: /* Master Boot Record */</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:GUID Partition Table]]<br />
[[es:GUID Partition Table]]<br />
[[tr:Guid_Bölümledirme_Tablosu]]<br />
{{Article summary start}}<br />
{{Article summary text|An overview of the GUID Partition Table.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Unified Extensible Firmware Interface}}<br />
{{Article summary wiki|Master Boot Record}}<br />
{{Article summary wiki|Arch Boot Process}}<br />
{{Article summary end}}<br />
{{Translateme (简体中文)|翻译前请重新从英文页面复制最新版本。}} <br />
GUID Partition Table (GPT) is a new style of partitioning which is part of the [[Unified Extensible Firmware Interface]] Specification, using the [[Wikipedia:Globally unique identifier | globally unique identifier]] for devices. It is different from the [[Master Boot Record]] (the more commonly used partitioning style) in many aspects and has many advantages.<br />
<br />
To understand GPT, it is important to understand what is MBR and what are its disadvantages.<br />
<br />
For any partitioning style, the number of partitions that can be defined is based on the total space allotted for the partition table and the space required for storing the information of a single partition.<br />
<br />
== Master Boot Record ==<br />
存储在硬盘的第一个扇区的MBR分区表分区信息如下<br />
<br />
{| border="1"<br />
! HDD的位置 !! 编码作用<br />
|-<br />
| 前 440 个字节 || MBR引导代码,由BIOS启动。<br />
|-<br />
| 441-446 字节 || MBR磁盘签名。<br />
|-<br />
| 447-510 字节 || 实际的主分区和扩展分区的分区表信息 。(注,此处未列出的逻辑分区)<br />
|-<br />
| 511-512 字节 || MBR引导签名 0xAA55。<br />
|}<br />
<br />
The entire information about the primary partitions is limited to the 64 bytes allotted. To extend this, extended partitions were used. An extended partition is simply a primary partition in the MBR which acts like a container for other partitions called logical partitions. So one is limited to either 4 primary partitions, or 3 primary and 1 extended partitions with many logical partitions inside it.<br />
<br />
=== Problems with MBR ===<br />
# Only 4 primary partitions or 3 primary + 1 extended partitions (with arbitrary number of logical partitions within the extended partition) can be defined. If you have 3 primary + 1 extended partitions, and you have some free space outside the extended partition area, you cannot create a new partition over that free space.<br />
# Within the extended partition, the logical partitions meta-data is stored in a linked-list structure. If one link is lost, all the logical partitions following that metadata is lost.<br />
# MBR supports only 1 byte partition type codes which leads to many collisions.<br />
# MBR stores partition sector information using 32-bit LBA values. This LBA length along with 512 byte sector size (more commonly used) limits the maximum addressable size of the disk to be 2 TiB. Any space beyond 2 TiB cannot be defined as a partition if MBR partitioning is used.<br />
<br />
== GUID Partition Table ==<br />
GUID Partition Table (GPT) uses GUIDs (or UUIDs in linux world) to define partitions and its types, hence the name. The GPT consists of a:<br />
{| border="1"<br />
! Location in the HDD !! Purpose<br />
|-<br />
| First logical sector of the disk or First 512 bytes || Protective MBR - Same as a normal MBR but the 64-byte area contains a single 0xEE type Primary partition entry defined over the entire size of the disk or in case of >2 TiB, upto a partition size of 2 TiB.<br />
|-<br />
| Second logical sector of the disk or Next 512 bytes || Primary GPT Header - Contains the Unique Disk GUID, Location of the Primary Partition Table, Number of possible entries in partition table, CRC32 checksums of itself and the Primary Partition Table, Location of the Secondary (or Backup) GPT Header<br />
|-<br />
| 16 KiB (by default) following the second logical sector of the disk<br />
| Primary GPT Table - 128 Partition entries (by default, can be higher), each with an entry of size 128 bytes (hence total of 16 KiB for 128 partition entries). Sector numbers are stored as 64-bit LBA and each partition has a Partition Type GUID and a Unique Partition GUID.<br />
|-<br />
| 16 KiB (by default) before the last logical sector of the disk || Secondary GPT table - It is byte-for-byte identical to the Primary table. Used mainly for recovery in case the primary partition table is damaged.<br />
|-<br />
| Last logical sector of the disk or Last 512 bytes || Secondary GPT Header - Contains the Unique Disk GUID, Location of the Secondary Partition Table, Number of possible entries in the partition table, CRC32 checksums of itself and the Secondary Partition Table, Location of the Primary GPT Header. This header can be used to recover GPT info in case the primary header is corrupted.<br />
|}<br />
<br />
=== Advantages of GPT ===<br />
# Uses GUIDs (UUIDs) to identify partition types - No collisions.<br />
# Provides a unique disk GUID and unique partition GUID for each partition - A good filesystem-independent way of referencing partitions and disks.<br />
# Arbitary number of partitions - depends on space allocated for the partition table (maximum of 128 partitions) - No need for extended and logical partitions.<br />
# Uses 64-bit LBA for storing Sector numbers - maximum addressable disk size is 2 ZiB.<br />
# Stores a backup header and partition table at the end of the disk that aids in recovery in case the primary ones are damaged.<br />
# CRC32 checksums to detect errors and corruption of the header and partition table.<br />
<br />
=== Kernel Support ===<br />
<br />
{{ic|CONFIG_EFI_PARTITION}} option in the kernel config enables GPT support in the kernel (despite the name EFI PARTITION). This options must be built-in the kernel and not compiled as a loadable module. This option is required even if GPT disks are used only for data storage and not for booting. This option is enabled by default in Arch's {{Pkg|linux}} and {{Pkg|linux-lts}} kernels in [core] repo. In case of a custom kernel enable this option by doing {{ic|1=CONFIG_EFI_PARTITION=y}}.<br />
<br />
== Bootloader Support ==<br />
<br />
=== UEFI systems ===<br />
<br />
All UEFI Bootloaders support GPT disks since GPT is a part of UEFI Specification and thus mandatory for UEFI boot. See [[UEFI_Bootloaders]] for more info.<br />
<br />
=== BIOS systems ===<br />
<br />
* [[GRUB2]] requires a 2 MiB "BIOS Boot Partition" (EF02 type code in gdisk and bios_grub flag in GNU Parted) in BIOS systems to embed its {{ic|core.img}} file due to lack of post-MBR embed gap in GPT disks. Runtime GPT support in GRUB2 is provided by the {{ic|part_gpt}} module. See [[GRUB2#GPT specific instructions]] for more info.<br />
<br />
* [[Syslinux]] requires the {{ic|/boot}} partition to be marked as "Legacy BIOS Bootable" GPT attribute (legacy_boot flag in GNU Parted) to identify the partition containing the syslinux boot files by its MBR boot code {{ic|gptmbr.bin}} . See [[Syslinux#GUID_Partition_Table_aka_GPT]] for more info.<br />
<br />
* [[GRUB Legacy]], present in the AUR as {{AUR|grub-legacy}}, does not support GPT disks. Fedora's heavily patched GRUB Legacy fork {{AUR|grub-legacy-fedora-git}} contains GPT patches from Intel (tested in Fedora, not tested in Arch).<br />
<br />
{{Note|Fedora developers have mentioned that after the release of Fedora 17, grub-legacy-fedora development will stop. Fedora already uses GRUB2 as its default BIOS bootloader since F16. Users are recommended to switch to GRUB2 or Syslinux instead.}}<br />
<br />
* [[LILO]]'s GPT support has not been tested so it is unclear whether it has issues booting in GPT disks.<br />
<br />
== Partitioning Utilities ==<br />
=== GPT fdisk ===<br />
<br />
GPT fdisk is a set of text-mode utilities for editing GPT disks. It consists of gdisk, sgdisk and cgdisk which are equivalent to respective tools from util-linux fdisk (used for MBR disks). It is available in the [extra] repository as {{Pkg|gptfdisk}}.<br />
<br />
{{Note|The fdisk partitioning utilities from util-linux (i.e. fdisk, cfdisk and sfdisk) do not support GPT, and may damage the GPT header and partition table if used on a GPT disk.}}<br />
<br />
==== Convert from MBR to GPT ====<br />
<br />
One of the best features of gdisk (and sgdisk and cgdisk too) is its ability to convert MBR and BSD disklabels to GPT without data loss. Upon conversion, all the MBR primary partitions and the logical partitions become GPT partitions with the correct partition type GUIDs and Unique partition GUIDs created for each partition. <br />
<br />
Just open the MBR disk using gdisk and exit with "w" option to write the changes back to the disk (similar to fdisk) to convert the MBR disk to GPT. '''Watch out for any error and fix them before writing any change to disk''' because you may risk losing data. See http://www.rodsbooks.com/gdisk/mbr2gpt.html for more info. After conversion, the bootloaders will need to be reinstalled to configure them to boot from GPT.<br />
<br />
{{Note|Remember that GPT stores a secondary table at the end of disk. You may have to make sure that the last 1 MiB of the disk is not used by any partition.}}<br />
<br />
=== GNU Parted ===<br />
<br />
In GNU Parted >=3.0, the {{ic|parted}} command-line utility does not support any filesystem related operation, and most of the FS related code has been removed from the libparted, leaving only minimal code required by external applications like gparted. The upstream recommends using the filesystem specific tools or one of the parted's GUI wrappers like gparted (which calls these external tools) for filesystem related operations.<br />
<br />
==See also==<br />
# Wikipedia's Page on [http://en.wikipedia.org/wiki/GUID_Partition_Table GPT] and [http://en.wikipedia.org/wiki/Master_boot_record MBR]<br />
# [http://rodsbooks.com/gdisk/ Homepage of Rod Smith's GPT fdisk tool] and its [http://sourceforge.net/projects/gptfdisk/ Sourceforge.net Project page - gptfdisk]<br />
# Rod Smith's page on [http://rodsbooks.com/gdisk/mbr2gpt.html Converting MBR to GPT] and [http://rodsbooks.com/gdisk/booting.html Booting OSes from GPT]<br />
# Rod Smith's page on the [http://www.rodsbooks.com/linux-fs-code/index.html New Partition Type GUID] for Linux data partitions<br />
# [http://sysresccd.org/Sysresccd-Partitioning-The-new-GPT-disk-layout System Rescue CD's page on GPT]<br />
# Wikipedia page on [http://en.wikipedia.org/wiki/BIOS_Boot_partition BIOS Boot Partition]<br />
# [http://www.ibm.com/developerworks/linux/library/l-gpt/index.html?ca=dgr-lnxw07GPT-Storagedth-lx&S_TACT=105AGY83&S_CMP=grlnxw07 Make the most of large drives with GPT and Linux - IBM Developer Works]<br />
# [http://www.microsoft.com/whdc/device/storage/GPT_FAQ.mspx Microsoft's Windows and GPT FAQ]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54951Distcc (简体中文)2008-12-05T14:06:47Z<p>Yafengabc: /* Daemon的配置 */</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==摘要==<br />
'''distcc''' 是一个程序,设计为将编译任务分布到网络中的参与主机。distcc-daemon将一步分代码发送到distcc-servers上编译,并返回编译结果,用这种方式,你可以用多部计算机同时编译一个程序,从而加速编译进程。比较爽的是你可以在pacman/srcpac中协同使用(翻译不太准,参考原文:The cool part is you can use it together with pacman/srcpac).<br />
<br />
==措施==<br />
; distcc daemon: 运行着distcc的计算机与服务器分布式的编译代码. daemon编译一部分代源代码并发送另一部分源代码给''DISTCC_HOSTS''中定义的主机。<br />
<br />
; distcc server:计算机与服务器编译从daemon中获取的代码,编译完成后,把编译后的目标代码发送回daemon,然后再接收下一部分代码(如果编译还没完成的话)。<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机都装上distcc,无论是daemon还是server。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。如果是其他的发行版甚至操作系统(你可以在windows上用Cygwin来运行Distcc!),请阅读连接 [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==配置==<br />
现在,Distcc装好了,需要花点时间配置一下:<br />
<br />
===Daemon的配置===<br />
在daemon上, 编辑 ''/etc/makepkg.conf'' (假设daemon在Arch上运行) 并且确保 BUILDENV 中的distcc没有被禁用.例如:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
修改在''export MAKEFLAGS="-j N"''中的N为所有的CPU的个数+1。例如,如果你用3个单核处理器的计算机组成的系统,你应该把N设置为4 。<br />
然后, 编辑 ''/etc/conf.d/distccd'' 并确认下一行在文件中:<br />
DISTCC_HOSTS='serverips'<br />
修改''DISTCC_HOSTS=serverips''中的''serverips''。serverips是一个IP列表。例如<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
经测试此条wiki中可能有误,DISTCC_HOSTS='serverips'应该在 ''/etc/makepkg.conf''中,而不是''/etc/conf.d/distccd'' 中,同时要把本机的ip也加上。<br />
<br />
===server的配置===<br />
编辑''/etc/conf.d/distccd'' 并且增己一行<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
修改''daemonip'' 为daemon的IP. 如果你不这样做的话, 当distcc试图发送代码到服务器的时候,你将收到"connection refused"错误。设置''daemonip''同时可以确保你的server不会从其他daemon接收代码。<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54947Distcc (简体中文)2008-12-05T12:12:58Z<p>Yafengabc: /* Configuration */</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==摘要==<br />
'''distcc''' 是一个程序,设计为将编译任务分布到网络中的参与主机。distcc-daemon将一步分代码发送到distcc-servers上编译,并返回编译结果,用这种方式,你可以用多部计算机同时编译一个程序,从而加速编译进程。比较爽的是你可以在pacman/srcpac中协同使用(翻译不太准,参考原文:The cool part is you can use it together with pacman/srcpac).<br />
<br />
==措施==<br />
; distcc daemon: 运行着distcc的计算机与服务器分布式的编译代码. daemon编译一部分代源代码并发送另一部分源代码给''DISTCC_HOSTS''中定义的主机。<br />
<br />
; distcc server:计算机与服务器编译从daemon中获取的代码,编译完成后,把编译后的目标代码发送回daemon,然后再接收下一部分代码(如果编译还没完成的话)。<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机都装上distcc,无论是daemon还是server。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。如果是其他的发行版甚至操作系统(你可以在windows上用Cygwin来运行Distcc!),请阅读连接 [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==配置==<br />
现在,Distcc装好了,需要花点时间配置一下:<br />
<br />
===Daemon的配置===<br />
在daemon上, 编辑 ''/etc/makepkg.conf'' (假设daemon在Arch上运行) 并且确保 BUILDENV 中的distcc没有被禁用.例如:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
修改在''export MAKEFLAGS="-j N"''中的N为所有的CPU的个数+1。例如,如果你用3个单核处理器组成的系统,你应该把N设置为4 。<br />
然后, 编辑 ''/etc/conf.d/distccd'' 并确认下一行在文件中:<br />
DISTCC_HOSTS='serverips'<br />
修改''DISTCC_HOSTS=serverips''中的''serverips''。serverips是一个IP列表。例如<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server的配置===<br />
编辑''/etc/conf.d/distccd'' 并且增己一行<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
修改''daemonip'' 为daemon的IP. 如果你不这样做的话, 当distcc试图发送代码到服务器的时候,你将收到"connection refused"错误。设置''daemonip''同时可以确保你的server不会从其他daemon接收代码。<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54946Distcc (简体中文)2008-12-05T11:44:55Z<p>Yafengabc: /* 从这里开始 */</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==摘要==<br />
'''distcc''' 是一个程序,设计为将编译任务分布到网络中的参与主机。distcc-daemon将一步分代码发送到distcc-servers上编译,并返回编译结果,用这种方式,你可以用多部计算机同时编译一个程序,从而加速编译进程。比较爽的是你可以在pacman/srcpac中协同使用(翻译不太准,参考原文:The cool part is you can use it together with pacman/srcpac).<br />
<br />
==措施==<br />
; distcc daemon: 运行着distcc的计算机与服务器分布式的编译代码. daemon编译一部分代源代码并发送另一部分源代码给''DISTCC_HOSTS''中定义的主机。<br />
<br />
; distcc server:计算机与服务器编译从daemon中获取的代码,编译完成后,把编译后的目标代码发送回daemon,然后再接收下一部分代码(如果编译还没完成的话)。<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机都装上distcc,无论是daemon还是server。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。如果是其他的发行版甚至操作系统(你可以在windows上用Cygwin来运行Distcc!),请阅读连接 [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54945Distcc (简体中文)2008-12-05T11:41:36Z<p>Yafengabc: /* Terms */</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==摘要==<br />
'''distcc''' 是一个程序,设计为将编译任务分布到网络中的参与主机。distcc-daemon将一步分代码发送到distcc-servers上编译,并返回编译结果,用这种方式,你可以用多部计算机同时编译一个程序,从而加速编译进程。比较爽的是你可以在pacman/srcpac中协同使用(翻译不太准,参考原文:The cool part is you can use it together with pacman/srcpac).<br />
<br />
==措施==<br />
; distcc daemon: 运行着distcc的计算机与服务器分布式的编译代码. daemon编译一部分代源代码并发送另一部分源代码给''DISTCC_HOSTS''中定义的主机。<br />
<br />
; distcc server:计算机与服务器编译从daemon中获取的代码,编译完成后,把编译后的目标代码发送回daemon,然后再接收下一部分代码(如果编译还没完成的话)。<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机装上distcc,无论是服务器还是客户机。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54944Distcc (简体中文)2008-12-05T11:30:45Z<p>Yafengabc: </p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==摘要==<br />
'''distcc''' 是一个程序,设计为将编译任务分布到网络中的参与主机。distcc-daemon将一步分代码发送到distcc-servers上编译,并返回编译结果,用这种方式,你可以用多部计算机同时编译一个程序,从而加速编译进程。比较爽的是你可以在pacman/srcpac中协同使用(翻译不太准,参考原文:The cool part is you can use it together with pacman/srcpac).<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机装上distcc,无论是服务器还是客户机。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54939Distcc (简体中文)2008-12-05T11:14:51Z<p>Yafengabc: /* Summary */</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==摘要==<br />
'''distcc''' is a program that distributes source code among a number of distcc-servers. The distcc-daemon sends parts of the source code to the distcc-servers that compile the code and send back the result to the daemon. This way you can use many machines to compile one program and thus speed up the compilation process. The cool part is you can use it together with pacman/srcpac.<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机装上distcc,无论是服务器还是客户机。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54938Distcc (简体中文)2008-12-05T11:14:04Z<p>Yafengabc: /* Getting started */</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Summary==<br />
'''distcc''' is a program that distributes source code among a number of distcc-servers. The distcc-daemon sends parts of the source code to the distcc-servers that compile the code and send back the result to the daemon. This way you can use many machines to compile one program and thus speed up the compilation process. The cool part is you can use it together with pacman/srcpac.<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==从这里开始==<br />
首先,你需要将所有用到的计算机装上distcc,无论是服务器还是客户机。如果运行的都是Archlinux,简单的都执行''pacman -Sy distcc''就完成了。<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=54937Distcc (简体中文)2008-12-05T11:06:09Z<p>Yafengabc: New page: Category:开发 (简体中文) Category:HOWTOs (简体中文) {{i18n_links_start}} {{i18n_entry|English|Distcc}} {{i18n_entry|简体中文|Distcc(简体中文)}} {{i18n_links_end}...</p>
<hr />
<div>[[Category:开发 (简体中文)]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Summary==<br />
'''distcc''' is a program that distributes source code among a number of distcc-servers. The distcc-daemon sends parts of the source code to the distcc-servers that compile the code and send back the result to the daemon. This way you can use many machines to compile one program and thus speed up the compilation process. The cool part is you can use it together with pacman/srcpac.<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==Getting started==<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc&diff=54936Distcc2008-12-05T11:04:56Z<p>Yafengabc: </p>
<hr />
<div>[[Category:Development (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
==Summary==<br />
'''distcc''' is a program that distributes source code among a number of distcc-servers. The distcc-daemon sends parts of the source code to the distcc-servers that compile the code and send back the result to the daemon. This way you can use many machines to compile one program and thus speed up the compilation process. The cool part is you can use it together with pacman/srcpac.<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==Getting started==<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc&diff=54935Distcc2008-12-05T11:04:18Z<p>Yafengabc: </p>
<hr />
<div>[[Category:Development (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc(zh)}}<br />
{{i18n_links_end}}<br />
<br />
==Summary==<br />
'''distcc''' is a program that distributes source code among a number of distcc-servers. The distcc-daemon sends parts of the source code to the distcc-servers that compile the code and send back the result to the daemon. This way you can use many machines to compile one program and thus speed up the compilation process. The cool part is you can use it together with pacman/srcpac.<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==Getting started==<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Distcc&diff=54932Distcc2008-12-05T10:59:45Z<p>Yafengabc: </p>
<hr />
<div>[[Category:Development (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Distcc}}<br />
{{i18n_entry|简体中文|Distcc}}<br />
{{i18n_links_end}}<br />
<br />
==Summary==<br />
'''distcc''' is a program that distributes source code among a number of distcc-servers. The distcc-daemon sends parts of the source code to the distcc-servers that compile the code and send back the result to the daemon. This way you can use many machines to compile one program and thus speed up the compilation process. The cool part is you can use it together with pacman/srcpac.<br />
<br />
==Terms==<br />
; distcc daemon: The PC or server that's running distcc to distribute the source code. The daemon itself will compile parts of the source code but will also send other parts to the hosts defined in ''DISTCC_HOSTS''.<br />
<br />
; distcc server: The PC or server compiling the source code it gets from the daemon. When it's done compiling, it sends back the object code (i.e. compiled source code) to the daemon, which in turn sends back some more source code (if there's any left to compile).<br />
<br />
==Getting started==<br />
First you need to install distcc on every computer you'll be using, on the daemon aswell as the servers. If you're running Arch, it's as easy as doing ''pacman -Sy distcc''. For other distro's or even OS'es (you can run distcc on a Windows-box using Cygwin!), read the URL [http://distcc.samba.org/doc.html distcc docs].<br />
<br />
==Configuration==<br />
Now that you've got distcc installed, it has to be configured:<br />
<br />
===Daemon configuration===<br />
On the daemon, edit ''/etc/makepkg.conf'' (assuming the daemon is running on Arch) and make sure the BUILDENV has distcc without exclamation mark. For example:<br />
BUILDENV=(fakeroot distcc color !ccache !xdelta)<br />
<br />
Change the ''N'' in ''export MAKEFLAGS="-j N"'' to the amount of CPU's you'll be using + 1. So if you're using three single processor systems, set it to 4.<br />
Now, edit ''/etc/conf.d/distccd'' and make sure the following line is in the file:<br />
DISTCC_HOSTS='serverips'<br />
Change ''serverips'' in ''DISTCC_HOSTS=serverips''. Where serverips is a list of the IP's of the serving computers you will be using, e.g.:<br />
DISTCC_HOSTS='10.0.1.3 10.0.1.4 10.0.2.75'<br />
<br />
===server configuration===<br />
Edit ''/etc/conf.d/distccd'' and add the line<br />
DISTCC_ARGS="--user nobody --allow daemonip"<br />
Change ''daemonip'' to the IP of the daemon. If you don't do this, you'll get "connection refused" errors when distcc is trying to send code to the server. By setting the ''daemonip'', you can also make sure your servers won't accept code from other daemons on your network that aren't yours.<br />
<br />
Edit ''/etc/hosts.allow'' and add the line<br />
distccd: 10.0.1.<br />
Replace ''10.0.1.'' with a comma seperated list of the daemon IP's, or use a notation similar to ''10.0.1.'' to allow a range of IP's: ''10.0.1.'' allow's every IP from 10.0.1.0 to 10.0.1.255 to connect to the server and send it source code. You can also use a CIDR notation: ''10.0.1.0/255.255.255.0'' is the same as ''10.0.1.''.<br />
<br />
If you don't add the above line to ''/etc/hosts.allow'', you'll get error messages like "connection refused" on the daemon, since the server simply won't accept any distccd-connections. Arch's setup is secure by default, remember. ;)<br />
<br />
==Try it out==<br />
Start the distcc daemon on every participating machine (use ''/etc/rc.d/distccd start''). Then put a ''PKGBUILD'' you'd like to make a package of on the daemon. Change to the dir of the ''PKGBUILD'' and simply run ''makepkg''. Keep an eye on the running processes of the daemon and the servers. When ''./configure'' has finished, and the actual compilation takes place, there should be a significant increase of the processor load as the code is compiled. You can also run ''tail -f /var/log/messages.log'' on daemon and server to see what distccd is actually doing.<br />
<br />
Remember to add ''distccd'' to the list of ''DAEMONS'' in ''/etc/rc.conf'' on the daemon and servers if you want distcc to be available immediately after a reboot.<br />
<br />
==Using ''distcc'' for every compilation task==<br />
If you'd like to use ''distcc'' outside of pacman, all you have to do is add the ''export''-lines you added to ''/etc/makepkg.conf'' to ''/etc/profile'': the ''export'''s in ''/etc/makepkg.conf'' are only read on execution of ''makepkg'' or ''makeworld'', ''/etc/profile'' however is executed on login.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=User:Yafengabc&diff=53235User:Yafengabc2008-11-12T13:55:53Z<p>Yafengabc: New page: 一个中国的arch用户,欢迎大家交流。</p>
<hr />
<div>一个中国的arch用户,欢迎大家交流。</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=49629Network configuration (简体中文)/Wireless (简体中文)2008-09-18T07:12:40Z<p>Yafengabc: /* ipw3945 与 ipw4965 */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡(老的)。<br />
#*[http://linuxwireless.org/en/users/Drivers/b43/ b43] for Broadcom 43xx-based cards<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
对于基于Ralink的PCI/PCMCIA的rt2500系列芯片(Ralink的支持802.11g的第一代芯片):<br />
<pre>pacman -S rt2500</pre><br />
支持标准的未加密和WEP的链接的iwconfig工具,尽管它可能对于命令的顺序非常敏感。<br />
<br />
在使用标准wext接口时wpa_supplicant是不被支持的。驱动支持WPA(使用硬件加密),但是用的是一种不标准方式。一些主要的wpa_supplicant(0.6.x)版本可能包含对于这个驱动的特殊支持,而且能用iwpriv命令手动链接到WPA<br />
<br />
详情请见 [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions]。<br />
这对于下面的RT61和RT73一样适用.<br />
<br />
====RT61====<br />
基于PCI/PCMCIA卡的Ralink的后来的802.11g的芯片(包括那些支持转悠的MIMO模式的芯片)。<br />
<br />
详见[[RT61_Wireless|RT61的wiki页面]].<br />
<br />
====RT73====<br />
基于USB设备的Ralink的后一代的802.11g的芯片(包括那些支持受限的MIMO模式的)。<br />
详见[[RT73_Wireless|RT73的wiki页面]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: 我不得不完全移除那些countrycode的选项否则ath0设备不被创建(andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====iwl3945 与 iwl4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (不推荐的方法)====<br />
'''''注意: ipw3945驱动已经停止开发了. 上边提到的iwlwifi应该工作的很好'''''<br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
# pacman -S ipw3945 ipw3945-ucode ipw3945d<br />
<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件(需要root权限)...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
MODULES=(... mii '''ipw3945''' snd-mixer-oss ...)<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
DAEMONS=(syslog-ng '''ipw3945d''' network ...)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
这应当是内核的一部分,是已经被安装的。<br />
<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
从[http://www.prism54.org/ 这里]下载与你的网卡匹配的固件驱动。将文件重命名为'isl3890'。如果不存在/lib/firmware那么创建之,然后将'isl3890'放进去。这应该有效。([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
从[unstable]库中下载并安装'tiacx'包。<br />
pacman -S tiacx<br />
''注意'':如果你发现kernel log中全是关于驱动的废话,很有可能是以为你正同时运行着Kismet和channel-hopping,你应当在/etc/modprobe.conf中添加<br />
options acx debug=0<br />
<br />
----<br />
<br />
====BCM43XX====<br />
Broadcom 43xx系列芯片的使用者有一种使用ndiswrapper的方法。<br />
在2.6.17以上的内核中最好使用bcm43xx驱动.<br />
<br />
#运行 <pre>iwconfig</pre> 或者 <pre>hwd -s</pre> 来检查你是否有一个合适的网卡。我运行hwd -s的输出结果如下<pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre>查看哪种支持设备,请看 [http://bcm43xx.berlios.de/?go=devices here].<br />
#运行<pre>pacman -Sy bcm43xx-fwcutter</pre> 安装firmware cutter application.<br />
#下载网卡的windows 驱动,要从中解压出 firmware.<br />
#如果是从戴尔官网下载,需要在windows或者wine下运行,(因为下载的是.exe文件,点击安装会自动解压到C:\Dell\[driver numbers])) 或者可以尝试这两个 [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] 或者[http://freewebs.com/ronserver/bcm43xx.tar.gz]. 只要把下载到的文件保存到桌面,这样就不需要上面一步了。<br />
#运行 <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> 需要在运行之前新建文件夹 /lib/firmware 。<br />
#重启,确认运行正常。 把 bcm43xx 加入到rc.conf的 modules section里。 Good luck!<br />
<br />
====b43====<br />
相对于bcm43xx,这驱动相对较好解决,而且驱动已经包含在2.6.24及以上的内核中了.<br />
<br />
#运行 <pre>hwd -s</pre> 来检验你是否有一块合适的网卡。我运行hwd -s输出的结果如下: <pre>Network : BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller module: unknown</pre>被支持的设备列表见[http://linuxwireless.org/en/users/Drivers/b43/devices 这里].#重新安装固件驱动。名字是b43-fwcutter。<br />
#下载Broadcom的4.80.53.0版本的受限制的驱动:<pre>wget http://downloads.openwrt.org/sources/broadcom-wl-4.80.53.0.tar.bz2</pre><br />
#解压缩.<pre>tar xjf broadcom-wl-4.80.53.0.tar.bz2</pre><br />
#将当前目录变为一个刚建立的目录,再进入kmod目录: <pre>cd broadcom-wl-4.80.53.0/kmod</pre><br />
#如果你没有/lib/firmware目录那么就建立一个,然后运行 <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta.o</pre><br />
#重启,将你的设备正确配置一下。把b43加入配置文件/etc/rc.conf的modules段!<br />
<br />
====rtl8187====<br />
参见[[Rtl8187_wireless|rtl8187的wiki页面]].<br />
<br />
====zd1211rw====<br />
<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] 是ZyDAS ZD1211 802.11b/g USB WLAN芯片的驱动,最近的版本的内核已经包括了。[http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices|这里]有被支持的设备列表。 你只需要这样安装固件驱动: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: 无线网络管理 =<br />
为了管理已经安装好的无线驱动,并且使无线能正常工作,需要安装一个无线连接管理工具。 The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无线网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无线网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用也更通用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
<br />
文档: [[Netcfg2网络攻略]]<br />
<br />
更多资料在这里: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
这些强大的控制台工具十分有效而且能够实现完全的、手工的控制。这些例子假设你的无线设备是wlan0。将wlan0换成你自己的设备名称。<br />
很多网卡需要你的核心接口是打开的,这样你才能使用无线工具:<br />
ifconfig wlan0 up<br />
扫描可用接入口:<br />
iwlist wlan0 scan<br />
利用扫描结果,告诉你的无线设备去用哪一个接入口。例如:<br />
iwconfig wlan0 essid linksys<br />
然后像平时一样设置网络接口。简单的例子如下:<br />
dhcpcd wlan0<br />
或者<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
<br />
== 第三方无线管理工具 ==<br />
有众多的无线管理方式可以取代上面所说的脚本方式。<br />
<br />
===NetworkManager===<br />
除了能管理有限链接,NetworkManager还提供了一个易于使用的图形界面程序来选择你想要的的无线移动链接。 <br />
<br />
详情请见 [[NetworkManager]]。<br />
<br />
===Wicd===<br />
Wicd 是一个网络管理工具,能够同时管理无线和有线连接。程序是用Python 和 Gtk写的,比NetworkManager对依赖的要求 更少, 非常适合轻量级桌面用户。 Wicd 现在已经被放在extra里面,有适合 i686和x86_64的版本。<br />
<br />
想了解更多,请阅读 [[Wicd]] 的wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar是一个Python/PyGTK2的管理无线配置的程序(''只有''无线的)。它能够扫描可用的网络、为你所选择的网络创建新的配置。<br />
<br />
详情请见[[Wifi Radar]]。<br />
<br />
===Wlassistant===<br />
Wlassistant是一个非常简单直观的图形界面无线网连接管理程序。<br />
安装方法如下:<br />
pacman -S wlassistant<br />
Wlassistant必须以root权限运行:<br />
sudo wlassistant<br />
<br />
一种使用wlassistant管理/etc/rc.conf里面有的无线网卡的方法是指出你经常使用的链连接点。开机后你的网卡就会自动连接到这个essid,但是如果其他的无线网络是需要的/可用的,wlassistant在那时会请求连入它们。通过在名称前加一个@来后台运行/etc/rc.conf中的network守护程序来减少开机等待时间。<br />
<br />
= 其他资源 =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - NetworkManager官方网站<br />
*[http://wicd.sourceforge.net/ WICD] - WICD官方网站<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - Wifi Radar官方网站<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html 一个很少能帮忙的废话连篇的howto]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo madwifi的安装方法,如果你在用Arch的方式安装时遇到了问题]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=49628Network configuration (简体中文)/Wireless (简体中文)2008-09-18T07:11:16Z<p>Yafengabc: /* ipw3945 (另外一个办法) */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡(老的)。<br />
#*[http://linuxwireless.org/en/users/Drivers/b43/ b43] for Broadcom 43xx-based cards<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
对于基于Ralink的PCI/PCMCIA的rt2500系列芯片(Ralink的支持802.11g的第一代芯片):<br />
<pre>pacman -S rt2500</pre><br />
支持标准的未加密和WEP的链接的iwconfig工具,尽管它可能对于命令的顺序非常敏感。<br />
<br />
在使用标准wext接口时wpa_supplicant是不被支持的。驱动支持WPA(使用硬件加密),但是用的是一种不标准方式。一些主要的wpa_supplicant(0.6.x)版本可能包含对于这个驱动的特殊支持,而且能用iwpriv命令手动链接到WPA<br />
<br />
详情请见 [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions]。<br />
这对于下面的RT61和RT73一样适用.<br />
<br />
====RT61====<br />
基于PCI/PCMCIA卡的Ralink的后来的802.11g的芯片(包括那些支持转悠的MIMO模式的芯片)。<br />
<br />
详见[[RT61_Wireless|RT61的wiki页面]].<br />
<br />
====RT73====<br />
基于USB设备的Ralink的后一代的802.11g的芯片(包括那些支持受限的MIMO模式的)。<br />
详见[[RT73_Wireless|RT73的wiki页面]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: 我不得不完全移除那些countrycode的选项否则ath0设备不被创建(andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (不推荐的方法)====<br />
'''''注意: ipw3945驱动已经停止开发了. 上边提到的iwlwifi应该工作的很好'''''<br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
# pacman -S ipw3945 ipw3945-ucode ipw3945d<br />
<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件(需要root权限)...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
MODULES=(... mii '''ipw3945''' snd-mixer-oss ...)<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
DAEMONS=(syslog-ng '''ipw3945d''' network ...)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
这应当是内核的一部分,是已经被安装的。<br />
<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
从[http://www.prism54.org/ 这里]下载与你的网卡匹配的固件驱动。将文件重命名为'isl3890'。如果不存在/lib/firmware那么创建之,然后将'isl3890'放进去。这应该有效。([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
从[unstable]库中下载并安装'tiacx'包。<br />
pacman -S tiacx<br />
''注意'':如果你发现kernel log中全是关于驱动的废话,很有可能是以为你正同时运行着Kismet和channel-hopping,你应当在/etc/modprobe.conf中添加<br />
options acx debug=0<br />
<br />
----<br />
<br />
====BCM43XX====<br />
Broadcom 43xx系列芯片的使用者有一种使用ndiswrapper的方法。<br />
在2.6.17以上的内核中最好使用bcm43xx驱动.<br />
<br />
#运行 <pre>iwconfig</pre> 或者 <pre>hwd -s</pre> 来检查你是否有一个合适的网卡。我运行hwd -s的输出结果如下<pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre>查看哪种支持设备,请看 [http://bcm43xx.berlios.de/?go=devices here].<br />
#运行<pre>pacman -Sy bcm43xx-fwcutter</pre> 安装firmware cutter application.<br />
#下载网卡的windows 驱动,要从中解压出 firmware.<br />
#如果是从戴尔官网下载,需要在windows或者wine下运行,(因为下载的是.exe文件,点击安装会自动解压到C:\Dell\[driver numbers])) 或者可以尝试这两个 [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] 或者[http://freewebs.com/ronserver/bcm43xx.tar.gz]. 只要把下载到的文件保存到桌面,这样就不需要上面一步了。<br />
#运行 <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> 需要在运行之前新建文件夹 /lib/firmware 。<br />
#重启,确认运行正常。 把 bcm43xx 加入到rc.conf的 modules section里。 Good luck!<br />
<br />
====b43====<br />
相对于bcm43xx,这驱动相对较好解决,而且驱动已经包含在2.6.24及以上的内核中了.<br />
<br />
#运行 <pre>hwd -s</pre> 来检验你是否有一块合适的网卡。我运行hwd -s输出的结果如下: <pre>Network : BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller module: unknown</pre>被支持的设备列表见[http://linuxwireless.org/en/users/Drivers/b43/devices 这里].#重新安装固件驱动。名字是b43-fwcutter。<br />
#下载Broadcom的4.80.53.0版本的受限制的驱动:<pre>wget http://downloads.openwrt.org/sources/broadcom-wl-4.80.53.0.tar.bz2</pre><br />
#解压缩.<pre>tar xjf broadcom-wl-4.80.53.0.tar.bz2</pre><br />
#将当前目录变为一个刚建立的目录,再进入kmod目录: <pre>cd broadcom-wl-4.80.53.0/kmod</pre><br />
#如果你没有/lib/firmware目录那么就建立一个,然后运行 <pre>b43-fwcutter -w "/lib/firmware/" wl_apsta.o</pre><br />
#重启,将你的设备正确配置一下。把b43加入配置文件/etc/rc.conf的modules段!<br />
<br />
====rtl8187====<br />
参见[[Rtl8187_wireless|rtl8187的wiki页面]].<br />
<br />
====zd1211rw====<br />
<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] 是ZyDAS ZD1211 802.11b/g USB WLAN芯片的驱动,最近的版本的内核已经包括了。[http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices|这里]有被支持的设备列表。 你只需要这样安装固件驱动: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: 无线网络管理 =<br />
为了管理已经安装好的无线驱动,并且使无线能正常工作,需要安装一个无线连接管理工具。 The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无线网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无线网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用也更通用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
<br />
文档: [[Netcfg2网络攻略]]<br />
<br />
更多资料在这里: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
这些强大的控制台工具十分有效而且能够实现完全的、手工的控制。这些例子假设你的无线设备是wlan0。将wlan0换成你自己的设备名称。<br />
很多网卡需要你的核心接口是打开的,这样你才能使用无线工具:<br />
ifconfig wlan0 up<br />
扫描可用接入口:<br />
iwlist wlan0 scan<br />
利用扫描结果,告诉你的无线设备去用哪一个接入口。例如:<br />
iwconfig wlan0 essid linksys<br />
然后像平时一样设置网络接口。简单的例子如下:<br />
dhcpcd wlan0<br />
或者<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
<br />
== 第三方无线管理工具 ==<br />
有众多的无线管理方式可以取代上面所说的脚本方式。<br />
<br />
===NetworkManager===<br />
除了能管理有限链接,NetworkManager还提供了一个易于使用的图形界面程序来选择你想要的的无线移动链接。 <br />
<br />
详情请见 [[NetworkManager]]。<br />
<br />
===Wicd===<br />
Wicd 是一个网络管理工具,能够同时管理无线和有线连接。程序是用Python 和 Gtk写的,比NetworkManager对依赖的要求 更少, 非常适合轻量级桌面用户。 Wicd 现在已经被放在extra里面,有适合 i686和x86_64的版本。<br />
<br />
想了解更多,请阅读 [[Wicd]] 的wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar是一个Python/PyGTK2的管理无线配置的程序(''只有''无线的)。它能够扫描可用的网络、为你所选择的网络创建新的配置。<br />
<br />
详情请见[[Wifi Radar]]。<br />
<br />
===Wlassistant===<br />
Wlassistant是一个非常简单直观的图形界面无线网连接管理程序。<br />
安装方法如下:<br />
pacman -S wlassistant<br />
Wlassistant必须以root权限运行:<br />
sudo wlassistant<br />
<br />
一种使用wlassistant管理/etc/rc.conf里面有的无线网卡的方法是指出你经常使用的链连接点。开机后你的网卡就会自动连接到这个essid,但是如果其他的无线网络是需要的/可用的,wlassistant在那时会请求连入它们。通过在名称前加一个@来后台运行/etc/rc.conf中的network守护程序来减少开机等待时间。<br />
<br />
= 其他资源 =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - NetworkManager官方网站<br />
*[http://wicd.sourceforge.net/ WICD] - WICD官方网站<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - Wifi Radar官方网站<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html 一个很少能帮忙的废话连篇的howto]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo madwifi的安装方法,如果你在用Arch的方式安装时遇到了问题]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42675Netcfg (简体中文)2008-06-06T03:07:29Z<p>Yafengabc: /* Create profile */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
修改完成后, 你可以用命令 <code>netcfg2 <profile name></code> 或者添加到rc.conf的<code>NETWORKS=()</code> 的那一行,让系统开机时自动加载配置文件。<br />
<br />
==连接到一个无线网络 (详细)==<br />
<br />
=== 搜集网络信息 ===<br />
<br />
* 无线网络接口<br />
** 可以用<code>ifconfig</code>显示或者查看<code>/proc/net/wireless</code><br />
* 网络名称/ESSID<br />
** 检查无线网络是不是在'隐藏'状态 -- 通过<code>iwlist scan</code>能否搜查到呢?<br />
* 网络用什么样的加密系统<br />
** 支持的网络安全结构有:无加密,WEP加密,WPA加密.<br />
* 网络密码是什么<br />
** 只有在网络使用加密时才需要知道<br />
* IP设置, dhcp(自动获取)/static(静态地址)<br />
** 大部分无线网络使用DHCP. 如果不知道的话,使用DHCP好了.<br />
<br />
=== 建立配置文件 ===<br />
在 /etc/network.d/ 下建立一个新的网络配置文件. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42674Netcfg (简体中文)2008-06-06T03:05:11Z<p>Yafengabc: /* 搜集网络信息 */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
修改完成后, 你可以用命令 <code>netcfg2 <profile name></code> 或者添加到rc.conf的<code>NETWORKS=()</code> 的那一行,让系统开机时自动加载配置文件。<br />
<br />
==连接到一个无线网络 (详细)==<br />
<br />
=== 搜集网络信息 ===<br />
<br />
* 无线网络接口<br />
** 可以用<code>ifconfig</code>显示或者查看<code>/proc/net/wireless</code><br />
* 网络名称/ESSID<br />
** 检查无线网络是不是在'隐藏'状态 -- 通过<code>iwlist scan</code>能否搜查到呢?<br />
* 网络用什么样的加密系统<br />
** 支持的网络安全结构有:无加密,WEP加密,WPA加密.<br />
* 网络密码是什么<br />
** 只有在网络使用加密时才需要知道<br />
* IP设置, dhcp(自动获取)/static(静态地址)<br />
** 大部分无线网络使用DHCP. 如果不知道的话,使用DHCP好了.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42672Network configuration (简体中文)/Wireless (简体中文)2008-06-06T02:59:30Z<p>Yafengabc: /* Netcfg2 */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡。<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<pre>pacman -S rt2500</pre><br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (另外一个办法)====<br />
'''''注意:''' 当Intel的iwlwifi驱动足够成熟之后ipw3945驱动就会被淘汰了.''<br />
<br />
<pre>pacman -S ipw3945</pre><br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
Install the 'tiacx' package from the [unstable] repository.<br />
pacman -S tiacx<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] or [http://freewebs.com/ronserver/bcm43xx.tar.gz]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: Wireless Management =<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无限网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无限网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用也更通用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
<br />
文档: [[Netcfg2网络攻略]]<br />
<br />
更多资料在这里: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
These powerful console tools work extremely well and allow complete, manual control. These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.<br />
Many cards require that the kernel interface be activated before you can use the wireless-tools:<br />
ifconfig wlan0 up<br />
See what access points are available:<br />
iwlist wlan0 scan<br />
Using the scan results, tell your wireless device which access point to use. For example:<br />
iwconfig wlan0 essid linksys<br />
Then, setup the network interface as usual. Simple examples are:<br />
dhcpcd wlan0<br />
or<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
== Third-party wireless management ==<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.<br />
<br />
===NetworkManager===<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
===Wicd===<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
===Wlassistant===<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42671Netcfg (简体中文)2008-06-06T02:57:28Z<p>Yafengabc: /* 搜集网络信息 */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
修改完成后, 你可以用命令 <code>netcfg2 <profile name></code> 或者添加到rc.conf的<code>NETWORKS=()</code> 的那一行,让系统开机时自动加载配置文件。<br />
<br />
==连接到一个无线网络 (详细)==<br />
<br />
=== 搜集网络信息 ===<br />
<br />
* 无线网络接口<br />
** 可以用<code>ifconfig</code>显示或者查看<code>/proc/net/wireless</code><br />
* 网络名称/ESSID<br />
** 检查无线网络是不是在'隐藏'状态 -- 通过<code>iwlist scan</code>能否搜查到呢?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42670Netcfg (简体中文)2008-06-06T02:51:19Z<p>Yafengabc: /* Gather information */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
修改完成后, 你可以用命令 <code>netcfg2 <profile name></code> 或者添加到rc.conf的<code>NETWORKS=()</code> 的那一行,让系统开机时自动加载配置文件。<br />
<br />
==连接到一个无线网络 (详细)==<br />
<br />
=== 搜集网络信息 ===<br />
<br />
* 无线网络接口<br />
** 可以用<code>ifconfig</code>显示或者查看<code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42669Netcfg (简体中文)2008-06-06T02:46:39Z<p>Yafengabc: /* Connecting to a wireless network (detailed) */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
修改完成后, 你可以用命令 <code>netcfg2 <profile name></code> 或者添加到rc.conf的<code>NETWORKS=()</code> 的那一行,让系统开机时自动加载配置文件。<br />
<br />
==连接到一个无线网络 (详细)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42668Netcfg (简体中文)2008-06-06T02:45:25Z<p>Yafengabc: /* 连接到一个无线网络(简略) */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
修改完成后, 你可以用命令 <code>netcfg2 <profile name></code> 或者添加到rc.conf的<code>NETWORKS=()</code> 的那一行,让系统开机时自动加载配置文件。<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42667Netcfg (简体中文)2008-06-06T02:42:43Z<p>Yafengabc: /* 连接到一个无线网络(简略)== */</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)==<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
Once adapted, you may connect with <code>netcfg2 <profile name></code> or add it to the <code>NETWORKS=()</code> line in /etc/rc.conf for start on boot.<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42666Netcfg (简体中文)2008-06-06T02:42:22Z<p>Yafengabc: </p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==安装 netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==连接到一个无线网络(简略)====<br />
<br />
从/etc/network.d/examples复制一个例子配置文件到/etc/network.d/,并修改之,使其适应你的网络。<br />
<br />
Once adapted, you may connect with <code>netcfg2 <profile name></code> or add it to the <code>NETWORKS=()</code> line in /etc/rc.conf for start on boot.<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42664Netcfg (简体中文)2008-06-06T02:39:03Z<p>Yafengabc: New page: {{i18n_links_start}} {{i18n_entry|English|Network Profiles}} {{i18n_entry|简体中文|Netcfg2网络攻略}} {{i18n_links_end}} ==Install netcfg v2== pacman -Sy core/netcfg ==Connecting...</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==Install netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==Connecting to a wireless network (short)==<br />
Copy one of the example profiles in /etc/network.d/examples to /etc/network.d/ and then adapt to your network.<br />
<br />
Once adapted, you may connect with <code>netcfg2 <profile name></code> or add it to the <code>NETWORKS=()</code> line in /etc/rc.conf for start on boot.<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg&diff=42663Netcfg2008-06-06T02:38:29Z<p>Yafengabc: </p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|Netcfg2网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==Install netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==Connecting to a wireless network (short)==<br />
Copy one of the example profiles in /etc/network.d/examples to /etc/network.d/ and then adapt to your network.<br />
<br />
Once adapted, you may connect with <code>netcfg2 <profile name></code> or add it to the <code>NETWORKS=()</code> line in /etc/rc.conf for start on boot.<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg&diff=42662Netcfg2008-06-06T02:37:55Z<p>Yafengabc: </p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|网络攻略}}<br />
{{i18n_links_end}}<br />
<br />
==Install netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==Connecting to a wireless network (short)==<br />
Copy one of the example profiles in /etc/network.d/examples to /etc/network.d/ and then adapt to your network.<br />
<br />
Once adapted, you may connect with <code>netcfg2 <profile name></code> or add it to the <code>NETWORKS=()</code> line in /etc/rc.conf for start on boot.<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Netcfg&diff=42661Netcfg2008-06-06T02:37:01Z<p>Yafengabc: </p>
<hr />
<div><br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Network Profiles}}<br />
{{i18n_entry|简体中文|网络配置}}<br />
{{i18n_links_end}}<br />
<br />
==Install netcfg v2==<br />
pacman -Sy core/netcfg<br />
<br />
==Connecting to a wireless network (short)==<br />
Copy one of the example profiles in /etc/network.d/examples to /etc/network.d/ and then adapt to your network.<br />
<br />
Once adapted, you may connect with <code>netcfg2 <profile name></code> or add it to the <code>NETWORKS=()</code> line in /etc/rc.conf for start on boot.<br />
<br />
==Connecting to a wireless network (detailed)==<br />
<br />
=== Gather information ===<br />
<br />
* Wireless network interface<br />
** Can be found with <code>ifconfig</code> or in <code>/proc/net/wireless</code><br />
* Network Name/ESSID<br />
** Check if the network is 'hidden' -- Does it appear when you run <code>iwlist scan</code>?<br />
* What security system is in use<br />
** Supported security mechanisms: None, WPA, and WEP.<br />
* What security key<br />
** Only needed if there's security on the network<br />
* IP settings, dhcp/static<br />
** Most wireless networks use dhcp. If in doubt, use dhcp.<br />
<br />
=== Create profile ===<br />
In /etc/network.d/ and create a new network profile. A profile, is a single file in /etc/network.d. The file name will become the name of the profile, and can be anything you wish, it is not a setting involved in the connection.<br />
<br />
The easiest way to create a new profile, is to copy an existing one such as by copying one of the example profiles from /etc/network.d/examples that use a similar security setup.<br />
<br />
Edit the profile, to contain the information you gathered earlier. For now, leave the scan option set to 'on'<br />
<br />
====Example configurations====<br />
Below are some example connection files. These are also available in /etc/network.d/examples.<br />
<pre><br />
CONNECTION="wireless"<br />
DESCRIPTION="A simple WEP encrypted wireless connection"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wep"<br />
ESSID="MyNetwork"<br />
KEY="1234567890"<br />
IP="dhcp"<br />
</pre><br />
<pre><br />
CONNECTION="wireless"<br />
INTERFACE=wlan0<br />
SCAN="yes"<br />
SECURITY="wpa"<br />
ESSID="mynetwork"<br />
KEY="SomePasskey"<br />
IP="dhcp"<br />
TIMEOUT=20<br />
</pre><br />
<br />
For detailed static configuration, and further options, see the wireless(8) and ethernet(8) manual pages.<br />
<br />
===Connect===<br />
Now that the configuration is set you can just run, <code>netcfg2 profile-name</code> to connect your network if it is available.<br />
<br />
To have the network be connected on boot, add the profile-name to the <code>NETWORKS=()</code> line in rc.conf, eg:<br />
<code>NETWORKS=(home)</code>.<br />
<br />
'''Ensure that <code>net-profiles</code> is in your rc.conf <code>DAEMONS=()</code> line.'''<br />
<br />
If you cannot connect to the network, see if your problem is listed below. If you have further difficulties, follow the instructions below and seek help on the arch forums, IRC or mailing lists.<br />
<br />
==Automatic Detection==<br />
<br />
As of netcfg v2.0.3, netcfg has wireless network detection support. To detect on boot, add "auto-wireless <interface>" to your NETWORKS=() line. This can even be added among other profiles, for example:<br />
<br />
NETWORKS=("auto-wireless <interface>" ipw0 ethernet)<br />
<br />
To run after boot, run: /usr/bin/netcfg-auto-wireless $interface<br />
<br />
Alternatively, for detection on boot, you may set SCAN="yes" in each profile, and add them to NETWORKS=() in /etc/rc.conf. This will check each network if it is available, and connect if it is, then ignore others.<br />
<br />
==Troubleshooting==<br />
===It doesn't work!! What's wrong?===<br />
Woa, that sucks doesn't it?<br />
<br />
===No really, it doesn't work, can you help?===<br />
See the below question. To be able to determine what's wrong, we need information! But first, try reading the rest of the troubleshooting section or search the forum.<br />
<br />
===What do I do if this doesn't work?===<br />
Check through all the FAQs below. If they do not contain a solution, the next best place to go is the forums, or the mailing list.<br />
<br />
When you post, make sure that you provide the following output:<br />
* ALL OUTPUT FROM netcfg - this one is important, even if netcfg appears to succeed<br />
* ifconfig -a<br />
* iwconfig before attempting to connect<br />
* the /etc/network.d/ profile file with the wireless key replaced by <censored><br />
* lsmod<br />
Rather than scripting a long post/email, the best place to put all this is a pastebin. [http://pastie.caboo.se/ Pastie] and [http://www.rafb.net/paste/ rafb|Nopaste] are two popular ones within the Arch community. There is also a cli frontend for rafb:<br />
pacman -S nopaste<br />
<br />
===Network unavailable===<br />
This is typically one of:<br />
* Out of range<br />
* Driver issue<br />
* Trying to connect to a hidden network<br />
<br />
If you know your network is hidden, set <br />
SCAN=no <br />
<br />
===Wireless Association failed===<br />
This is typically one of:<br />
* Out of range/reception<br />
* Incorrect configuration<br />
* Invalid key<br />
* Driver problem<br />
<br />
If it is a range problem, increasing TIMEOUT= can help.<br />
<br />
===Unable to get IP address with DHCP===<br />
This is typically one of:<br />
* Out of range/reception<br />
<br />
Try increasing DHCP_TIMEOUT<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set CONNECTION= to "ethernet", "ppp", or "wireless".<br />
<br />
===Using a string WEP key===<br />
This is for a STRING WEP key, not a HEX WEP key, not a WPA key.<br />
KEY="s:Somepasskey"<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
<br />
I have no intention of supporting these. rt2x00 is supported however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed iwpriv commands, and put it's path in PRE_UP=""<br />
<br />
==GUI==<br />
<br />
A Qt-based netcfg2 frontend called ArchAssistant exists. It proposes to manage & connect/disconnect profiles from a systray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
[http://aur.archlinux.org/packages.php?ID=15655 archassistant on AUR] | [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] | archassistant package on archlinux.fr [http://repo.archlinux.fr/i686/ i686] and [http://repo.archlinux.fr/x86_64/ x86_64]<br />
<br />
==FAQ==<br />
===How do I get a menu at boot, like the old netcfg?===<br />
In rc.conf set NETWORKS=() to menu.<br />
<br />
You can also access that menu any time by running netcfg-menu in a terminal<br />
<br />
===Why doesnt netcfg do ''x''?===<br />
netcfg doesn't need to. It connects to networks.<br />
<br />
But netcfg is super modular and re-usable. Have a look at /usr/lib/networks/ -- heaps of reusable functions for your own scripts. <br />
<br />
===Why doesn't netcfg behave in this way? It makes more sense===<br />
netcfg doesn't enforce any rules. It's task is to connect to networks. It doesn't impose any heuristics, like 'disconnect from wireless if ethernet is connected'.<br />
<br />
If you want behaviour like that, it'd be really easy to write a separate tool over netcfg. See the question above.<br />
<br />
===Do I still need ''x'' when I'm using netcfg?===<br />
<br />
* /etc/hosts: Yes, you still need this, this is important. Don't remove your hostname from this otherwise you'll have some odd problems. <br />
* HOSTNAME= in /etc/rc.conf: It's strongly recommended you keep this, otherwise no hostname will be set if a profile fails<br />
* DAEMONS=(network)/INTERFACES=() in /etc/rc.conf: If you've setup all your networks with netcfg2 instead, yes, you can remove this. You can also safely remove lo, it's been moved into rc.sysinit.<br />
* lo: This is now in rc.sysinit, you don't need to configure it anywhere.</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42106Network configuration (简体中文)/Wireless (简体中文)2008-05-28T08:46:00Z<p>Yafengabc: /* Netcfg2 */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡。<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<pre>pacman -S rt2500</pre><br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (另外一个办法)====<br />
'''''注意:''' 当Intel的iwlwifi驱动足够成熟之后ipw3945驱动就会被淘汰了.''<br />
<br />
<pre>pacman -S ipw3945</pre><br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
Install the 'tiacx' package from the [unstable] repository.<br />
pacman -S tiacx<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] or [http://freewebs.com/ronserver/bcm43xx.tar.gz]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: Wireless Management =<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无限网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无限网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用也更通用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
<br />
文档: [[Network Profiles]]<br />
<br />
更多资料在这里: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
These powerful console tools work extremely well and allow complete, manual control. These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.<br />
Many cards require that the kernel interface be activated before you can use the wireless-tools:<br />
ifconfig wlan0 up<br />
See what access points are available:<br />
iwlist wlan0 scan<br />
Using the scan results, tell your wireless device which access point to use. For example:<br />
iwconfig wlan0 essid linksys<br />
Then, setup the network interface as usual. Simple examples are:<br />
dhcpcd wlan0<br />
or<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
== Third-party wireless management ==<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.<br />
<br />
===NetworkManager===<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
===Wicd===<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
===Wlassistant===<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42105Network configuration (简体中文)/Wireless (简体中文)2008-05-28T08:45:34Z<p>Yafengabc: /* Netcfg2 */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡。<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<pre>pacman -S rt2500</pre><br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (另外一个办法)====<br />
'''''注意:''' 当Intel的iwlwifi驱动足够成熟之后ipw3945驱动就会被淘汰了.''<br />
<br />
<pre>pacman -S ipw3945</pre><br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
Install the 'tiacx' package from the [unstable] repository.<br />
pacman -S tiacx<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] or [http://freewebs.com/ronserver/bcm43xx.tar.gz]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: Wireless Management =<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无限网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无限网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用也更通用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
<br />
文档: [[Network Profiles]]<br />
更多资料在这里: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
These powerful console tools work extremely well and allow complete, manual control. These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.<br />
Many cards require that the kernel interface be activated before you can use the wireless-tools:<br />
ifconfig wlan0 up<br />
See what access points are available:<br />
iwlist wlan0 scan<br />
Using the scan results, tell your wireless device which access point to use. For example:<br />
iwconfig wlan0 essid linksys<br />
Then, setup the network interface as usual. Simple examples are:<br />
dhcpcd wlan0<br />
or<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
== Third-party wireless management ==<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.<br />
<br />
===NetworkManager===<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
===Wicd===<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
===Wlassistant===<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42104Network configuration (简体中文)/Wireless (简体中文)2008-05-28T08:44:30Z<p>Yafengabc: /* Netcfg2 */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡。<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<pre>pacman -S rt2500</pre><br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (另外一个办法)====<br />
'''''注意:''' 当Intel的iwlwifi驱动足够成熟之后ipw3945驱动就会被淘汰了.''<br />
<br />
<pre>pacman -S ipw3945</pre><br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
Install the 'tiacx' package from the [unstable] repository.<br />
pacman -S tiacx<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] or [http://freewebs.com/ronserver/bcm43xx.tar.gz]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: Wireless Management =<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无限网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无限网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
文档: [[Network Profiles]]<br />
<br />
更多资料在这里: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
These powerful console tools work extremely well and allow complete, manual control. These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.<br />
Many cards require that the kernel interface be activated before you can use the wireless-tools:<br />
ifconfig wlan0 up<br />
See what access points are available:<br />
iwlist wlan0 scan<br />
Using the scan results, tell your wireless device which access point to use. For example:<br />
iwconfig wlan0 essid linksys<br />
Then, setup the network interface as usual. Simple examples are:<br />
dhcpcd wlan0<br />
or<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
== Third-party wireless management ==<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.<br />
<br />
===NetworkManager===<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
===Wicd===<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
===Wlassistant===<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42103Network configuration (简体中文)/Wireless (简体中文)2008-05-28T08:42:57Z<p>Yafengabc: /* /etc/rc.conf */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡。<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<pre>pacman -S rt2500</pre><br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (另外一个办法)====<br />
'''''注意:''' 当Intel的iwlwifi驱动足够成熟之后ipw3945驱动就会被淘汰了.''<br />
<br />
<pre>pacman -S ipw3945</pre><br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
Install the 'tiacx' package from the [unstable] repository.<br />
pacman -S tiacx<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] or [http://freewebs.com/ronserver/bcm43xx.tar.gz]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: Wireless Management =<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==在/etc/rc.conf中设置==<br />
<br />
<br />
* /etc/rc.conf 文件中的网络部分是“网络脚本”的配置文件. 因此,你可以利用/etc/rc.conf这个文件定义并配置一个简单的无线连接,例如:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(并不是所有的无限网卡都是wlan0. 这取决于你的网络接口配置,你可以用ifconfig -a来查看你的网络接口。举个例子:如果你的无线网络接口是ath0的话,你就应该把wlan_wlan0改成wlan_ath0:<br />
<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
ath0="dhcp"<br />
wlan_ath0="ath0 essid MyEssid"<br />
……<br />
INTERFACES=(eth0 ath0)<br />
)<br />
<br />
* 当然,你也可以在/etc/conf.d/wireless中设置你的无限网络(这个文件也是“网络脚本”的配置文件), 举个例子: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2是一个多功能的网络管理器,这个更好用,可能是你首选的管理方式, 除非你想在多个网络中漫游(netcfg2没有漫游功能). <br />
文档: [[Network Profiles]]<br />
<br />
More details on development: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
These powerful console tools work extremely well and allow complete, manual control. These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.<br />
Many cards require that the kernel interface be activated before you can use the wireless-tools:<br />
ifconfig wlan0 up<br />
See what access points are available:<br />
iwlist wlan0 scan<br />
Using the scan results, tell your wireless device which access point to use. For example:<br />
iwconfig wlan0 essid linksys<br />
Then, setup the network interface as usual. Simple examples are:<br />
dhcpcd wlan0<br />
or<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
== Third-party wireless management ==<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.<br />
<br />
===NetworkManager===<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
===Wicd===<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
===Wlassistant===<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>Yafengabchttps://wiki.archlinux.org/index.php?title=Network_configuration_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)/Wireless_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=42102Network configuration (简体中文)/Wireless (简体中文)2008-05-28T08:17:08Z<p>Yafengabc: /* 基于Arch 的无线网络管理 */</p>
<hr />
<div>[[Category:通讯与网络|WXSZ]]<br />
[[Category:网络]]<br />
[[Category:HOWTOs (简体中文)]]<br />
<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Wireless_Setup}}<br />
{{i18n_entry|Italiano|Configurazione_Wireless}}<br />
{{i18n_entry|Nederlands|Draadloze_Configuratie}}<br />
{{i18n_entry|German|Drahtlos_Installation}}<br />
{{i18n_entry|简体中文|无线设置}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
<br />
= 说明 =<br />
在Arch Linux(或其他Linux发行版)下配置无线网络一般分两步.第一步是识别您的硬件并为您的硬件安装驱动程序,第二步是选择一种方式来管理您的无线连接。这篇文章涵盖了这两方面,并提供了无线管理工具的连接地址。<br />
<br />
= Part I: 无线设备驱动 =<br />
<br />
==第一步==<br />
#检查Linux是否兼容你的硬件.你可以用'hwdetect --show-net' 或者'lshwd',来检测你的无线网卡。<br />
#*以zd1201为基础的无线卡,像ZyXEL B-220<br />
#*[http://www.linux-wlan.org/docs/wlan_adapters.html.gz wlan-ng] 支持相当多的芯片;详情请点击前边的网址。<br />
#*[http://madwifi.org madwifi] 支持Atheros的芯片(包括AR5210, AR5211, AR5212 and AR5213)<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page rt2x00 project] Ralink 的rt2400, rt2500, rt2570等芯片的通用驱动(测试版).<br />
#*[http://www.ralinktech.com/ralink/Home/Support/Linux.html Ralink Linux 官方支持网站] 直接从 Ralink 的官方网站下载芯片驱动.<br />
#*[http://rt2x00.serialmonkey.com/wiki/index.php/Downloads rt2x00 项目] 有一些现在仍被维护的Ralink的以前发布的驱动<br />
(这里有一些"老驱动"可能效果不错).<br />
#*[http://ipw2100.sourceforge.net/ ipw2100] 支持 Intel Pro/Wireless 2100 Mini PCI<br />
#*[http://ipw2200.sourceforge.net/ ipw2200] 支持 Intel Pro/Wireless 2200 Mini PCI<br />
#*[http://ipw3945.sourceforge.net/ ipw3945] 支持 Intel Pro/Wireless 3945 AB/G Mini PCI-E<br />
#*[http://www.nongnu.org/orinoco/devices/ orinoco] 支持一些基于 Prism 2的网卡。<br />
#*[http://prism54.org/ prism54] 支持一些基于 Prism 54 的网卡<br />
#*[http://bcm43xx.berlios.de/ bcm43xx] 支持基于Broadcom 43xx 的网卡。<br />
#*在[http://linux-wless.passys.nl/ Linux无线支持]页面中寻找你的硬件,或者查看在Linux Questions中的[http://www.linuxquestions.org/hcl/index.php?cat=10 硬件兼容列表] (HCL), 这两个地方也有比较详尽的Linux兼容的硬件列表。<br />
#如果你的硬件只有在windows下的驱动<br />
#*[http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]可以帮助你使用只提供下Windows下驱动的硬件。(一些 Broadcom, 3com, 等的芯片)<br />
#*你需要从你的Windows驱动下提取用到的.inf文件与.sys文件 -[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List 点击这里]<br />
#如果你的硬件不在上述列表中<br />
#*想办法在google或者baidu中查找吧,用你硬件的模块名加Linux作为关键词。或者[http://bbs.archlinux.org 去论坛] 求助吧<br />
<br />
#*如果还不行,那就可能是你的硬件根本没法在Linux下工作:-( (当然, 这是很罕见的)<br />
<br />
==安装==<br />
首先,确保你用pacman安装了 '''wireless-tools'''。<br />
<pre>pacman -S wireless_tools</pre><br />
如果你没有安装这个工具包,你将无法初始化你的无线卡。<br />
===驱动===<br />
这里包含如何获取你的网卡驱动的细节。或许你有好几种驱动可以选择,你可以访问[http://www.linuxquestions.org/hcl/index.php?cat=10|LQ HCL]来帮助你获取最佳驱动。<br />
<br />
====wlan-ng====<br />
<pre>pacman -S wlan-ng24</pre> 或者 <pre>pacman -S wlan-ng26</pre><br />
====rt2x00====<br />
Ralink 芯片的通用驱动 (替代 rt2500,rt61,rt73 etc). 使用wext驱动程序接口,兼容 wpa_supplicant.这个驱动现在已经集成到 2.6.24内核中。可以用下边的方法手动加载...<br />
<pre>modprobe rt2500pci</pre> <br />
(用rt2500pci来代替你的硬件,例如rt2400pci, rt2500usb, rt61pci, rt73usb)<br />
有些芯片需要一个firmware文件.<br />
请查看 [[Using_the_new_rt2x00_beta_driver|rt2x00 wiki 页面]].<br />
<br />
====RT2500====<br />
For Ralink's PCI/PCMCIA based rt2500 series chipsets (the first generation of Ralink chips to support 802.11g).<br />
<pre>pacman -S rt2500</pre><br />
Supports standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
wpa_supplicant is not supported using the standard wext interface. The driver does support WPA (using hardware encryption), but in a non-standard way. The trunk version of wpa_supplicant (0.6.x) appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
The same applies for RT61 and RT73 below.<br />
<br />
====RT61====<br />
For PCI/PCMCIA cards based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT61_Wireless|RT61 wiki page]].<br />
<br />
====RT73====<br />
For USB devices based on Ralink's later generation of 802.11g chipsets (including those supporting proprietary MIMO modes).<br />
See the [[RT73_Wireless|RT73 wiki page]].<br />
<br />
====madwifi====<br />
<br />
pacman -S madwifi<br />
<br />
这个模块叫做 <tt>ath_pci</tt>. '''为了能够使用所在国家制定的关于channels和transmit power settings, 你可能需要在加载MadWifi驱动的时候添加一个countrycode的配置项.''' 例如, 在荷兰的时候, 你可能需要用如下的代码来加载MadWifi驱动:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
你可以使用 <tt>iwlist</tt> 命令来检查你的设置, 可以从 <tt>man iwlist</tt> 或者 [http://madwifi.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki] 上面得到更多的信息. 为了让系统启动的时候就能够自动应用上那些设置, 可以把它们放到 <tt>/etc/modprobe.conf</tt> 文件中去:<br />
<br />
options ath_pci countrycode=528<br />
<br />
注意: I had to remove the countrycode option completely or the ath0 device wasn't created (andyrtr, kernel 2.6.21)!<br />
<br />
====ipw2100 与 ipw2200====<br />
<br />
根据你的芯片型号,执行:<br />
<br />
pacman -S ipw2100-fw<br />
<br />
或者:<br />
<br />
pacman -S ipw2200-fw<br />
<br />
然后重新启动来加载驱动。<br />
<br />
====ipw3945 与 ipw4965====<br />
Intel的新[http://intellinuxwireless.org/?p=iwlwifi iwlwifi 项目] 驱动同时支持这两款芯片,该驱动已集成到Linux内核2.6.24以上的内核中。可以用下边的命令轻松安装你的芯片驱动:<br />
<br />
pacman -S iwlwifi-3945-ucode<br />
<br />
或者:<br />
<br />
pacman -S iwlwifi-4965-ucode<br />
<br />
如果你的rc.conf中的MOD_AUTOLOAD 设置成了yes(默认就是yes),恭喜你,你的驱动已经安装完毕了. 重新启动并且在终端下运行'''''ifconfig'''''来检查你的驱动是否正常工作了.运行结果中应该包含一个wlan0的项.(译者注:lsmod |grep iwl可以查看驱动是否已经加载了)<br />
<br />
<br />
如果你喜欢手动加载驱动(就是MOD_AUTOLOAD设成no的情况), 你可以把它加到MODULES 组里边去:<br />
<br />
nano /etc/rc.conf<br />
<br />
在MODULES=()的列表中添加 '''iwl3945'''或者'''iwl4965''', 当然,这取决于你是3945ABG还是4965AGN的网卡<br />
<br />
用CTRL + X, Y 退出nano并保存(译者废话两句:当然,你用gedit,kwrite等纯文本编辑器来编辑也完全没问题,但是千万别用windows下的写字板来编辑,这个家伙会把换行'0a'改成'0a 0d'而让你的配置文件坏掉).<br />
<br />
这样,重启后就可以自动加载了。在终端中运行'ifconfig'会发现一个名字叫'''wlan0'''的新网络接口。<br />
<br />
<br />
提示:如果iwlwifi驱动经测试没法使用(据译者的测试,iwlwifi就能用),不妨用windows下的NETw4x32驱动配合ndiswrapper来试试,可能会工作得很好。<br />
<br />
====ipw3945 (另外一个办法)====<br />
'''''注意:''' 当Intel的iwlwifi驱动足够成熟之后ipw3945驱动就会被淘汰了.''<br />
<br />
<pre>pacman -S ipw3945</pre><br />
<br />
你应该安装 ipw3945-ucode, ipw3945, and ipw3945d (daemon).<br />
<br />
为了能够启动的时候正确初始化驱动, 需要修改 <tt>/etc/rc.conf</tt> 文件...<br />
<br />
<pre>nano /etc/rc.conf</pre><br />
<br />
在modules=()那一行里面, 把ipw3945添加进去<br />
<br />
在daemons()那一行里面, 把ipw3945d添加进去(ipw3945d必须在network和dhcdbd/networkmanager前面)<br />
<br />
用CTRL + X, Y来保存并退出<br />
<br />
在"Loading Modules..."阶段ipw3945模块应该被加载进来, 并且在daemon初始化的时候, 你应该可以看到"Starting IPW3945d"之类的字样, 而且ehtX接口也应该存在了<br />
<br />
更新: <br />
在某人的HP nc6320机器上, 除非卸载了ipw3945这个模块, 否则蓝牙是无法连接的.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
====ndiswrapper====<br />
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中).下面是安装ndiswrapper的几个步骤:<br />
<br />
用pacman来安装ndiswrapper:<br />
<pre>pacman -Sy ndiswrapper ndiswrapper-utils</pre><br />
''注意:'' 较早版本的内核需要安装的是ndiswrapper-beyond,而不是ndiswrapper!<br />
<br />
''注意:'' 如果你的Arch无法联网的话, 可以从[ftp://ftp.archlinux.org/core/os/i686/ ftp://ftp.archlinux.org/core/os/i686/]下载ndiswrapper到本地硬盘来进行安装.需要下载的是ndiswrapper(或者ndiswrapper-beyond)和ndiswrapper-utils软件包.你也能也需要下载最新的内核kernel26(或者更早版本的内核),因为CD上面提供的内核版本可能不是最新的.<br />
<br />
一旦安装好了ndiswrapper,就要开始配置的步骤了.<br />
<pre>ndiswrapper -i filename.inf<br />
ndiswrapper -l<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
现在基本上就要安装完ndiswrapper了; 剩下的工作就是更新一下/ect/rc.conf文件去设置当启动的时候加载这个模块(下面是一个简单的例子, 你的可能有些区别的):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
最主要的是要把ndiswrapper加到MODULES这一行里面去. 最好通过如下的命令测试一下ndiswrapper是否已经加载了:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki]上面得到更多的信息.<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://www.prism54.org/ this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. ([http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory forum source])<br />
<br />
====ACX100/111====<br />
Install the 'tiacx' package from the [unstable] repository.<br />
pacman -S tiacx<br />
Hint: If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.conf:<br />
options acx debug=0<br />
<br />
====BCM43XX====<br />
Broadcom users that have 43xx series chipsets have a new alternative to ndiswrapper. In kernel version 2.6.17, the bcm43xx driver was introduced.<br />
<br />
#Run <pre>iwconfig</pre> or <pre>hwd -s</pre> to determine that you have an appropriate card. My output of hwd -s looked like this: <pre>Network : Broadcom Corp.|BCM94306 802.11g NIC module: unknown</pre><br />
For a list of supported devices, see [http://bcm43xx.berlios.de/?go=devices here].<br />
#Run <pre>pacman -Sy bcm43xx-fwcutter</pre> to install the firmware cutter application.<br />
#Download the Windows driver file for your card from which to extract the firmware.<br />
#If you download the driver from Dell's website, you must run in on a Windows machine or under WINE (it is a .exe file that extracts itself to C:\Dell\[driver numbers]). Or you may try [http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o] or [http://freewebs.com/ronserver/bcm43xx.tar.gz]. I just saved this file to my desktop; you won't need it after the next step.<br />
#Run <pre>bcm43xx-fwcutter -w /lib/firmware /home/&lt;user&gt;/Desktop/wl_apsta.o</pre> You may have to create /lib/firmware first.<br />
#Restart, and configure your device as normal. You may want to add bcm43xx into the modules section of your rc.conf file. Good luck!<br />
<br />
====rtl8187====<br />
See the [[Rtl8187_wireless|rtl8187 wiki page]].<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -Sy zd1211-firmware</pre><br />
<br />
= Part II: Wireless Management =<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
== 基于Arch 的无线网络管理 ==<br />
Arch Linux 为管理无线连接提供了多种解决方案。你可以根据需要选择一种最适合你自己的方案。<br />
<br />
==/etc/rc.conf==<br />
* The /etc/rc.conf file is sourced by the network script. Therefore, you may define and configure a simple wireless setup within /etc/rc.conf for a centralized approach. For example:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
#wlan_wlan0="wlan0 essid MyEssid key 12345678"<br />
#wlan_wlan0="wlan0 essid MyEssid key s:wirelesspassword"<br />
INTERFACES=(eth0 wlan0)<br />
(Not all wireless cards are wlan0. Determine your wireless interface with ifconfig -a. Atheros-based cards, for example, are ath0, so change wlan_wlan0 to wlan_ath0="ath0 essid ....". Also define ath0 in the INTERFACES= line.)<br />
* Alternatively, you may define wlan_* within /etc/conf.d/wireless, (which is also sourced by the network script), for a de-centralized approach: <br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
===Netcfg2===<br />
Netcfg2 provides a more versatile, robust solution which may be preferred, especially if you roam from network to network. Documentation: [[Network Profiles]]<br />
<br />
More details on development: [[Network Scripts]]<br />
<br />
== wireless-tools ==<br />
These powerful console tools work extremely well and allow complete, manual control. These examples assume your wireless device is wlan0. Replace wlan0 with the appropriate device name.<br />
Many cards require that the kernel interface be activated before you can use the wireless-tools:<br />
ifconfig wlan0 up<br />
See what access points are available:<br />
iwlist wlan0 scan<br />
Using the scan results, tell your wireless device which access point to use. For example:<br />
iwconfig wlan0 essid linksys<br />
Then, setup the network interface as usual. Simple examples are:<br />
dhcpcd wlan0<br />
or<br />
ifconfig wlan0 192.168.0.2<br />
route add default gw 192.168.0.1<br />
== Third-party wireless management ==<br />
There are a number of wireless management solutions available to Arch Linux users as an alternative to the above scripts.<br />
<br />
===NetworkManager===<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
For more information, see the [[NetworkManager]] wiki.<br />
<br />
===Wicd===<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
For more information, see the [[Wicd]] wiki.<br />
<br />
===Wifi Radar===<br />
WiFi Radar is Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
For more information, see the [[Wifi Radar]] wiki.<br />
<br />
===Wlassistant===<br />
Wlassistant is a very intuitive and straightforward GUI app for managing your wireless connections. <br />
<br />
Install with:<br />
pacman -S wlassistant<br />
Wlassistant must be run with root privileges:<br />
sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within /etc/rc.conf, specifying the access point you use most often. On startup, your card will automatically be configured for this essid, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in /etc/rc.conf, by prefixing it with a @, to avoid boot delays.<br />
<br />
= Additional Resources =<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] - The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] - The official website for WICD<br />
*[http://wifi-radar.systemimager.org/ Wifi Radar] - The official website for Wifi Radar<br />
*[http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html An overly wordy howto that rarely helps]<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing, good if you're having trouble doing it the Arch way]</div>Yafengabc