LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2117|回复: 7

mandriva 2009 安装nvidia显卡驱动成功

[复制链接]
发表于 2008-12-18 11:18:32 | 显示全部楼层 |阅读模式
用smplayer看电影时,打开,关闭、前进时,屏幕闪的厉害,还有就是在windows下屏幕移位,于是
决定装驱动。在网上搜了一下

首先glxinfo | grep render
如果显示
direct rendering: Yes
则表示驱动已安装

1  安装内核源代码
     uname  -r查看内核版本。
    我的是 2.6.27.5-desktop-2mnb
    输入urpmi  kernel-source-2.6.27.5安装源码
    ll /usr/src/linux 查看源码是否安装成功
2 下载nvidia驱动
    最好将其改名为nvidia.run,放在你自己的主目录下
3 安装
CTRL+ALT+F1 进入字符界面
  以root登录
然后执行  init 3
         再 sh  /home/yourusrname/nvidia.run
出现安装界面 一步一步选择  
      询问是否上网下载,选no
      如果提示将要修改Xorg.conf,询问是否允许,选Yes;
      其它的要么选ok 要么选accept
4  下面的实在网上抄的
      vi /etc/X11/xorg.conf

     找到
     Section "Device"
     Identifier     "Device0"
     Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 7300 GT"
    EndSection
    看第3行      Driver         "nvidia"
   如果  Driver         "nv"
   将nv改为nvidia


     找到
     Section "Module"
      Load           "dbe"
      Load           "extmod"
      Load           "type1"
      Load           "freetype"
      Load           "glx"
   EndSection

   如果有
   Load "dri"
   Load "GLCore"
  上面两行 则删除这两行

  然后在命令行模式下输入:wq


vi /etc/modprobe.preload

在最下面加上 nvidia
按Esc进入命令行模式
输入:wq
退出

5最后   init 5 即可

附原文
Nvidia Install

You've got that nice NVIDIA video card and want to use it's 3D functions in linux. This will explain how to do it on Mandriva Linux, other distro's may differ.

You may want to print this because most of the procedure requires you to be out of the X environment and working from the command line.

This how-to assumes you have online sources setup from Urpmi-Addmedia for Main, Main Updates, Contrib, Contrib Updates, PLF-Free and PLF-NonFree(You don't have to pay for PLF-NonFree). Visit the site mentioned above and follow the three very easy steps on the site to accomplish this. If you don't do this, then it's possible you can NOT get the matching kernel-source for your running kernel. There is also a how-to I've written about getting a matching kernel and kernel-source. It can be viewed here: Kernel-Source How-To

The first thing you need to do is to install the kernel-source that matches the running kernel that you are using. You can find your version of your running kernel with:
uname -r

For purposes of this howto, I'll be talking about Mandriva 2007 versions. The running kernel is kernel-2.6.17.6mdv-1-1mdv2007.0 which means that I would need the kernel-source-2.6.17.6mdv-1-1mdv2007.0 package. To install that package:
urpmi kernel-source-2.6.17.6mdv-1-1mdv2007.0

The above command may say it's already installed if you had installed it previously. The key thing here is that the output of the following two commands show the EXACT same versions.
uname -r
ll /usr/src/linux

Now get the nvidia driver from nvidia.com Nvidia Site

In most cases it's the driver for the IA32 architecture...if your machines architecture was different then that, you'd know it.

The actual installation of the NVIDIA drivers must be done while you are out of the X environment, so log out of your window manager. We need to get to the command line, so if you are now sitting at the graphical login screen, hit the CTRL+ALT+F1 keys combination to get there and login as root.

Once you are at the command line you shut down the X environment with one of the following:
telinit 3
or
service dm stop
or
init 3

Now change directories to wherever you had downloaded the NVIDIA driver to and run the following command:
sh NVIDIA-Linux-<version-here>.run

The installation begins after issueing the above command. Accept the license agreement, and answer YES to the questions it asks. The drivers will install and tell you at the end that it was successful.

Now you need to edit the xorg.conf file, as root user, to use the nvidia driver. You can use any command line editor you want, I'll be using the vi editor:
vi /etc/X11/xorg.conf

Hit the i or insert key to get into edit mode. Find the Section Device section in the config and change Driver "nv" to Driver "nvidia" as shown here:


Now go up in the file and find the Section Module section and add the line Load glx if it isn't there. If it is there, be sure it is not commented out.


If you have either of these two lines then remove them:
Load "dri"
Load "GLCore"

Save and exit the file by hitting the Esc key to get to vi's command mode and enter the following command:
:wq

Now we'll edit one more file to tell the system to load the nvidia module when the machine boots:
vi /etc/modprobe.preload

Again, hit the i key to get into insert mode and add the word nvidia to the bottom of the file:


Save and exit the file by hitting the Esc key to get to vi's command mode and enter the following command:
:wq

The configuration is done and now all you need to do is restart the X environment and login to your window manager:
telinit 5
or
service dm start
or
init 5

Once back in your window manager, you can verify the installation by running the following command and looking for direct rendering: Yes
glxinfo | grep render
发表于 2008-12-18 12:40:06 | 显示全部楼层
神啊,装NVIDIA驱动这么麻烦吗?我都是下pwp,安装的时候问我要不要用私有驱动,我说,要。然后就好了。汗一个。呵呵。即使用Free版,也是添加源后从网络安装源里装。呵呵。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-18 17:20:43 | 显示全部楼层
见笑了,不知怎样从网络安装源里装。才用这种方法的。
我用的是free版

其实也不麻烦,只需前3步就可
回复 支持 反对

使用道具 举报

发表于 2008-12-18 19:00:35 | 显示全部楼层
我也是从源里装的,省事得很。我也是用的Free 版。
回复 支持 反对

使用道具 举报

发表于 2008-12-19 09:14:49 | 显示全部楼层
这帖子会把新手吓跑的,呵呵

配好网络源以后,在配置计算机里选显卡驱动的界面选好显卡型号,确定以后会问有私有驱动,用不用,动动鼠标就可以轻松搞定了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-19 12:49:50 | 显示全部楼层
请问是在 配置您的计算机--硬件--浏览及配置硬件 里吗?
我试过,当时自动下载了一些包,但是不能开3d 而且屏幕与windows有偏移
只好自己安装了,可能是我当时没有选择显卡类型
我的是 GeForce 7300 GT
回复 支持 反对

使用道具 举报

发表于 2008-12-19 13:14:38 | 显示全部楼层
佩服搂住的学习精神,虽然方法比较麻烦,但是还是搞定了。
回复 支持 反对

使用道具 举报

发表于 2008-12-25 16:41:36 | 显示全部楼层
Post by xiaoaosc;1926259
请问是在 配置您的计算机--硬件--浏览及配置硬件 里吗?
我试过,当时自动下载了一些包,但是不能开3d 而且屏幕与windows有偏移
只好自己安装了,可能是我当时没有选择显卡类型
我的是 GeForce 7300 GT


是啊, 到硬件的时候会有提示安装显示驱动, 同意后就会自动下载并安装, 很方便的.

屏幕偏移可能是由刷新率设置与win下不同造成的, 通常系统会将默认刷新率设为最高.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表