Brothers with nv cards are estimated to have experienced the new kernel upgrade, the graphics card driver is again manually install once. Although not very difficult, but also very troublesome. Ubuntuforums.org today read an article introduced the use of scripts to automatically install nv driver. You can try a bit. The original and translated a bit under the order, to share with you.
upgrade the kernel driver will automatically install the nvdia
If you are using the official website in the nv driver, every time the kernel upgrade , you must manually install the nv driver. Objective of these guidelines is when the kernel automatically install the driver after the upgrade process, without the need for manual intervention.
This article assumes that you have correctly installed the official nvidia driver, and reboot after installation has at least one (this is important because if you do not have installed correctly and restart, the following will does not work). Use of non-driven skip.
first step, you use the drive into / usr / src under, and generate links. For example:
sudo mv NVIDIA-Linux-x86-190.42-pkg0.run / usr / src
sudo ln-s / usr/src/NVIDIA-Linux-x86-190.42-pkg0. run / usr / src / nvidia-driver
The aim is to be used when you replace the drive, only need to remove the original link and then specify the new link is may, without changing the script we will use (script).
automatically install the nv driver of the script as follows:
code:
#! / bin / bash
#
# Set this to the exact path of the nvidia driver you plan to use
# It is recommended to use a symlink here so that this script doesn't
# have to be modified when you change driver versions.
DRIVER = / usr / src / nvidia-driver
# Build new driver if it doesn't exist
if [-e / lib / modules / $ 1/kernel/drivers/video/nvidia.ko]; then
echo "NVIDIA driver already exists for this kernel."> & 2
else
; echo "Building NVIDIA driver for kernel $ 1"> & 2
sh $ DRIVER-K-k $ 1-s-n 2> 1> / dev / null
if [-e / lib / modules / $ 1/kernel/drivers/video / nvidia.ko]; then
echo "SUCCESS: Driver installed for kernel $ 1" ;> & 2
else
; echo "FAILURE: See / var / log / nvidia-installer.log"> & 2
; fi
fi
exit 0
Basically, principle is to check whether the newly installed kernel nv driver is installed correctly, if not, the script will automatically install the new kernel driver module.
the above script named update-nvidia, and through the following command to install:
sudo mkdir-p / etc / kernel / postinst.d < br> sudo install update-nvidia / etc / kernel / postinst.d
original posted source: [url = http://blog.daliansky .net / let-ubuntu-update-kernel-automatically-compile-an-official-version-of-nvidia-driver-module.html]
没有评论:
发表评论