Building nvidia driver on kernel 3.9.0
  1 / 3    
Hello, Having trouble with installing the nvidia driver on a 3.9.0. kernel. I get following error message : from /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-linux.h:115, from /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c:15: /usr/src/linux-3.9.0/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’: /usr/src/linux-3.9.0/arch/x86/include/asm/uaccess_64.h:62:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c: In function ‘nv_i2c_del_adapter’: /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c:316:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c:328:13: error: void value not ignored as it ought to be make[4]: *** [/usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.o] Error 1 make[3]: *** [_module_/usr/src/NVIDIA-Linux-x86_64-319.17/kernel] Error 2 make[2]: *** [sub-make] Error 2 NVIDIA: left KBUILD. nvidia.ko failed to build! make[1]: *** [module] Error 1 make: *** [install] Error 2 I did a fair bit of googling around, but I have no clue how to solve this ... I also tried with former versions of the driver . Regards
Hello,

Having trouble with installing the nvidia driver on a 3.9.0. kernel. I get following error message :

from /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-linux.h:115,
from /usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c:15:
/usr/src/linux-3.9.0/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’:
/usr/src/linux-3.9.0/arch/x86/include/asm/uaccess_64.h:62:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
/usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c: In function ‘nv_i2c_del_adapter’:
/usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c:316:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
/usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.c:328:13: error: void value not ignored as it ought to be
make[4]: *** [/usr/src/NVIDIA-Linux-x86_64-319.17/kernel/nv-i2c.o] Error 1
make[3]: *** [_module_/usr/src/NVIDIA-Linux-x86_64-319.17/kernel] Error 2
make[2]: *** [sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [module] Error 1
make: *** [install] Error 2

I did a fair bit of googling around, but I have no clue how to solve this ... I also tried with former versions of the driver .

Regards

#1
Posted 05/12/2013 11:57 AM   
I have this error too, but it is on 3.10-rc1 kernel. On 3.9.0 and 3.9.1 it was working ok. Here is the DKMS make log for 319.17 on 3.10-rc1: http://pastebin.com/MTvV8Fc5
I have this error too, but it is on 3.10-rc1 kernel. On 3.9.0 and 3.9.1 it was working ok.
Here is the DKMS make log for 319.17 on 3.10-rc1: http://pastebin.com/MTvV8Fc5

#2
Posted 05/12/2013 12:06 PM   
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=71546300c8684eb69286604c79624582c16f2f5b this should work: [code] @@ -311,8 +311,6 @@ BOOL NV_API_CALL nv_i2c_del_adapter(nv_state_t *nv, void *data) { struct i2c_adapter *pI2cAdapter = (struct i2c_adapter *)data; - int osstatus = 0; - BOOL wasReleased = FALSE; #if defined(KERNEL_2_4) if (!NV_WEAK_SYMBOL_PRESENT(i2c_add_adapter)) @@ -324,15 +322,10 @@ if (!pI2cAdapter) return FALSE; // attempt release with the OS - osstatus = i2c_del_adapter(pI2cAdapter); + i2c_del_adapter(pI2cAdapter); + os_free_mem(pI2cAdapter); - if (!osstatus) - { - os_free_mem(pI2cAdapter); - wasReleased = TRUE; - } - - return wasReleased; + return TRUE; } #else // (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE))[/code] but there is a worse problem with this: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0206fb55540cfdc3a2634ffdafc6f1d86cf1f15 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3cb5bf1bf947d325fcf6e9458952b51cfd7e6677
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=71546300c8684eb69286604c79624582c16f2f5b


this should work:
@@ -311,8 +311,6 @@
BOOL NV_API_CALL nv_i2c_del_adapter(nv_state_t *nv, void *data)
{
struct i2c_adapter *pI2cAdapter = (struct i2c_adapter *)data;
- int osstatus = 0;
- BOOL wasReleased = FALSE;

#if defined(KERNEL_2_4)
if (!NV_WEAK_SYMBOL_PRESENT(i2c_add_adapter))
@@ -324,15 +322,10 @@
if (!pI2cAdapter) return FALSE;

// attempt release with the OS
- osstatus = i2c_del_adapter(pI2cAdapter);
+ i2c_del_adapter(pI2cAdapter);
+ os_free_mem(pI2cAdapter);

- if (!osstatus)
- {
- os_free_mem(pI2cAdapter);
- wasReleased = TRUE;
- }
-
- return wasReleased;
+ return TRUE;
}

#else // (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE))


but there is a worse problem with this:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d0206fb55540cfdc3a2634ffdafc6f1d86cf1f15

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3cb5bf1bf947d325fcf6e9458952b51cfd7e6677

#3
Posted 05/12/2013 02:40 PM   
Does anyone have any patch for nv-procfs.c file errors? :) I tried to exclude it from driver compile (deleted it from "make files", but then I get this: " FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol 'system_wq' "
Does anyone have any patch for nv-procfs.c file errors? :) I tried to exclude it from driver compile (deleted it from "make files", but then I get this: " FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol 'system_wq' "

#4
Posted 05/13/2013 03:24 PM   
install today linux-3.9.2 in archlinux and build nvidia 319.17 without problem (through DKMS, with my own package, not from the repos)
install today linux-3.9.2 in archlinux and build nvidia 319.17 without problem (through DKMS, with my own package, not from the repos)

#5
Posted 05/13/2013 04:23 PM   
essentially: [b]me too[/b]. 304.88-1 and 304.88-2 are suddenly broken via "nv-i2c.c function ‘nv_i2c_del_adapter’ : error: void value not ignored as it ought to be" then any kernel >= 3.10.0-rc1 breaks nv-procfs.c due to the create_proc_entry() to proc_create() transition. in short, beware of doing update/dist-upgrade on a debian-oid box after today if you own an nvidia card (if for no other reason dkms will be directed to remove a working module and replace with one that will not compile) thank you folks for trying to fix this.
essentially: me too.

304.88-1 and 304.88-2 are suddenly broken via "nv-i2c.c function ‘nv_i2c_del_adapter’ : error: void value not ignored as it ought to be"

then any kernel >= 3.10.0-rc1 breaks nv-procfs.c due to the create_proc_entry() to proc_create() transition.

in short, beware of doing update/dist-upgrade on a debian-oid box after today if you own an nvidia card (if for no other reason dkms will be directed to remove a working module and replace with one that will not compile)

thank you folks for trying to fix this.

#6
Posted 05/13/2013 05:36 PM   
Sorry to be so late with answering . I tried the proposed patch - Thanks - but it doesn't work . And it seems there are also other problems with the installation of the driver. Regards
Sorry to be so late with answering . I tried the proposed patch - Thanks - but it doesn't work .
And it seems there are also other problems with the installation of the driver.

Regards

#7
Posted 05/13/2013 06:57 PM   
The patch works in that it eliminates *some* of the errors on 3.10-rc1. I'm working on the issues with proc. The new interface has been in kernel for some time, it's just the removal of the old one that's recent. Strictly a spare-time effort, though, so it will be a bit. :)
The patch works in that it eliminates *some* of the errors on 3.10-rc1. I'm working on the issues with proc. The new interface has been in kernel for some time, it's just the removal of the old one that's recent. Strictly a spare-time effort, though, so it will be a bit. :)

#8
Posted 05/14/2013 06:11 AM   
--- conftest.sh.orig 2013-05-18 22:56:22.529438000 -0430 +++ conftest.sh 2013-05-18 23:05:41.939250703 -0430 @@ -203,7 +203,7 @@ if [ "$OUTPUT" != "$SOURCES" ]; then MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-default" - if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then + if [ "$ARCH" = "x86" -o "$ARCH" = "x86_64" ]; then MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default" MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi" @@ -217,7 +217,7 @@ fi else MACH_CFLAGS="-I$HEADERS/asm/mach-default" - if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then + if [ "$ARCH" = "x86" -o "$ARCH" = "x86_64" ]; then MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default" MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default" MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi" @@ -234,7 +234,7 @@ CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS $AUTOCONF_CFLAGS" CFLAGS="$CFLAGS -I$HEADERS -I$HEADERS/uapi -I$OUTPUT/include/generated/uapi" - if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then + if [ "$ARCH" = "x86" -o "$ARCH" = "x86_64" ]; then CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include" CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include/uapi" CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated"
--- conftest.sh.orig 2013-05-18 22:56:22.529438000 -0430
+++ conftest.sh 2013-05-18 23:05:41.939250703 -0430
@@ -203,7 +203,7 @@

if [ "$OUTPUT" != "$SOURCES" ]; then
MACH_CFLAGS="-I$HEADERS/asm-$ARCH/mach-default"
- if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
+ if [ "$ARCH" = "x86" -o "$ARCH" = "x86_64" ]; then
MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default"
MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default"
MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi"
@@ -217,7 +217,7 @@
fi
else
MACH_CFLAGS="-I$HEADERS/asm/mach-default"
- if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
+ if [ "$ARCH" = "x86" -o "$ARCH" = "x86_64" ]; then
MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/asm-x86/mach-default"
MACH_CFLAGS="$MACH_CFLAGS -I$SOURCES/arch/x86/include/asm/mach-default"
MACH_CFLAGS="$MACH_CFLAGS -I$HEADERS/arch/x86/include/uapi"
@@ -234,7 +234,7 @@
CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS $AUTOCONF_CFLAGS"
CFLAGS="$CFLAGS -I$HEADERS -I$HEADERS/uapi -I$OUTPUT/include/generated/uapi"

- if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
+ if [ "$ARCH" = "x86" -o "$ARCH" = "x86_64" ]; then
CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include/uapi"
CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated"

#9
Posted 05/19/2013 04:06 AM   
I managed to replace "create_proc_entry" in nv-procfs.c with new "proc_create", and it compiles and work with that on 3.9.1 kernel (but yet again, normal 319.17 driver works for me on that kernel). But then I started 3.10-rc1 kernel, and module does compile (there was an error "error dereferencing pointer to incomplete type"), but can't be loaded. In "dmesg" there was this: nvidia disagrees about version of symbol module_layout I don't know how to make a patch, so here is the #define part of nv-procfs.c that I changed: http://pastebin.com/dMa8v7Yt I tried to add "proc_fops" as 4th argument for "proc_create" as it is in kernels proc_fs.h file, but nothing changes, there is the same error as I mentioned above. BTW, I'm not a programer, so please help with this. I believe I'm on a right path here. :)
I managed to replace "create_proc_entry" in nv-procfs.c with new "proc_create", and it compiles and work with that on 3.9.1 kernel (but yet again, normal 319.17 driver works for me on that kernel). But then I started 3.10-rc1 kernel, and module does compile (there was an error "error dereferencing pointer to incomplete type"), but can't be loaded. In "dmesg" there was this: nvidia disagrees about version of symbol module_layout

I don't know how to make a patch, so here is the #define part of nv-procfs.c that I changed:
http://pastebin.com/dMa8v7Yt

I tried to add "proc_fops" as 4th argument for "proc_create" as it is in kernels proc_fs.h file, but nothing changes, there is the same error as I mentioned above.

BTW, I'm not a programer, so please help with this. I believe I'm on a right path here. :)

#10
Posted 05/20/2013 07:04 PM   
So module compilled with error? Try to add this structure: [code] static const struct file_operations proc_file_fops = { .owner = THIS_MODULE, .open = open_callback, .read = read_callback, }; [/code] And then, modify your proc_create to: [code] proc_create(name, mode, parent, &proc_file_fops); [/code]
So module compilled with error? Try to add this structure:
static const struct file_operations proc_file_fops = {
.owner = THIS_MODULE,
.open = open_callback,
.read = read_callback,
};

And then, modify your proc_create to:
proc_create(name, mode, parent, &proc_file_fops);

#11
Posted 05/20/2013 08:05 PM   
Now we only need definitions for the "open_callback" and "read_callback". That's a placeholder (I also found that snippet on stackoverlow..)
Now we only need definitions for the "open_callback" and "read_callback". That's a placeholder (I also found that snippet on stackoverlow..)

#12
Posted 05/20/2013 08:20 PM   
@Nekroman: Well, it did say "Modul build complited", and I had nvidia.ko in "kernel" folder. Maybe it remained from when I compiled it in 3.9.1. :S I'll try this and see if it works. And if it doesn't work, I'll post nvidia-install.log
@Nekroman: Well, it did say "Modul build complited", and I had nvidia.ko in "kernel" folder. Maybe it remained from when I compiled it in 3.9.1. :S

I'll try this and see if it works. And if it doesn't work, I'll post nvidia-install.log

#13
Posted 05/20/2013 08:38 PM   
It doesn't work. Here is the nvidia-installer.log: http://pastebin.com/YqtABfFj
It doesn't work. Here is the nvidia-installer.log: http://pastebin.com/YqtABfFj

#14
Posted 05/20/2013 09:09 PM   
@Milos_SD: it looks like you set this structure: static const struct file_operations proc_file_fops = { .owner = THIS_MODULE, .open = open_callback, .read = read_callback, }; but didn't provide any proper callback function for "open_callback" nor "read_callback". perhaps even just a stub function would get beyond this point. good for you-all for continuing to pound on this! because otherwise, it's nouveau for some of us from here on out (not that that's terrible... but it's a bit glitchy)
@Milos_SD: it looks like you set this structure:
static const struct file_operations proc_file_fops = {
.owner = THIS_MODULE,
.open = open_callback,
.read = read_callback,
};
but didn't provide any proper callback function for "open_callback" nor "read_callback". perhaps even just a stub function would get beyond this point.

good for you-all for continuing to pound on this! because otherwise, it's nouveau for some of us from here on out (not that that's terrible... but it's a bit glitchy)

#15
Posted 05/22/2013 12:51 AM   
  1 / 3    
Scroll To Top