Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 627550 - x11-drivers/nvidia-drivers-340.102-r1 with kernel 4.12 - work/kernel/nv-linux.h:199:2: error: #error "This driver requires the ability to change memory types!"
Summary: x11-drivers/nvidia-drivers-340.102-r1 with kernel 4.12 - work/kernel/nv-linux...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-08-11 14:53 UTC by Sven Müller
Modified: 2017-08-26 08:33 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,356.30 KB, text/plain)
2017-08-11 14:53 UTC, Sven Müller
Details
Patch for nvidia-drivers-4.12 (nvidia-4.12.0.patch,9.38 KB, patch)
2017-08-12 21:52 UTC, Sven Müller
Details | Diff
patch for the ebuild (nvidia-drivers-340.102-r1.ebuild.diff,381 bytes, patch)
2017-08-12 21:55 UTC, Sven Müller
Details | Diff
build.log (build.log,3.44 KB, text/x-log)
2017-08-18 21:04 UTC, Realname
Details
modified ebuild (nvidia-drivers-340.102-r1.ebuild,14.51 KB, text/plain)
2017-08-19 08:46 UTC, Sven Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Müller 2017-08-11 14:53:24 UTC
Created attachment 488596 [details]
build.log

The following error message appears several times before compiling fails: 

 #error "This driver requires the ability to change memory types!"
Comment 1 Sven Müller 2017-08-12 21:52:55 UTC
Created attachment 488716 [details, diff]
Patch for nvidia-drivers-4.12

Took the patch from: 
https://devtalk.nvidia.com/default/topic/1019362/linux/fully-working-patch-for-nvidia-driver-340-102-compiler-installer-file-and-linux-kernel-4-12/

and fixed the line diffs to compile with nvidia-drivers-340.120-r1.
Comment 2 Sven Müller 2017-08-12 21:55:29 UTC
Created attachment 488718 [details, diff]
patch for the ebuild
Comment 3 Sven Müller 2017-08-12 21:57:19 UTC
It compiles and runs. Haven't tested if there are any other issues left. 

Please feel free to change the patch to match any necessary conventions.
Comment 4 Realname 2017-08-18 21:02:47 UTC
It doesn't work for me. I've patched the ebuild, rebuilt manifest, downloaded your patch, but when emerging I get some "No file to patch.  Skipping patch." and "X out of X hunks ignored" messages (build.log attached). Any help.
Comment 5 Realname 2017-08-18 21:04:14 UTC
Created attachment 489550 [details]
build.log
Comment 6 Sven Müller 2017-08-19 08:46:59 UTC
Created attachment 489634 [details]
modified ebuild

I failed to reproduce the issues with your USE-flags. It compiles fine on my machines. 

But I'm not a maintainer and don't have any experience of debugging ebuilds. I uploaded the full ebuild with the patch included. Maybe it helps.

Btw. did you use the patch I've posted here? The issues you have posted are very similar to the issues I got, when I used the original patch from nvidia-devtalk.
Comment 7 Realname 2017-08-19 13:06:04 UTC
(In reply to Sven Müller from comment #6)
> Btw. did you use the patch I've posted here? The issues you have posted are
> very similar to the issues I got, when I used the original patch from
> nvidia-devtalk.

I think so: I created the file /etc/portage/patches/x11-drivers/nvidia-drivers-340.102/nvidia-4.12.0.patch and pasted in it the content from your attachment here: https://627550.bugs.gentoo.org/attachment.cgi?id=488716. I think I did the same when installing the driver for the kernel 4.10: copying the corresponding patch in /etc/portage/patches/x11-drivers/nvidia-drivers-340.102 and emerging.

I see you also posted this other patch: https://627550.bugs.gentoo.org/attachment.cgi?id=488718 but as, to be sincere, I don't know how to apply a patch to an ebuild (I'm no Gentoo expert at all, only a very regular user), I just copied the diff lines, edited the ebuild in my /usr/portage directory to paste said lines, recreated the manifest and went ahead with the emerge.

I have used your modified ebuild but I get the same results. :-/

Thanks for your time.
Comment 8 Realname 2017-08-19 13:20:36 UTC
Well, you are right and I must somehow doing things badly for applying your patch, because I have used the patch from Devtalk, and effectively I get the same build.log except for the info from lines 4992, 1258 and 1196, which are now 4993, 1259 and 1197, but their texts are exactly the same than before.

So, I must be deffinitely doing something wrong. Could you please describe for me your exact process to apply your patch?

Sorry for my clumsyness, heh.
Comment 9 Sven Müller 2017-08-19 15:12:23 UTC
I'm using a local overlay in order to use modified ebuilds. See https://wiki.gentoo.org/wiki/Custom_repository

If you just want to get it installed once, you can also simply overwrite the official ebuild in portage. With the next portage sync your changes will be lost. To do so: 

1. copy (=replace) the modified ebuild from the attachments above to /usr/portage/x11-drivers/nvidia-drivers/nvidia-drivers-340.102-r1.ebuild
2. copy the patch for nvidia-drivers-4.12 from above to /usr/portage/x11-drivers/nvidia-drivers/files/nvidia-4.12.0.patch
3. go to /usr/portage/x11-drivers/nvidia-drivers: ebuild nvidia-drivers-340.102-r1.ebuild digest
4. emerge nvidia-drivers

If you want to do the manual way (no need to touch the ebuild): 

You need 2 terminals:


1. save the patch for nvidia-drivers-4.12 to your computer.
2. terminal 1: go to /usr/portage/x11-drivers/nvidia-drivers
3. terminal 1: ebuild nvidia-drivers-340.102-r1.ebuild unpack
4. terminal 2: go to /var/tmp/portage/x11-drivers/nvidia-drivers-340.102-r1/work
5. terminal 2: patch -p1 --dry-run < /path/to/nvidia-4.12.0.patch
6. terminal 2: if no errors occur, remove "--dry-run": patch -p1 < /path/to/nvidia-4.12.0.patch
7. terminal 1: ebuild nvidia-drivers-340.102-r1.ebuild compile
8. terminal 1: ebuild nvidia-drivers-340.102-r1.ebuild install
9. terminal 1: ebuild nvidia-drivers-340.102-r1.ebuild qmerge

I guess, the way you did it, should be the official way. But I don't have any experience with user patches. No idea how to name the patch and no idea, in which order the patches are applied.

Have fun!
Comment 10 Realname 2017-08-19 19:47:07 UTC
Solved.
The problem was one of those mistakes that are produced "spontaneously" or at least not related at all with all that technical stuff we have discussed here.
I going to explain it just in case someone else could come to this page lookig for help with the same problem. Could find it helpful:

First I tried what you described in the first method and moved my nvidia-4.12.0.patch file from /etc/portage/patches/blablabla... to /usr/portage/x11-drivers/nvidia-drivers/files/ with no luck; it even gave me more errors of the type: "No file to patch.  Skipping patch." and "X out of X hunks ignored".
So I tried the manual method. The patching process failed again, when running patch -p1 --dry-run, but this method provides more uselful information, and in the output messages I could see that the failure was due to "different line endings".
I searched what the "duck" meant that and when made a slight idea I went again to your patch's attachment, copied the text but this time instead of pasting it in Nano directly and save it as nvidia-4.12.0.patch I first pasted it in Kate editor, selected all the text and in Tools/Line endings I made sure they were in the UNIX format. Then I copied the text again, pasted in Nano and saved as nvidia-4.12.0.patch.
Then I followed the normal process: rebuild manifes/digest for nvidia-drivers-340.102-r1.ebuild you posted here, emerged, and everythong worked flawlessly.

So, vielen dank (I hope I've guessed correctly you're german) for your help, Sven; there was never anything wrong with your ebuild, but I had not found the cause of the problem without your help.

Best regards.
Comment 11 Realname 2017-08-19 19:50:10 UTC
BTW, BGO admins, how can I change the bug status to solved? I dont see any button or link or something like that which allows me to change that "UNCONFIRMED" status.
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2017-08-26 08:33:06 UTC
Comment on attachment 488718 [details, diff]
patch for the ebuild

You can't use the eapply_user mechanism?