# Ptoblem with Nvidia driver on linux 3.10-git

**URL:** <https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408>\
**Category:** Linux\
**Created:** [August 9, 2013, 4:14pm UTC](https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408 "2013-08-09T16:14:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahashakti89](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mahashakti89](https://forums.developer.nvidia.com/u/mahashakti89)\
**Post date:** [August 9, 2013, 4:14pm UTC](https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408/1 "2013-08-09T16:14:29Z")

</div>

Hello,

I am running Debian Sid with linux-image-3.10-1-amd64, Nvidia driver is installing and running flawlessly.  
For some extra options I am building my own kernel based on the git tree but I cannot install the linux-driver … I tried it one more time with the last version -325.15, hoping it would adress the problem but I get following error message :

```auto
/data/Kernel/linux-git/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’:
   /data/Kernel/linux-git/arch/x86/include/asm/uaccess_64.h:62:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (likely(sz == -1 || sz >= n))
                               ^
   include/linux/compiler.h:152:40: note: in definition of macro ‘likely’
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   In file included from /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:15:0:
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c: In function ‘os_get_system_memory_size’:
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:961:41: error: ‘num_physpages’ undeclared (first use in this function)
    #define NV_NUM_PHYSPAGES num_physpages
                                            ^
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:244:21: note: in expansion of macro ‘NV_NUM_PHYSPAGES’
        return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
                        ^
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:961:41: note: each undeclared identifier is reported only once for each function it appears in
    #define NV_NUM_PHYSPAGES num_physpages
                                            ^
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:244:21: note: in expansion of macro ‘NV_NUM_PHYSPAGES’
        return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
                        ^
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:245:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   make[2]: *** [/tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.o] Erreur 1
   make[1]: *** [_module_/tmp/selfgz7454/NVIDIA-Linux-x86_64-325.15/kernel] Erreur 2
   make[1]: quittant le répertoire « /data/Kernel/linux-git »
   NVIDIA: left KBUILD.
   nvidia.ko failed to build!
   make: *** [module] Erreur 1
-> Error.
ERROR: Unable to build the NVIDIA kernel module.
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.

```

Has anyone a clue about this ?

Thanks

---

<div class="post-metadata">

**Author:** ![leigh123linux](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/leigh123linux/32/413694_2.png) [@leigh123linux](https://forums.developer.nvidia.com/u/leigh123linux)\
**Post date:** [August 10, 2013, 1:12am UTC](https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408/2 "2013-08-10T01:12:06Z")

</div>

It needs patching

[url][http://cvs.rpmfusion.org/viewvc/\*checkout\*/rpms/nvidia-kmod/devel/kernel\_v3.11.patch?revision=1.1&root=nonfree[/url]](http://cvs.rpmfusion.org/viewvc/*checkout*/rpms/nvidia-kmod/devel/kernel_v3.11.patch?revision=1.1&root=nonfree%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![mahashakti89](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mahashakti89](https://forums.developer.nvidia.com/u/mahashakti89)\
**Post date:** [August 10, 2013, 6:30am UTC](https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408/3 "2013-08-10T06:30:38Z")

</div>

> [@leigh123linux](#):
>
> It needs patching
> 
> [http://cvs.rpmfusion.org/viewvc/_checkout_/rpms/nvidia-kmod/devel/kernel\_v3.11.patch?revision=1.1&root=nonfree](http://cvs.rpmfusion.org/viewvc/*checkout*/rpms/nvidia-kmod/devel/kernel_v3.11.patch?revision=1.1&root=nonfree)

Hi,

Thanks for the patch … Patching is O.K. but thr driver won’t install :

```auto
In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from /data/Kernel/linux-git/include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/uapi/linux/capability.h:16,
                    from include/linux/capability.h:15,
                    from include/linux/sched.h:13,
                    from include/linux/utsname.h:5,
                    from /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:44,
                    from /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:15:
   /data/Kernel/linux-git/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’:
   /data/Kernel/linux-git/arch/x86/include/asm/uaccess_64.h:62:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (likely(sz == -1 || sz >= n))
                               ^
   include/linux/compiler.h:152:40: note: in definition of macro ‘likely’
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   In file included from /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:15:0:
   /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c: In function ‘os_get_system_memory_size’:
   /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:964:41: error: ‘num_physpages’ undeclared (first use in this function)
    #define NV_NUM_PHYSPAGES num_physpages
                                            ^
   /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:244:21: note: in expansion of macro ‘NV_NUM_PHYSPAGES’
        return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
                        ^
   /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/nv-linux.h:964:41: note: each undeclared identifier is reported only once for each function it appears in
    #define NV_NUM_PHYSPAGES num_physpages
                                            ^
   /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:244:21: note: in expansion of macro ‘NV_NUM_PHYSPAGES’
        return (((NvU64)NV_NUM_PHYSPAGES * PAGE_SIZE) / RM_PAGE_SIZE);
                        ^
   /tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.c:245:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
   make[2]: *** [/tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel/os-interface.o] Erreur 1
   make[1]: *** [_module_/tmp/selfgz6376/NVIDIA-Linux-x86_64-325.15/kernel] Erreur 2
   make[1]: quittant le répertoire « /data/Kernel/linux-git »
   NVIDIA: left KBUILD.
   nvidia.ko failed to build!
   make: *** [module] Erreur 1
-> Error.
ERROR: Unable to build the NVIDIA kernel module.

```

Best regards

---

<div class="post-metadata">

**Author:** ![leigh123linux](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/leigh123linux/32/413694_2.png) [@leigh123linux](https://forums.developer.nvidia.com/u/leigh123linux)\
**Post date:** [August 10, 2013, 7:39am UTC](https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408/4 "2013-08-10T07:39:56Z")

</div>

I have altered the patch as the debian git kernel seems to be versioned wrong.  
surely it should be 3.11.0 !

$ uname -r  
3.11.0-0.rc4.git1.2.fc20.x86\_64

```auto
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -957,7 +957,11 @@ static inline int nv_execute_on_all_cpus
 #endif
 
 #if !defined(NV_VMWARE)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+#define NV_NUM_PHYSPAGES get_num_physpages()
+#else
 #define NV_NUM_PHYSPAGES num_physpages
+#endif
 #define NV_GET_CURRENT_PROCESS() current->tgid
 #define NV_IN_ATOMIC() in_atomic()
 #define NV_LOCAL_BH_DISABLE() local_bh_disable()

```

---

<div class="post-metadata">

**Author:** ![mahashakti89](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mahashakti89](https://forums.developer.nvidia.com/u/mahashakti89)\
**Post date:** [August 10, 2013, 2:36pm UTC](https://forums.developer.nvidia.com/t/ptoblem-with-nvidia-driver-on-linux-3-10-git/30408/5 "2013-08-10T14:36:10Z")

</div>

[quote=“leigh123linux”]

I have altered the patch as the debian git kernel seems to be versioned wrong.  
surely it should be 3.11.0 !

$ uname -r  
3.11.0-0.rc4.git1.2.fc20.x86\_64

Hi,

Works now with linux-3.10-git but no more with a Debian linux-image. But nonetheless big thanks … !  
Kernel version for Debian is really linux-3.10 I should have paid more attention .

mahashakti89

mahashakti89
