+ -
当前位置:首页 → 问答吧 → lfs在没有内核源码的情况下如何安装NVIDIA驱动

lfs在没有内核源码的情况下如何安装NVIDIA驱动

时间:2009-04-16

来源:互联网

内核源码编译好后让我删除了,因为安装驱动需要源码就把原来的config文件拿来,重新编译了内核,但还是提示找不到内核

PHP 代码:
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Wed Apr 15 21:39:58 2009

option status:
  license pre-accepted    : false
  update                  : false
  force update            : false
  expert                  : false
  uninstall               : false
  driver info             : false
  precompiled interfaces  : true
  no ncurses color        : false
  query latest version    : false
  OpenGL header files     : true
  no questions            : false
  silent                  : false
  no recursion            : false
  no backup               : false
  kernel module only      : false
  sanity                  : false
  add this kernel         : false
  no runlevel check       : false
  no network              : false
  no ABI note             : false
  no RPMs                 : false
  no kernel module        : false
  force SELinux           : default
  no X server check       : false
  force tls               : (not specified)
  X install prefix        : (not specified)
  X library install path  : (not specified)
  X module install path   : (not specified)
  OpenGL install prefix   : (not specified)
  OpenGL install libdir   : (not specified)
  utility install prefix  : (not specified)
  utility install libdir  : (not specified)
  doc install prefix      : (not specified)
  kernel name             : (not specified)
  kernel include path     : (not specified)
  kernel source path      : (not specified)
  kernel output path      : (not specified)
  kernel install path     : (not specified)
  proc mount point        : /proc
  ui                      : (not specified)
  tmpdir                  : /tmp
  ftp mirror              : ftp://download.nvidia.com
  RPM file list           : (not specified)

Unable to load: nvidia-installer ncurses user interface

Using built-in stream user interface
-> License accepted.
-> No precompiled kernel interface was found to match your kernel; would you li
   ke the installer to attempt to download a kernel interface for your kernel f
   rom the NVIDIA ftp site (ftp://download.nvidia.com)? (Answer: No)
-> No precompiled kernel interface was found to match your kernel; this means
   that the installer will need to compile a new kernel interface.
-> Performing CC sanity check with CC="cc".
-> Performing CC version check with CC="cc".
-> Kernel source path: '/lib/modules/2.6.28.8/source'
-> Kernel output path: '/lib/modules/2.6.28.8/build'
ERROR: If you are using a Linux 2.4 kernel, please make sure
       you either have configured kernel sources matching your
       kernel or the correct set of kernel headers installed
       on your system.
       
       If you are using a Linux 2.6 kernel, please make sure
       you have configured kernel sources matching your kernel
       installed on your system. If you specified a separate
       output directory using either the "KBUILD_OUTPUT" or
       the "O" KBUILD parameter, make sure to specify this
       directory with the SYSOUT environment variable or with
       the equivalent nvidia-installer command line option.
       
       Depending on where and how the kernel sources (or the
       kernel headers) were installed, you may need to specify
       their location with the SYSSRC environment variable or
       the equivalent nvidia-installer command line option.
ERROR: Installation has failed.  Please see the file
       '/var/log/nvidia-installer.log' for details.  You may find suggestions
       on fixing installation problems in the README available on the Linux
       driver download page at www.nvidia.com. 

作者: ext3   发布时间: 2009-04-16

重新安装源码树不行吗?

作者: d00m3d   发布时间: 2009-04-16

版主说的重新安装源代码树是不是就是重新编译内核,我已经重新编译过了,源代码存放的路径有没有具体的要求,我放到了/usr/src下,并建了个linux的软连接,但我安装lfs编译内核的时候并不是放在这个路径的,我的显卡是Quadro NVS 140M,用的驱动版本是NVIDIA-Linux-x86-100.14.23-pkg1.run

作者: ext3   发布时间: 2009-04-17

不是重新编译内核,是重新安装内核的源码并将其配置好(让它生成 config.h)後,再去编译显驱

其实说穿了,显驱也就是内核模块而矣,所以编译它要相同当前版本内核的源码树

作者: d00m3d   发布时间: 2009-04-18

这个问题,
似乎、好象、大概……
我遇上过,
安装好内核以后,
装N卡驱动时,
提示找不到内核,
没办法完成安装显卡驱动。


参考解决方法如下:

1、
去重新下载一个相同版本的内核,
解压缩后,
记录下所放置的位置。
比如我把解压缩后的内核放在/tmp这里,
则正确的路径是:
/tmp/linux-内核版本号

2、
接着退回到字符模式里面,
运行NVIDIA-Linux-x86-100.14.23-pkg1.run
等系统提示找不到内核时,
你赶紧输入刚刚放置内核的路径:
/tmp/linux-内核版本号
接着按回车就行了。

3、
按照安装N卡的国际惯例,
修改xorg.conf文件,
把“Driver "nv"”
(或者Driver "vesa"、Driver "fbdev")
修改为Driver "nvidia"。
找到Section "Module"字段:
检查注释掉Load "dri"和Load "GLCore"
检查加入Load "glx"。

4、
!·#¥%……—*

作者: 青铜镜   发布时间: 2009-04-18

请问版主怎么才能生成config.h这个文件?

作者: ext3   发布时间: 2009-04-21

就是配置好内核就会自动生成,所以你把旧内核的 config 读入然後再保存就行了

作者: d00m3d   发布时间: 2009-04-21

引用:
作者: 青铜镜
2、
接着退回到字符模式里面,
运行NVIDIA-Linux-x86-100.14.23-pkg1.run
等系统提示找不到内核时,
你赶紧输入刚刚放置内核的路径:
/tmp/linux-内核版本号
接着按回车就行了。
今天我在公司试了一下,好像碰到相同问题了

但是当系统提示找不到内核的时候,根本没有机会去输入任何路径。我又试用 --kernel-sources-path=xxxxxx,同样没戏 :(

请问镜兄是怎样去输入路径的?

作者: d00m3d   发布时间: 2009-04-21

引用:
作者: d00m3d
就是配置好内核就会自动生成,所以你把旧内核的 config 读入然後再保存就行了
把旧的config文件读入保存后报
PHP 代码:
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Tue Apr 21 22:08:52 2009

option status:
  license pre-accepted    : false
  update                  : false
  force update            : false
  expert                  : false
  uninstall               : false
  driver info             : false
  precompiled interfaces  : true
  no ncurses color        : false
  query latest version    : false
  OpenGL header files     : true
  no questions            : false
  silent                  : false
  no recursion            : false
  no backup               : false
  kernel module only      : false
  sanity                  : false
  add this kernel         : false
  no runlevel check       : false
  no network              : false
  no ABI note             : false
  no RPMs                 : false
  no kernel module        : false
  force SELinux           : default
  no X server check       : false
  force tls               : (not specified)
  X install prefix        : (not specified)
  X library install path  : (not specified)
  X module install path   : (not specified)
  OpenGL install prefix   : (not specified)
  OpenGL install libdir   : (not specified)
  utility install prefix  : (not specified)
  utility install libdir  : (not specified)
  doc install prefix      : (not specified)
  kernel name             : (not specified)
  kernel include path     : (not specified)
  kernel source path      : (not specified)
  kernel output path      : (not specified)
  kernel install path     : (not specified)
  proc mount point        : /proc
  ui                      : (not specified)
  tmpdir                  : /tmp
  ftp mirror              : ftp://download.nvidia.com
  RPM file list           : (not specified)

Unable to load: nvidia-installer ncurses user interface

Using built-in stream user interface
-> License accepted.
-> No precompiled kernel interface was found to match your kernel; would you li
   ke the installer to attempt to download a kernel interface for your kernel f
   rom the NVIDIA ftp site (ftp://download.nvidia.com)? (Answer: No)
-> No precompiled kernel interface was found to match your kernel; this means
   that the installer will need to compile a new kernel interface.
-> Performing CC sanity check with CC="cc".
-> Performing CC version check with CC="cc".
ERROR: The kernel header file
       '/lib/modules/2.6.28.8/build/include/linux/version.h' does not exist. 
       The most likely reason for this is that the kernel source files in
       '/lib/modules/2.6.28.8/build' have not been configured.
ERROR: Installation has failed.  Please see the file
       '/var/log/nvidia-installer.log' for details.  You may find suggestions
       on fixing installation problems in the README available on the Linux
       driver download page at www.nvidia.com. 
然后我又执行了
make oldconfig
make include/linux/version.h
接着报
PHP 代码:
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Tue Apr 21 22:12:47 2009

option status:
  license pre-accepted    : false
  update                  : false
  force update            : false
  expert                  : false
  uninstall               : false
  driver info             : false
  precompiled interfaces  : true
  no ncurses color        : false
  query latest version    : false
  OpenGL header files     : true
  no questions            : false
  silent                  : false
  no recursion            : false
  no backup               : false
  kernel module only      : false
  sanity                  : false
  add this kernel         : false
  no runlevel check       : false
  no network              : false
  no ABI note             : false
  no RPMs                 : false
  no kernel module        : false
  force SELinux           : default
  no X server check       : false
  force tls               : (not specified)
  X install prefix        : (not specified)
  X library install path  : (not specified)
  X module install path   : (not specified)
  OpenGL install prefix   : (not specified)
  OpenGL install libdir   : (not specified)
  utility install prefix  : (not specified)
  utility install libdir  : (not specified)
  doc install prefix      : (not specified)
  kernel name             : (not specified)
  kernel include path     : (not specified)
  kernel source path      : (not specified)
  kernel output path      : (not specified)
  kernel install path     : (not specified)
  proc mount point        : /proc
  ui                      : (not specified)
  tmpdir                  : /tmp
  ftp mirror              : ftp://download.nvidia.com
  RPM file list           : (not specified)

Unable to load: nvidia-installer ncurses user interface

Using built-in stream user interface
-> License accepted.
-> No precompiled kernel interface was found to match your kernel; would you li
   ke the installer to attempt to download a kernel interface for your kernel f
   rom the NVIDIA ftp site (ftp://download.nvidia.com)? (Answer: No)
-> No precompiled kernel interface was found to match your kernel; this means
   that the installer will need to compile a new kernel interface.
-> Performing CC sanity check with CC="cc".
-> Performing CC version check with CC="cc".
ERROR: Unable to determine the version of the kernel sources located in
       '/lib/modules/2.6.28.8/source'.  Please make sure you have installed the
       kernel source files for your kernel and that they are properly
       configured; on Red Hat Linux systems, for example, be sure you have the
       'kernel-source' or 'kernel-devel' RPM installed.  If you know the
       correct kernel source files are installed, you may specify the kernel
       source path with the '--kernel-source-path' command line option.
ERROR: Installation has failed.  Please see the file
       '/var/log/nvidia-installer.log' for details.  You may find suggestions
       on fixing installation problems in the README available on the Linux
       driver download page at www.nvidia.com. 
弄来弄去问题又回到原来的位置了,我试着用--kernel-source-path也是不行

作者: ext3   发布时间: 2009-04-22

引用:
作者: d00m3d
今天我在公司试了一下,好像碰到相同问题了

但是当系统提示找不到内核的时候,根本没有机会去输入任何路径。我又试用 --kernel-sources-path=xxxxxx,同样没戏 :(

请问镜兄是怎样去输入路径的?



我当时就是用这个方法安装上的:

--kernel-sources-path=/tmp/linux-版本号

你仔细再看看出错说明,
并多试几次。


我并不是一次就安装成功,
系统提示找不到内核后退出安装,
我把内核解压缩后记录路径,
又再重新运行安装文件,
才安装上驱动。

作者: 青铜镜   发布时间: 2009-04-23

还有,
N卡的驱动有不同版本,
我试了一个装不上,
我又再找另外不同版本的来装,
才终于装上的。


你试了这个不行,
NVIDIA-Linux-x86-100.14.23-pkg1.run
你可换别的不同版本的驱动。
不用在一条路上走到黑!

作者: 青铜镜   发布时间: 2009-04-23

引用:
作者: 青铜镜
还有,
N卡的驱动有不同版本,
我试了一个装不上,
我又再找另外不同版本的来装,
才终于装上的。


你试了这个不行,
NVIDIA-Linux-x86-100.14.23-pkg1.run
你可换别的不同版本的驱动。
不用在一条路上走到黑!
好像这是最新的支持Quadro NVS 140M的版本了,另外进入linux后用一会机器就会很热,是因为没安显卡驱动的原因还是其他的设置有问题?

作者: ext3   发布时间: 2009-04-23

引用:
作者: 青铜镜
我当时就是用这个方法安装上的:

--kernel-sources-path=/tmp/linux-版本号

你仔细再看看出错说明,
并多试几次。


我并不是一次就安装成功,
系统提示找不到内核后退出安装,
我把内核解压缩后记录路径,
又再重新运行安装文件,
才安装上驱动。
试了很多次,也试了 N 个版,尚未搞定

真奇怪,同一部脑,Debian Sid 下却无往而不利!

作者: d00m3d   发布时间: 2009-04-24

加载旧的config文件后保存并没有生成config.h这个文件呀

作者: ext3   发布时间: 2009-04-24

引用:
作者: d00m3d
试了很多次,也试了 N 个版,尚未搞定

真奇怪,同一部脑,Debian Sid 下却无往而不利!

现在很少上网,
在看中医典籍。
等回去查找我的记录,
再上来回复您老人家……

作者: 青铜镜   发布时间: 2009-04-24

引用:
作者: ext3
加载旧的config文件后保存并没有生成config.h这个文件呀
I am sorry. I mixed up. It should be include/linux/version.h

Anyway, I found a solution and solved the problem. I cannot describe too much right now while I am still on duty. Let me put down the solution at night.

作者: d00m3d   发布时间: 2009-04-24

提示找不到内核代码,安装了内核后
make prepare
就可以了.

作者: SCys   发布时间: 2009-04-24

Nvidia driver: 180.51
Kernel: 2.6.30-rc2
Compiler: gcc-4.4.0

Steps:

1. 重新建立源碼樹
代码:
bzip2 -d patch-2.6.30-rc2.bz2
tar xf linux-2.6.29.tar.bz2
cd linux-2.6.29
patch -Np1 -i../patch-2.6.30-rc2
cd ..
mv linux-2.6.29 linux-2.6.30-rc2
2. 用回原有的 config
代码:
cd linux-2.6.30-rc2
make mrproper
cp /boot/config-2.6.30-rc2 .config
3. 讓系統自動配置好環境

代码:
make prepare
4. 編譯出 modpost 命令

如果不進行這步驟,後面會出現 /bin/sh: scripts/mod/modpost: not found

但是 make scripts/mod/modpost 是不行的,所以要用:

代码:
make modules
並不需要把所有的模塊都來重新編譯,請留意屏幕的顯示,只要 scripts/mod/modpost 編譯出來就足夠了,出現後就可以 Ctrl+C 中止編譯,其他的都可以不要

5. 運行 Nvidia 的安裝程式(以下全以 root 進行)

當前的目錄仍是 linux-2.6.30-rc2,先退到 Nvidia 安裝程式所在的位置,然後執行

代码:
sh ./NVIDIA-Linux-x86-180.51-pkg1.run --kernel-source-path=xxxxxxx/linux-2.6.30-rc2
編譯隨之進行

6. 重新配置 xorg.conf

可以用 nvidia-xconfig 自動來,或者參考 /usr/share/doc/NVIDIA_GLX-1.0/README.txt 自己手動更改

大功告成!

作者: d00m3d   发布时间: 2009-04-25

引用:
作者: d00m3d
...
Kernel: 2.6.30-rc2
...
不推荐使用2.6.30的rc系列
里面的reserifs文件系统有问题.
fs/namei.c中的1251行很容易引起oops ~_~

维护者说在正式发布的时候才会去除这个测试.

作者: SCys   发布时间: 2009-04-26

对我来说这没有问题,反正我不用 reiserfs

但是我用 ext4,2.6.30 系列修正了 truncation 引致的潜在资料损失问题

作者: d00m3d   发布时间: 2009-04-26

引用:
作者: d00m3d
对我来说这没有问题,反正我不用 reiserfs

但是我用 ext4,2.6.30 系列修正了 truncation 引致的潜在资料损失问题
郁闷的问题就在这里,我这里不仅用到reiserfs,也有ext4.
真是选哪一边都有缺点.无奈,只有将就着用.

作者: SCys   发布时间: 2009-04-26

终于搞定了,感谢版主、青铜镜、SCys 的热心解答

作者: ext3   发布时间: 2009-04-27

热门下载

更多