# [SOLVED] kernel 3.6.0 + nvidia-drivers emerge fail

## piotraf

After updating kernel vanilla-sources to 3.6.0 the nvidia-drivers failed with

```

nv-acpi.c: In function ‘nv_acpi_remove’ ...

```

To fix this download 3.6_kernel.patch from http://cvs.rpmfusion.org/viewvc/rpms/nvidia-kmod/devel/3.6_kernel.patch?revision=1.2&root=nonfree&view=markup

I assumed this affects all nvidia-driver versions so I want to apply it to any of them not just a specific in my case x11-drivers/nvidia-drivers-295.71, thus I made the directory nvidia-drivers instead of nvidia-drivers-295.71 .

```
install -dv /etc/portage/patches/x11-drivers/nvidia-drivers/
```

and copy the downloaded patch there.

emerge your nvidia-drivers. Hope that helps someone  :Smile:  Good luck

----------

## krinn

This is something that should goes in bugs.gentoo.org or CC to the nvidia maintainer, try cardoe.

----------

## piotraf

 *krinn wrote:*   

> This is something that should goes in bugs.gentoo.org or CC to the nvidia maintainer, try cardoe.

 

You might be right, but being aware the package was added today and is in the unstable ~amd64 branch I wasn't sure if I should file a bug and I thought it is more important to post the solution which could help temporarily if someone upgrades the kernel.

Anyway, thanks for the tip

----------

## krinn

Solve in forum = people get the problem and the way to fix it

Solve in bugs = people don't even get the problem as they get an already fixed version

----------

## Martux

Man, this is awesome! Thanks for the fix!!

----------

## Martux

Sorry to bring up this old thread, but anybody has this issue again with the 3.7 kernel series as well?

----------

## houtworm

 *Martux wrote:*   

> Sorry to bring up this old thread, but anybody has this issue again with the 3.7 kernel series as well?

 I don't know if it is the same issue, but with kernel 3.7.0 and 3.7.1 the nvidia-drivers will not emerge.

```
In file included from /mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/nv-linux.h:15:0,

                 from /mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/nv.c:13:

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:8:2: fout: #error remap_page_range() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:10:2: fout: #error vmap() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:11:2: fout: #error agp_backend_acquire() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:27:2: fout: #error kmem_cache_create() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:28:2: fout: #error on_each_cpu() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:29:2: fout: #error smp_call_function() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:36:2: fout: #error INIT_WORK() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:37:2: fout: #error acpi_walk_namespace() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:38:2: fout: #error acpi_os_wait_events_complete() conftest failed!

/mnt/space/tmp/portage/x11-drivers/nvidia-drivers-304.64/work/kernel/conftest.h:42:2: fout: #error pci_dma_mapping_error() conftest failed!
```

I can't use a newer nvidia-driver because those don't support my card, so i had to mask >= 3.5.0

----------

## platojones

sorry to hear that...perhaps the newest legacy nvidia drivers would work.

----------

## houtworm

 *platojones wrote:*   

> sorry to hear that...perhaps the newest legacy nvidia drivers would work.

 The nvidia-drivers-304.64 does support my card and I am using it right now with gentoo-sources-3.6.8

But it will not emerge with the kernel 3.7*

----------

## sirlark

I have exactly the same problem...

----------

## houtworm

Ok I found a kind of solution.

Here at nvidia they show a patch called "nvidia-304_60.run_linux-3.7.diff.jpg" and applied to the nvidia-drivers-340.60 make it work with the 3.7.1 kernel.

----------

## houtworm

the patch works also for nvidia-drivers-304.64

----------

## tippincows

I ran into this problem this morning, after trying the patch and not succeeding, i realized all i need to do is recompile nvidia-drivers304.64 with kernel3.6

I rebooted into kernel 3.6 (which i'm glad i kept in grub, for this exact reason)

change the kernel symlink back to 3.6

eselect kernel set 1 <- whatever 3.6 points to

masked any versions greater then 304.64 

>=x11-drivers/nvidia-drivers-305.0.0 -> /etc/portage/package.mask

then emerged nvidia-drivers304.64

rebooted back into kernel3.7

nvidia-drivers 304.64 working fine in 3.7 kernel.

I understand that this is just a workaround and not a fix. Did anyone have any luck with the patch at nvidia? If so Please show in detail how to apply patch and re-emerge using kernel3.7

Best regards.

----------

## houtworm

 *tippincows wrote:*   

> change the kernel symlink back to 3.6
> 
> ...
> 
> then emerged nvidia-drivers304.64
> ...

 I think that is weird because every kernel has its own nvidia drivers, see /lib/modules/3.7.1-gentoo/video

for example

The patch does work.

This is how I did it.

If neccesary, edit /etc/make.conf:

```
PORTDIR_OVERLAY=/usr/local/portage
```

Then copy /usr/portage/x11-drivers/nvidia-drivers to /usr/local/portage:

```
mkdir -p /usr/local/portage/x11-drivers/nvidia-drivers

cp -R /usr/portage/x11-drivers/nvidia-drivers/* /usr/local/portage/x11-drivers/nvidia-drivers
```

copy the patch to /usr/local/portage/x11-drivers/nvidia-drivers/filese

I renamed it to nvidia-304_60.run_linux-3.7.diff

then edit /usr/local/portage/x11-drivers/nvidia-drivers/nvidia-drivers-304.64.ebuild:

At the piece 'source-prepare' add a line:

```
...

         epatch "${FILESDIR}"/nvidia-drivers-pax-const.patch

            epatch "${FILESDIR}"/nvidia-drivers-pax-usercopy.patch

        fi

        epatch "${FILESDIR}"/nvidia-304_60.run_linux-3.7.diff
```

last line is added

boot kernel 3.7.1

eselect set [number]

And emerge nvidia-drivers

----------

## tippincows

/lib/modules/3.7.1-gentoo/video/nvidia.ko 

/lib/modules/3.6.11-gentoo/video/nvidia.ko 

Both kernel versions appear to have nvidia.ko set. 

I was working on doing an emerge -uavDN world in which nvidia-drivers310 was installed very last.

Just like you i found out that the newest version of nvidia-drivers wasn't compatible with my video card 

00:05.0 VGA compatible controller: NVIDIA Corporation C51 [Quadro NVS 210S/GeForce 6150LE] (rev a2)

before i found this thread i ran 

```
emerge -C nvidia-drivers
```

 while i was in kernel3.7 thinking i could just re-emerge, nvidia-drivers304.64 

When nvidia-drivers failed to emerge on kernel 3.7 (naturally) all i ended up doing was reboot, running emerge -av nvidia-drivers304.64 on kernel 3.6 which was successful

i booted back into kernel 3.7 ran eselect opengl set nvida eselect opencl set nvidia and modprobe -r nvidia

Keeping in mind that my /usr/portage/package.mask has >=drivers/nvidia-drivers-305.0.0

Maybe i  just got lucky. 

I am still however working on this patch. I am in kernel 3.7

when i go to re-emerge nvidia-drivers i get this error message:

Calculating dependencies / * Digest verification failed:

 * /usr/local/portage/x11-drivers/nvidia-drivers/nvidia-drivers-304.64.ebuild

 * Reason: Filesize does not match recorded size

 * Got: 12798

 * Expected: 12742

[ebuild   R    ] x11-drivers/nvidia-drivers-304.64  USE="X (multilib) tools -acpi -pax_kernel" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] 

It still however gives me the option to merge the packages. (should i continue?)

Also when i run nvidia-settings -v it shows i allready have 304.64

nvidia-settings -v

nvidia-settings:  version 304.64  (buildmeister@swio-display-x86-rhel47-12)  Tue Oct 30 12:04:34 PDT 2012

  The NVIDIA X Server Settings tool.

  This program is used to configure the NVIDIA Linux graphics driver.

  For more detail, please see the nvidia-settings(1) man page.

  Copyright (C) 2004 - 2010 NVIDIA Corporation.

Perhaps this is all redundant and unnecessary but i appreciate the quick response and help. Sorry about the obscurity of my posts, im new to forums.

----------

## houtworm

 *tippincows wrote:*   

> I was working on doing an emerge -uavDN world in which nvidia-drivers310 was installed very last.
> 
> Just like you i found out that the newest version of nvidia-drivers wasn't compatible with my video card 

 Perhaps the 310.19 driver is still working but with unpredictable results  :Smile: 

 *tippincows wrote:*   

> Keeping in mind that my /usr/portage/package.mask has >=drivers/nvidia-drivers-305.0.0

 Strange that the nvidia-drivers-310 was still merged. Perhaps you should put nvidia-drivers-305.0 there instead. (not 0.0)

 *tippincows wrote:*   

> Calculating dependencies / * Digest verification failed:
> 
>  * /usr/local/portage/x11-drivers/nvidia-drivers/nvidia-drivers-304.64.ebuild
> 
>  * Reason: Filesize does not match recorded size
> ...

 you probably forgot:

ebuild nvidia-drivers-304.64.ebuild digest

You must do that after editing an ebuild.

 *tippincows wrote:*   

> Also when i run nvidia-settings -v it shows i allready have 304.64
> 
> nvidia-settings -v
> 
> nvidia-settings:  version 304.64  (buildmeister@swio-display-x86-rhel47-12)  Tue Oct 30 12:04:34 PDT 2012

 

Yes, that is the version of the nvidia-settings program

----------

