Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487986 - nvidia-drivers with kernel >=3.11 not build (num_physpages incompatibility)
Summary: nvidia-drivers with kernel >=3.11 not build (num_physpages incompatibility)
Status: RESOLVED DUPLICATE of bug 447566
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: Normal major (vote)
Assignee: Gentoo Linux bug wranglers
Depends on:
Reported: 2013-10-14 09:25 UTC by Niels Dettenbach
Modified: 2013-10-14 12:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Niels Dettenbach 2013-10-14 09:25:24 UTC
Hi all,

nvidia-drivers could not be build on my system with kernel sources (gentoo-sources) up from 3.11.x - tested 3.11.4 and 3.11.2 kernel with nvidia-sources 325.15 and 331.13).

It seems that "num_physpages" got renamed into get_num_physpages" and "num_physpages" is not longer available in kernels >= 3.11.

--- snip ---
/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-331.13/kernel/os-interface.c:15:0:
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-331.13/kernel/os-interface.c: In function ‘os_get_system_memory_size’:
   /tmp/selfgz7454/NVIDIA-Linux-x86_64-331.13/kernel/nv-linux.h:961:41: error: ‘num_physpages’ undeclared (first use in this function)
    #define NV_NUM_PHYSPAGES                num_physpages
--- snap ---

I've done following patching for current nvidia-drivers-331.13:

--- snip ---
--- kernel.orig/nv-linux.h   2013-09-30 05:47:18.000000000 +0200
+++ kernel/nv-linux.h     2013-10-14 10:27:14.520070619 +0200
@@ -956,7 +956,11 @@
 #if !defined(NV_VMWARE)
-#define NV_NUM_PHYSPAGES                num_physpages
+#define NV_NUM_PHYSPAGES               get_num_physpages
+#define NV_NUM_PHYSPAGES               num_physpages
 #define NV_GET_CURRENT_PROCESS()        current->tgid
 #define NV_IN_ATOMIC()                  in_atomic()
 #define NV_LOCAL_BH_DISABLE()           local_bh_disable()

--- snap ---

Pls check back on other platforms and if it is notorious pls integrate the patch into the ebuild(s).


Niels Dettenbach. 
Internet & Open Source
Comment 1 Jeroen Roovers gentoo-dev 2013-10-14 12:30:36 UTC

*** This bug has been marked as a duplicate of bug 447566 ***