Ptoblem with Nvidia driver on linux 3.10-git

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 :

/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

It needs patching

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 :

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

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

--- 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()

[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