Kernel 3.3 and NVIDIA driver - FIX

By default the NVIDIA driver does not install on the Tumbleweed kernel 3.3.0-16, but here’s the fix I remembered from years ago, and it works fine on my laptop

Download the 295.20 driver from the NVIDIA site


su -
(enter rootpassword)
cd /usr/src/linux
make cloneconfig
make prepare

This generates missing files causing the NVIDIA-installers to fail. Now we need to put them in the proper place. First go there

when running kernel-desktop, do


cd /lib/modules/3.3.0-16-desktop/source/arch/x86/include/

when running kernel-default, do


cd /lib/modules/3.3.0-16-default/source/arch/x86/include/

Now we need to copy the generated files to the place where the NVIDIA-installer expects them:


cp -v generated/asm/unistd*.h ./asm/

three files will be copied. The system is now prepared for the NVIDIA-installer.

Reboot, in the GRUB screen, hit F5 en choose “System V”, put a space and a “3” behind the “vga=…” option on the option line, and install the driver. Another reboot brings you to a working NVIDIA driver on kernel 3.3

Edit: For those who tried, and failed, please try again, I forgot the “make cloneconfig”,

Meh. Thanks for the help but once the NVIDIA installer failed, I just told myself: what a great opportunity to move to Nouveau and never look back. Nouveau kind of sucks but at least it always works.

Thanks @Knurpht
I obtained the new kernel with zypper dup
rebooted into runlevel 3
switched to /usr/src/linux
ran make prepare
and got this error message:


*** configuration file “.config” not found


etc
etc etc


make: No rule to make target ‘include/config/auto.conf’ needed by ‘include/config/kernel.release’. Stop


I soldiered on, found there were two (not three) files transferred by the process “cp -v generated/asm/uninstd*.h ./asm/”.
Then rebooted. Ran the install file. I got the same error during the install of Nvidia as I got before trying your fix.

Any suggestions?

[fortunately I took an image of the root partition before doing zypper dup]

I missed one…in /usr/src/linux. I first did


make cloneconfig

I’ll edit the post.
EDIT: Done. Without it there’s no generated config, make cloneconfig generates it from /proc/config.gz And that’s exactly what the message you get says.

Looks like I missed the problem as I just updated the other day and got 3.2.10-15. Good to know for the future though, thank you.

Nouveau is great and probably works well enough for 90% of all non-gamers. But for some of us with older CPUs the Nvidia driver sometimes means the difference between being able to play a movie and not being able to play it (without converting it to a less resource intensive format). Since I use my computer as a TV this would be a big inconvenience at times.

I’m sure the driver will improve with time. Hopefully sooner than later.

Then you’re not on openSUSE Tumbleweed, but on openSUSE 12.1, the issue does not effect kernels < 3.3

Thanks – I try it on the weekend.

Regarding this that you said: “By default the NVIDIA driver does not install on the Tumbleweed kernel 3.3.0-16,…”

Does that mean that from now on we have to do this each time there’s a kernel version update?

Woohoo, couldn’t wait for the weekend. And I streamlined it a bit because I found the prospect of remembering all those commands in a text console very daunting. It seemed that “the hard way” (which was actually the easy way) had turned into “the hardest way”.

This little script makes it so simple, works whether kernel-desktop, kernel-default, kernel-whatever:

make a text file called nvidia.sh, give it these contents:

#!/bin/sh 
cd /usr/src/linux
make cloneconfig
make prepare
cd /lib/modules/`uname -r`/source/arch/x86/include/
cp -v generated/asm/unistd*.h ./asm/

Make it executable and place it in the directory /root.
Run the normal zypper dup to get the kernel upgrade. Boot and you’ll boot to a console. Log in as root to the console. You should be in directory /root (if not, then go there with cd /root). Run this command

./nvidia.sh

. Done, fixed, no stumbling about in a console.

If you save the NVIDIA driver unpacked in a default place,let’s say /download/nvidia, wouldn’t it be possible to add


cd /download/nvidia && ./nvidia-installer -s

to the script? That way it would not only prepare the kernel environment, but also reinstall the driver. I’ll give that a check over the weekend.

BTW Can I assume that the driver now works for you, swerdna ?

On 03/23/2012 08:16 AM, Knurpht wrote:
>
> swerdna;2450499 Wrote:
>> Woohoo, couldn’t wait for the weekend. And I streamlined it a bit
>> because I found the prospect of remembering all those commands in a text
>> console very daunting. It seemed that “the hard way” (which was actually
>> the easy way) had turned into “the hardest way”.
>>
>> This little script makes it so simple, works whether kernel-desktop,
>> kernel-default, kernel-whatever:
>>
>> make a text file called nvidia.sh, give it these contents:
>>>
> Code:
> --------------------
> > > #!/bin/sh
> > cd /usr/src/linux
> > make cloneconfig
> > make prepare
> > cd /lib/modules/uname -r/source/arch/x86/include/
> > cp -v generated/asm/unistd*.h ./asm/
> --------------------
>>>
>> Make it executable and place it in the directory /root.
>> Run the normal zypper dup to get the kernel upgrade. Boot and you’ll
>> boot to a console. Log in as root to the console. You should be in
>> directory /root (if not, then go there with cd /root). Run this
>> command>
> Code:
> --------------------
> > > ./nvidia.sh
> --------------------
>>> . Done, fixed, no stumbling about in a console.
>
> If you save the NVIDIA driver unpacked in a default place,let’s say
> /download/nvidia, wouldn’t it be possible to add
>
> Code:
> --------------------
>
> cd /download/nvidia&& ./nvidia-installer -s
>
> --------------------
>
> to the script? That way it would not only prepare the kernel
> environment, but also reinstall the driver. I’ll give that a check over
> the weekend.
>
> BTW Can I assume that the driver now works for you, swerdna ?
>
>
Yes, works fine for me now, thanks for the lead.


Regards
swerdna

hi there!
I tried the script and got this error:

sudo sh nvidiafix.sh
Cloning configuration file /proc/config.gz

configuration written to .config

scripts/kconfig/conf --silentoldconfig Kconfig
make[1]: *** No hay ninguna regla para construir el objetivo /usr/src/linux-3.3.0-16/arch/x86/syscalls/syscall_32.tbl', necesario para arch/x86/syscalls/…/include/generated/asm/unistd_32.h’. Alto.
make: *** [archheaders] Error 2
cp: no se puede efectuar `stat’ sobre «generated/asm/unistd*.h»: No existe el fichero o el directorio

There’s nothing there!!

ls -ls /lib/modules/3.3.0-16-desktop/source/arch/x86/include/generated/asm/
total 0

I am running

Linux laptop-sergio.husky01 3.3.0-16-desktop #1 SMP PREEMPT Mon Mar 19 10:17:31 UTC 2012 (7e199aa) i686 athlon i386 GNU/Linux

Thanks for your help.

I’m not too good at this stuff, so here’s a few guesses:
You got the error: hay ninguna regla para construir el objetivo –> No rule to make target
which implies no line: make cloneconfig
Are you sure you used this script:

#!/bin/sh 
cd /usr/src/linux
make cloneconfig
make prepare
cd /lib/modules/`uname -r`/source/arch/x86/include/
cp -v generated/asm/unistd*.h ./asm/

And did you run the script after a reboot to a console, so the new kernel was active?

If those suggestions don’t help, could you please translate what you wrote so we can read it.

OK, I tried this script subsequent to your advice:

#!/bin/sh 
cd /usr/src/linux
make cloneconfig
make prepare
cd /lib/modules/`uname -r`/source/arch/x86/include/
cp -v generated/asm/unistd*.h ./asm/
# the last line (below) must contain the correct path and file name
sh /root/NVIDIA-Linux-x86_64-295.20.run

And it works correctly as you foresaw, thanks.

Thanks for the reply. Yes i did rebooted (several times) and i always get an error trying to run the NVIDIA run file or using a script.
What I pasted is the output of the script (My SUSE is in Spanish)
This is the output for make prepare

make[1]: *** No hay ninguna regla para construir el objetivo /usr/src/linux-3.3.0-16/arch/x86/syscalls/syscall_32.tbl', necesario para arch/x86/syscalls/…/include/generated/asm/unistd_32.h’. Alto.
make: *** [archheaders] Error 2

Theres no rule to build target /usr/src/…/syscall_32.tbl needed for arch/x86/syscalls/…/ STOP

This is the output for cp -v generated/asm…

cp: no se puede efectuar `stat’ sobre «generated/asm/unistd*.h»: No existe el fichero o el directorio

And means theres is no file or directory. See the ls in previous post= Its empty!

Thannks swerdna.

What do you get from this: rpm -qa | grep kernel

rpm -qa | grep kernel
kernel-devel-3.3.0-16.1.noarch
kernel-desktop-3.3.0-16.1.i686
kernel-desktop-devel-3.3.0-16.1.i686

Install kernel-source, make and gcc, and try again

You may not know that I have a complete and automated, using DKMS, method to reload the nVIDIA driver and I have included the required patch for Kernel 3.3. It is my understanding that the next nVIDIA drive 295.xx will not require this patch (when it gets released) but you can get it all here: S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.40 - Blogs - openSUSE Forums

Thank You,

Thanks now it worked!
I dont know why in kernel 3.2 i only needed the 3 kernel packages i listed above, no need for kernel-source.

Thanks Swerdna!