[solved] NVIDIA Linux 3.11 compatibility (error: ‘num_physpages’ undeclared (first use i

/usr/src/nvidia-325.15/os-interface.c: In function ‘os_get_system_memory_size’:
/usr/src/nvidia-325.15/os-interface.c:244:21: error: ‘num_physpages’ undeclared (first use in this function)
/usr/src/nvidia-325.15/os-interface.c:244:21: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/nvidia-325.15/os-interface.c:245:1: warning: control reaches end of non-void function [-Wreturn-type]

Here’s a simple fix for Linux 3.11, edit nv-linux.h and replace num_physpages with get_num_physpages.

Or apply this patch:

--- nvidia-325.15/nv-linux.h    2013-09-06 05:16:30.000000000 +0100
+++ nvidia-325.15-new/nv-linux.h        2013-09-06 05:25:06.000000000 +0100
@@ -958,7 +958,13 @@
 #endif

 #if !defined(NV_VMWARE)
-#define NV_NUM_PHYSPAGES                num_physpages
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 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()

Hopefully NVIDIA will release new drivers with this fix shortly.

Thanks birdie. Bug 1363843 to track this issue.