首先,解包内核驱动程序源代码。
cd /usr/src tar -xvzf NVIDIA_kernel-1.0-2314.tar.gz tar -xvzf NVIDIA_GLX-1.0-2313.tar.gz cd NVIDIA_kernel-1.0-2314 |
Linux 内核源代码可以使用 AGP 字符设备进行编译,Nvidia 驱动程序可以使用该设备来获得更好的性能。如果您的内核没有为您的主板芯片组编译 AGP 驱动程序,那么如果您的显卡是 AGP 显卡,则 Nvidia 内核驱动程序会使用其内置的 AGP 支持。如果您想尝试 Linux 内核 AGP 支持,您应该能够使用适当的支持重新构建和安装您的内核
cd /usr/src/linux make menuconfig # Go to Character devices and put a * by /dev/agpgart support # and also put a * by your motherboard chipset type. # Go to the Processor type and features and put a * by # MTTR support. # Save the config. make make modules make install make modules_install reboot |
可以对文件进行进一步的调整os-registry.c在 NVIDIA 内核源代码中。查看此文件,您将看到许多标志变量(它们可以设置为 0 或 1)来控制影响性能和稳定性的选项!您应该首先使用未修改的文件尝试您的配置,以查看您的系统是否正常工作。如果可以,您可以尝试这些选项。您可以在此处尝试的选项包括
在 VIA 芯片组上启用 AGP 4x(默认情况下仅限制为 2x)
启用 Side Band Addressing(您的显卡需要支持此功能)
启用 Fast Writes(IIRC,这也必须在您的主板 BIOS 中启用)
![]() | 如果您在启动 X 时遇到问题,请参阅文件TNT_USERS_README和M64_USERS_README。这些文件解释了如何调整内核驱动程序。它们是为修复 TNT 和 TNT2 M64 显卡的问题而编写的,但据报告,这些调整也有助于 GeForce2 MX。尝试绕过 BIOS,如M64_USERS_README. |
在您调整(或未调整)您的 Linux 内核和os-registry.c文件之后,您可以构建和安装内核模块。
# The make command will build and install the driver: make |
安装 Nvidia OpenGL 库包并没有什么特别的。首先,您需要清理一些旧文件。
# delete the libGL.* files that come with XFree86 / Mesa ... # the nvidia libGL.* should replace them # The more recent Nvidia Makefile installer does this for you. cd /usr/X11R6/lib rm libGL.* cd modules/extensions rm libGL* rm libglx* cd /usr/lib rm libGL.* |
在冲突的旧文件被删除后,您可以开始安装。
cd .. cd NVIDIA_GLX-1.0-2313 make ldconfig # make might not install the C header files that come with # the libraries in the NVIDIA_GLX package so, do this: cd usr/include/GL cp *.h /usr/include/GL # usr/include/GL is a subdirectory in the NVIDIA_GLX package. # /usr/include/GL should be a symlink to /usr/X11R6/include/GL # so you could copy to there instead if you want. # Make a basic XF86Config file using the "nv" driver: cd /etc/X11 xf86config # Follow the prompts and fill in the information xf86config asks for. # Select the Nvidia GeForce or appropriate name. # You can test X with this XF86Config file, or continue for OpenGL: # You must edit XF86Config and set the following: vi XF86Config # Load "glx" # Replace 'driver "nv"' with 'driver "nvidia"' # Put "1600x1200" first (or your preferred screen resolution) # Copy ttf fonts from Windows into a font directory and add a font path. # Use ttmkfdir (check freshmeat.net) to a fonts.dir file. # A good place to keep your own fonts is /usr/local/share/fonts ... # Nvidia drivers do NOT use the dri module - don't load it. # You may like to edit /etc/X11/xinit/xinitrc to have run "startkde" # or "gnome-session" instead of twm. # Note: /usr/include/GL should be a symlink to /usr/X11R6/include/GL |
在XF86Config中为驱动程序指定 “nvidia” 会使每次您 startx 时都生效。但是NVdriver内核驱动程序必须在您 startx 之前加载。可以使用以下命令加载:
# to load it insmod NVdriver # If you need to unload it: rmmod NVdriver |
alias char-major-195 NVdriver |
根据我的经验,如果您编译、加载和卸载 NVdriver 模块,您的视频系统将变得不稳定。您应该在重新构建此模块后重新启动系统,以帮助确保您的系统不会在 X 中锁定。可能会发生您的屏幕变黑并且键盘在切换 NVdriver 后变得无响应。建议始终有另一台具有 telnet 或 ssh 的计算机,您可以使用它来进入您的 Linux 机器并在发生这种情况时正确关闭它。