Ubuntu 13.10安装Nvidia驱动出错解决
声明,只针对Ubuntu 13.10环境NVIDIA-Linux-x86_64-319.60.run版本
安装的前期工作照常。直到要关闭service lightdm这一项。
设NVIDIA-Linux-x86_64-319.60.run的目录位置为<dir>,在<dir>下执行
NVIDIA-Linux-x86_64-319.60.run -x
出现一个同名文件夹。
复制文本:
--- NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.c 2013-09-26 01:02:38.000000000 +0400
+++ NVIDIA-Linux-x86_64-319.60/kernel/nv-drm.c 2013-10-02 14:00:03.617000000 +0400
@@ -201,12 +201,7 @@
memset(&nv_obj->base, 0, sizeof(nv_obj->base));
nv_obj->pages = pages;
- ret = drm_gem_private_object_init(nvl->drm, &nv_obj->base, size);
- if (ret)
- {
- status = RM_ERR_OPERATING_SYSTEM;
- goto done;
- }
+ drm_gem_private_object_init(nvl->drm, &nv_obj->base, size);
ret = drm_gem_handle_create(file_priv, &nv_obj->base, handle);
if (ret)
diff -ur NVIDIA-Linux-x86_64-319.60/kernel/nv-linux.h NVIDIA-Linux-x86_64-319.60/kernel/nv-linux.h
--- NVIDIA-Linux-x86_64-319.60/kernel/nv-linux.h 2013-09-26 01:02:38.000000000 +0400
+++ NVIDIA-Linux-x86_64-319.60/kernel/nv-linux.h 2013-10-02 14:01:31.461000000 +0400
@@ -1037,7 +1037,11 @@
#endif
#if !defined(NV_VMWARE)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
#define NV_NUM_PHYSPAGES num_physpages
+#else
+#define NV_NUM_PHYSPAGES get_num_physpages()
+#endif
#define NV_GET_CURRENT_PROCESS() current->tgid
#define NV_IN_ATOMIC() in_atomic()
#define NV_LOCAL_BH_DISABLE() local_bh_disable()
保存在<dir>下,名字为patchfile.diff文件,执行命令
patch -p0 < patchfile.diff
然后关闭lightdm:
sudo service lightdm stop
然后进入<dir>/NVIDIA-Linux-x86_64-319.60文件夹,执行:
sudo ./nvidia-install
就可以安装了
推荐阅读: