1 |
r0bertz 08/03/01 05:55:52 |
2 |
|
3 |
Added: nvidia-guide.xml |
4 |
Log: |
5 |
added zh_cn nvidia-guide.xml |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 xml/htdocs/doc/zh_cn/nvidia-guide.xml |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/nvidia-guide.xml?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/nvidia-guide.xml?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: nvidia-guide.xml |
14 |
=================================================================== |
15 |
<?xml version="1.0" encoding="UTF-8"?> |
16 |
|
17 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/nvidia-guide.xml,v 1.1 2008/03/01 05:55:51 r0bertz Exp $ --> |
18 |
<!-- English CVS version: 1.44 --> |
19 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
20 |
<guide link="/doc/zh_cn/nvidia-guide.xml" lang="zh_cn"> |
21 |
<title>Gentoo Linux nVidia指南</title> |
22 |
|
23 |
<author title="作者"> |
24 |
<mail link="swift@g.o">Sven Vermeulen</mail> |
25 |
</author> |
26 |
<author title="作者"> |
27 |
<mail link="nightmorph@g.o">Joshua Saddler</mail> |
28 |
</author> |
29 |
<author title="编辑"> |
30 |
<mail link="curtis119@g.o">M Curtis Napier</mail> |
31 |
</author> |
32 |
<author title="编辑"> |
33 |
<mail link="wolf31o2@g.o">Chris Gianelloni</mail> |
34 |
</author> |
35 |
<author title="译者"> |
36 |
<mail link="liuqing.com@×××××.com">刘清</mail> |
37 |
</author> |
38 |
|
39 |
<abstract> |
40 |
许多Gentoo用户在自己的系统中使用了nVidia芯片组。nVidia提供了Linux下的专用驱动,它能使你的显卡性能得到充分发挥。这份指南指导您安装和配置这些驱动。 |
41 |
</abstract> |
42 |
|
43 |
<!-- The content of this document is licensed under the CC-BY-SA license |
44 |
See http://creativecommons.org/licenses/by-sa/2.5 --> |
45 |
<license/> |
46 |
|
47 |
<version>1.35</version> |
48 |
<date>2007-11-15</date> |
49 |
|
50 |
<chapter> |
51 |
<title>简介</title> |
52 |
<section> |
53 |
<body> |
54 |
|
55 |
<p> |
56 |
portage树中的nVidia驱动由nVidia发布,构建于Linux内核之上。驱动中包括一个担负与卡对话的艰巨任务的二进制部分。驱动包括两部分,内核模块和X11驱动。两部分包括在一个单独的包中。因为nVidia给它们的驱动打包的方式,你需要在安装驱动前进行一些选择。 |
57 |
</p> |
58 |
|
59 |
<p> |
60 |
<c>nvidia-drivers</c> |
61 |
包包括来自nVidia的最新驱动,支持<e>所有</e>nVidia的显卡。根据卡的新旧不同,有几个版本。它使用eclass检测你正在使用的是哪种卡,然后安装适合的版本。 |
62 |
</p> |
63 |
|
64 |
</body> |
65 |
</section> |
66 |
</chapter> |
67 |
|
68 |
<chapter> |
69 |
<title>驱动兼容性</title> |
70 |
<section> |
71 |
<title>哪个版本?</title> |
72 |
<body> |
73 |
|
74 |
<p> |
75 |
<c>nvidia-drivers</c>包支持所有可用的nVidia卡。根据你使用的卡,有多个相应版本。 |
76 |
</p> |
77 |
|
78 |
<p> |
79 |
较新的卡(如GeForce 8, 7, 6和FX 5系列)应该使用100.x系列的较新的驱动。 |
80 |
</p> |
81 |
|
82 |
<p> |
83 |
较老的卡(如GeForce 3或GeForce |
84 |
4系列)需要96.x驱动。对于这些卡,你应该在<path>/etc/portage/package.mask</path>中屏蔽掉<c>>=x11-drivers/nvidia-drivers-97.00</c>。这样将阻止安装你的显卡不兼容的新版驱动。 |
85 |
</p> |
86 |
|
87 |
<p> |
88 |
老的基于NV2x的显卡(如:TNT、TNT2、Geforce和GeForce |
89 |
2)需要更老的71.x驱动(例如<c>nvidia-drivers-71.86.01</c>)。对于这类卡,你应该在<path>/etc/portage/package.mask</path>中屏蔽掉<c>>=x11-drivers/nvidia-drivers-87.00</c> |
90 |
</p> |
91 |
|
92 |
<p> |
93 |
你可以在<uri |
94 |
link="http://www.nvidia.com/object/unix.html">发布说明</uri>通过读相应的x86或x86-64的README来检查你的显卡与哪个驱动兼容。 |
95 |
</p> |
96 |
|
97 |
</body> |
98 |
</section> |
99 |
</chapter> |
100 |
|
101 |
<chapter> |
102 |
<title>配置显卡</title> |
103 |
<section> |
104 |
<title>内核配置</title> |
105 |
<body> |
106 |
|
107 |
<p> |
108 |
正如刚才提到的,nVidia内核驱动在你当前内核上运行。它做成了一个模块,所以你的内核必须支持内核模块的加载才行。如果你是用<c>genkernel |
109 |
all</c>配置的内核,那就是可以的。如果不是,请再检查一下你的内核配置,保证这项支持被打开。 |
110 |
</p> |
111 |
|
112 |
<pre caption="打开内核模块加载的支持"> |
113 |
Loadable module support ---> |
114 |
[*] Enable loadable module support |
115 |
</pre> |
116 |
|
117 |
<p> |
118 |
你还要在内核中打开<e>Memory Type Range Register</e> |
119 |
</p> |
120 |
|
121 |
<pre caption="打开MTRR"> |
122 |
Processor and Features ---> |
123 |
[*] MTRR (Memory Type Range Register) support |
124 |
</pre> |
125 |
|
126 |
<p> 另外,如果你装的是AGP显卡,你可以选择打开内核里的<c>agpgart</c>支持,直接编到内核里或者编成模块。如果你不使用内核中的agpgart支持,驱动将使用它们自己的<c>agpgart</c>实现,这个实现叫做<c>NvAGP</c>。在某些系统中,它的表现要强于内核中的agpgart。在另外一些系统中,它的表现要弱于内核中的agpgart。你需要自己评估在你自己的系统中哪个更好以得到最佳性能。如果你搞不清楚该怎么做,那就使用内核中的agpgart吧。 |
127 |
</p> |
128 |
|
129 |
<pre caption="打开agpgart支持"> |
130 |
Device Drivers ---> |
131 |
Character devices ---> |
132 |
<*> /dev/agpgart (AGP Support) |
133 |
</pre> |
134 |
|
135 |
<note> |
136 |
在amd64平台,IOMMU控制着agpgart的设置。 |
137 |
</note> |
138 |
|
139 |
</body> |
140 |
</section> |
141 |
<section> |
142 |
<title>平台相关注释</title> |
143 |
<body> |
144 |
|
145 |
<impo> |
146 |
对于x86和AMD64的处理器,内核中的驱动与nvidia提供的二进制驱动冲突。如果你为这些CPU编译内核,你必须按照下面的方法完全去掉内核中的驱动。 |
147 |
</impo> |
148 |
|
149 |
<pre caption="去掉内核中的驱动"> |
150 |
Device Drivers ---> |
151 |
Graphics Support ---> |
152 |
< > nVidia Framebuffer Support |
153 |
< > nVidia Riva support |
154 |
</pre> |
155 |
|
156 |
<p> |
157 |
一个不错的framebuffer替代物── <c>VESA</c>: |
158 |
</p> |
159 |
|
160 |
<pre caption="打开VESA支持"> |
161 |
Device Drivers ---> |
162 |
Graphics Support ---> |
163 |
<*> VESA VGA graphics support |
164 |
</pre> |
165 |
|
166 |
<p> |
167 |
然后,在"VESA driver |
168 |
type"中选中<c>vesafb</c>或<c>vesafb-tng</c>。如果你用的是AMD64的处理器,你应该选择<c>vesafb</c>而不是<c>vesafb-tng</c>: |
169 |
</p> |
170 |
|
171 |
<pre caption="选择framebuffer类型"> |
172 |
(X) vesafb |
173 |
( ) vesafb-tng |
174 |
</pre> |
175 |
|
176 |
<p> |
177 |
要了解更多的信息,如果在用<c>vesafb</c>可以读<path>/usr/src/linux/Documentation/fb/vesafb.txt</path>,否则就到<path>/usr/src/linux/Documentation/fb/</path>下找你使用的framebuffer的相应文档。 |
178 |
</p> |
179 |
|
180 |
</body> |
181 |
</section> |
182 |
<section> |
183 |
<title>继续进行内核配置</title> |
184 |
<body> |
185 |
|
186 |
<p> |
187 |
<c>nvidia-drivers</c>的ebuild按<path>/usr/src/linux</path>符号链接自动检测你的内核版本。请确认你正确配置了你的内核而且这个符号链接指向了正确的内核源码。参阅<uri |
188 |
link="/doc/zh_cn/handbook/">安装手册</uri>中的“配置内核”一节。 |
189 |
</p> |
190 |
|
191 |
<p> |
192 |
首先,你需要emerge |
193 |
<c>eselect</c>(如果你没装它的话)。如果你在使用<c>gentoo-sources-2.6.18-r4</c>,你的内核列表看起来象下面一样: |
194 |
</p> |
195 |
|
196 |
<pre caption="检查你的/usr/src/linux符号链接"> |
197 |
# <i>eselect kernel list</i> |
198 |
Available kernel symlink targets: |
199 |
[1] linux-2.6.18-gentoo-r4 * |
200 |
[2] linux-2.6.20-gentoo-r7 |
201 |
[3] linux-2.6.20-gentoo-r8 |
202 |
|
203 |
<comment>(确认正确的内核被标了星号</comment> |
204 |
</pre> |
205 |
|
206 |
<p> |
207 |
在上面的输出中,你会注意到<c>linux-2.6.18-gentoo-r4</c>内核标记了星号(<b>*</b>),这表示它是符号链接指向的内核。 |
208 |
</p> |
209 |
|
210 |
<p> |
211 |
如果符号链接没有指向正确的内核源码,你必须象前面的例子那样选择想要的内核源码。 |
212 |
</p> |
213 |
|
214 |
<pre caption="建立或更新/usr/src/linux符号链接。"> |
215 |
<comment>(选择正确的内核)</comment> |
216 |
# <i>eselect kernel set 1</i> |
217 |
</pre> |
218 |
|
219 |
</body> |
220 |
</section> |
221 |
<section> |
222 |
<title>安装适宜的驱动</title> |
223 |
<body> |
224 |
|
225 |
<p> |
226 |
然后就要安装驱动了。 |
227 |
</p> |
228 |
|
229 |
<pre caption="安装nVidia驱动"> |
230 |
# <i>emerge nvidia-drivers</i> |
231 |
</pre> |
232 |
|
233 |
<note> |
234 |
安装驱动时可以加上<c>gtk</c>用户标识。加上后将会安装<c>media-video/nvidia-settings</c>。这是一个方便的用来查看和配置nVidia显卡各个方面的图形化工具。 |
235 |
</note> |
236 |
|
237 |
<impo> |
238 |
每次你<uri |
239 |
link="/doc/en/kernel-upgrade.xml">编译新内核</uri>或重新编译当前内核,你需要运行<c>emerge |
240 |
nvidia-drivers</c>重新安装nVidia模块。一个更容易的保持由ebuild安装的模块可用的方式是安装<c>sys-kernel/module-rebuild</c>。一旦你已经安装了它,简单地运行<c>module-rebuild |
241 |
populate</c>以把一个需要重新编译的包列表populate到数据库中。仅仅运行<c>module-rebuild |
242 |
rebuild</c>来为你的新内核重建驱动就行了。 |
243 |
</impo> |
244 |
|
245 |
<p> |
246 |
安装完成后,运行<c>modprobe nvidia</c>把内核模块载入内存。如果是在升级的情况下,你应该把先前的模块移出内存。 |
247 |
</p> |
248 |
|
249 |
<pre caption="载入内核模块"> |
250 |
# <i>lsmod | grep nvidia && rmmod nvidia</i> |
251 |
# <i>modprobe nvidia</i> |
252 |
</pre> |
253 |
|
254 |
<p> |
255 |
为避免不得不每次启动都手动地加载模块,你可能想要在启动系统时自动地加载,那就编辑<path>/etc/modules.autoload.d/kernel-2.6</path>,把<c>nvidia</c>加进去。不要忘了过后儿运行<c>update-modules</c>。 |
256 |
</p> |
257 |
|
258 |
<impo> |
259 |
如果你把<c>agpgart</c>编成模块,你需要把它加入<path>/etc/modules.autoload.d/kernel-2.6</path> |
260 |
</impo> |
261 |
|
262 |
<pre caption="运行update-modules"> |
263 |
# <i>update-modules</i> |
264 |
</pre> |
265 |
|
266 |
</body> |
267 |
</section> |
268 |
<section> |
269 |
<title>配置X服务</title> |
270 |
<body> |
271 |
|
272 |
<p> |
273 |
一旦安装完合适的驱动,需要用<c>nvidia</c>驱动而不是默认的<c>nv</c>驱动来配置X服务。 |
274 |
</p> |
275 |
|
276 |
<p> |
277 |
用你喜欢的编辑器(如<c>nano</c>或<c>vim</c>)打开<path>/etc/X11/xorg.conf</path>,到<c>Device</c>一节,把<c>Driver</c>一行改成如下: |
278 |
</p> |
279 |
|
280 |
<pre caption="在X服务配置中把nv改成nvidia"> |
281 |
Section "Device" |
282 |
Identifier "nVidia Inc. GeForce2" |
283 |
<i>Driver "nvidia"</i>" |
284 |
VideoRam 65536 |
285 |
EndSection |
286 |
</pre> |
287 |
|
288 |
<p> |
289 |
然后到<c>Module</c>一节,确认<c>glx</c>模块加载,同时<c>dri</c>模块没加载: |
290 |
</p> |
291 |
|
292 |
<pre caption="更新Module一节"> |
293 |
Section "Module" |
294 |
<comment>(……)</comment> |
295 |
<i># Load "dri" |
296 |
Load "glx"</i> |
297 |
<comment>(……)</comment> |
298 |
EndSection |
299 |
</pre> |
300 |
|
301 |
<p> |
302 |
下一步,在<c>Screen</c>一节,确保<c>DefaultDepth</c>指令被设为16或24,或者你只有 |
303 |
<c>Depth</c>设为16或24的<c>Display</c>小节。如果不这样做,nVidia的GLX扩展将无法启动。 |
304 |
</p> |
305 |
|
306 |
<pre caption="更新Screen section"> |
307 |
Section "Screen" |
308 |
<comment>(……)</comment> |
309 |
<i>DefaultDepth 16</i> |
310 |
Subsection "Display" |
311 |
<comment>(……)</comment> |
312 |
EndSection |
313 |
</pre> |
314 |
|
315 |
<p> |
316 |
运行<c>eselect</c>,让X服务使用nVidia的GLX库: |
317 |
</p> |
318 |
|
319 |
<pre caption="运行eselect"> |
320 |
# <i>eselect opengl set nvidia</i> |
321 |
</pre> |
322 |
|
323 |
</body> |
324 |
</section> |
325 |
<section> |
326 |
<title>把你的用户加入video组</title> |
327 |
<body> |
328 |
|
329 |
<p> |
330 |
你必须把你的用户加入<c>video</c>组,他才会有访问nVidia设备文件的权限: |
331 |
</p> |
332 |
|
333 |
<pre caption="把你的用户加入video组"> |
334 |
# <i>gpasswd -a youruser video</i> |
335 |
</pre> |
336 |
|
337 |
<p> |
338 |
如果你不使用<c>udev</c>,这个步骤不一定需要,但也不会有坏处,还能使你的系统适应将来的需要。 |
339 |
</p> |
340 |
|
341 |
</body> |
342 |
</section> |
343 |
<section> |
344 |
<title>测试显卡</title> |
345 |
<body> |
346 |
|
347 |
<p> |
348 |
要测试你的nVidia显卡,就启动X,运行<c>glxinfo</c>,它是<c>mesa-progs</c>包的一部分。应该出现“direct |
349 |
rendering is activated”这类结果: |
350 |
</p> |
351 |
|
352 |
<pre caption="检查直接渲染状态"> |
353 |
$ <i>glxinfo | grep direct</i> |
354 |
direct rendering: Yes |
355 |
</pre> |
356 |
|
357 |
<p> |
358 |
如果要测试你的FPS,就运行<c>glxgears</c>命令。 |
359 |
</p> |
360 |
|
361 |
</body> |
362 |
</section> |
363 |
<section> |
364 |
<title>打开nvidia支持</title> |
365 |
<body> |
366 |
|
367 |
<p> |
368 |
有些工具,如<c>mplayer</c>和<c>xine-lib</c>,使用一个叫做<c>xvmc</c>的本地USE标识来打开XvMCNVIDIA支持。这个支持在看高清电影时很有用。在<path>/etc/make.conf</path>中的USE变量中加入<c>xvmc</c>或者在<path>/etc/portage/package.use</path>中为<c>media-video/mplayer</c>和/或<c>media-libs/xine-lib</c>加入这个USE标识。 |
369 |
</p> |
370 |
|
371 |
<p> |
372 |
也有一些程序使用<c>nvidia</c>USE标识,所以你可能需要把它加入<path>/etc/make.conf</path>。 |
373 |
</p> |
374 |
|
375 |
<p> |
376 |
然后,运行<c>emerge -uD --newuse world</c>以重新编译这些获益于上述USE标识改变的应用程序。 |
377 |
</p> |
378 |
|
379 |
</body> |
380 |
</section> |
381 |
<section> |
382 |
<title>使用NVidia配置工具</title> |
383 |
<body> |
384 |
|
385 |
<p> |
386 |
nVidia也为你提供了一个设置工具。这个工具使你能够查看并且不必重启X服务器就改变图形设置。这个工具在portage树的<c>media-video/nvidia-settings</c>包里。如前所述,如果你安装驱动时在<path>/etc/make.conf</path>或<path>/etc/portage/package.use</path>中加入了<c>gtk</c>USE标识,这个包将自动安装。 |
387 |
</p> |
388 |
|
389 |
</body> |
390 |
</section> |
391 |
</chapter> |
392 |
|
393 |
<chapter> |
394 |
<title>故障排除</title> |
395 |
<section> |
396 |
<title>在拥有4Gb或以上的内存的机器上搞定2D</title> |
397 |
<body> |
398 |
|
399 |
<p> |
400 |
如果你在nVidia的2D加速方面有什么问题。那可能是你不能用MTRR建立混合写入区。要确认这个,请检查<path>/proc/mtrr</path>的内容: |
401 |
</p> |
402 |
|
403 |
<pre caption="检查你是否打开了混合写入"> |
404 |
# <i>cat /proc/mtrr</i> |
405 |
</pre> |
406 |
|
407 |
<p> |
408 |
每行都应有"write-back"或"write-combining"。如果你看到有一行有"uncachable",你需要更改BIOS设置来修正它。 |
409 |
</p> |
410 |
|
411 |
<p> |
412 |
重启并进入BIOS,找到MTRR设置(可能会在"CPU |
413 |
Settings"下面)。把该项设置由"continuous"改为"discrete",再引导回Linux。你将发现没有带"uncachable"的行了。2D加速没有任何毛病了。 |
414 |
</p> |
415 |
|
416 |
</body> |
417 |
</section> |
418 |
<section> |
419 |
<title> |
420 |
当我试图加载内核模块时,出现"no such device"。 |
421 |
</title> |
422 |
<body> |
423 |
|
424 |
<p> |
425 |
这个错误通常出现在你没有匹配的显卡时。确认你有装了nVidia的显卡。你可以运行<c>lspci</c>再看一次。 |
426 |
</p> |
427 |
|
428 |
<p> |
429 |
如果你确信你有nVidia显卡,检查你的BIOS看一下<e>Assign IRQ to VGA</e>是否设置了。 |
430 |
</p> |
431 |
|
432 |
</body> |
433 |
</section> |
434 |
</chapter> |
435 |
|
436 |
<chapter> |
437 |
<title>专家级配置</title> |
438 |
<section> |
439 |
<title>文档</title> |
440 |
<body> |
441 |
|
442 |
<p> |
443 |
nVidia驱动包还包含了包罗万象的文档。这些文档安装在<c>/usr/share/doc</c>,能够用以下命令查看: |
444 |
</p> |
445 |
|
446 |
<pre caption="查看NVIDIA文档"> |
447 |
$ <i>less /usr/share/doc/nvidia-drivers-*/README.gz</i> |
448 |
</pre> |
449 |
|
450 |
</body> |
451 |
</section> |
452 |
<section> |
453 |
<title>内核模块参数</title> |
454 |
<body> |
455 |
|
456 |
<p> |
457 |
<c>nvidia</c>内核模块能接受一些参数。你可以用这些参数调整驱动的行为。这些参数中的大部分都在文档中提到了。你可以通过编辑<c>/etc/modules.d/nvidia</c>来增加或改变这些参数的值。在改变这个文件后记住要运行<c>update-modules</c>,一定要牢记你所做的新设置只有在nvidia模块重新加载后才会生效。 |
458 |
</p> |
459 |
|
460 |
<pre caption="调整nvidia驱动参数"> |
461 |
<comment>(用你喜欢的编辑器编辑/etc/modules.d/nvidia)</comment> |
462 |
# <i>nano -w /etc/modules.d/nvidia</i> |
463 |
<comment>(更新模块信息)</comment> |
464 |
# <i>update-modules</i> |
465 |
<comment>(卸载nvidia模块……)</comment> |
466 |
# <i>modprobe -r nvidia</i> |
467 |
<comment>(……然后再次加载)</comment> |
468 |
# <i>modprobe nvidia</i> |
469 |
</pre> |
470 |
|
471 |
</body> |
472 |
</section> |
473 |
<section> |
474 |
<title>X的高级配置</title> |
475 |
<body> |
476 |
|
477 |
<p> |
478 |
GLX这个层次也还有相当多的参数可以设置。这些参数控制电视输出、双显、显示器刷新率检测等等的配置。同样,所有这些可用的参数的细节可以在文档中找到。 |
479 |
</p> |
480 |
|
481 |
<p> |
482 |
如果你想要使用这些参数,你需要把它们填入X配置文件(通常是<c>/etc/X11/xorg.conf</c>)的相关设备节。举例如下,假如我想要不显示飞溅屏幕: |
483 |
</p> |
484 |
|
485 |
<pre caption="X配置中的nvidia高级配置"> |
486 |
Section "Device" |
487 |
Identifier "nVidia Inc. GeForce2" |
488 |
Driver "nvidia" |
489 |
<i>Option "NoLogo" "true"</i> |
490 |
VideoRam 65536 |
491 |
EndSection |
492 |
</pre> |
493 |
|
494 |
</body> |
495 |
</section> |
496 |
</chapter> |
497 |
</guide> |
498 |
|
499 |
|
500 |
|
501 |
-- |
502 |
gentoo-commits@l.g.o mailing list |