Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Patching nvidia-drivers-325.15 for kernel 3.11
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Fri Sep 06, 2013 8:35 pm    Post subject: Patching nvidia-drivers-325.15 for kernel 3.11 Reply with quote

Just made a fresh install ... as usual, nvidia-drivers didn't build with new kernel. Didn't want to downgrade after spending an hour configuring my kernel.
Found it on the net, works for me.

Code:
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -957,7 +957,11 @@ static inline int nv_execute_on_all_cpus
 #endif
 
 #if !defined(NV_VMWARE)
+#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()

_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
ser666
n00b
n00b


Joined: 30 May 2013
Posts: 2

PostPosted: Sat Sep 07, 2013 7:58 pm    Post subject: Reply with quote

helped, thanks
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Sep 16, 2013 3:17 am    Post subject: Reply with quote

Worked for me as well. I created a file (with the contents above) in /etc/portage/x11-drivers/nvidia-drivers and the unmodified portage ebuild picked up the patch on the emerge (making use of epatch_user).
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
frank9999
n00b
n00b


Joined: 20 Feb 2013
Posts: 61
Location: Germany

PostPosted: Mon Sep 16, 2013 6:04 am    Post subject: Reply with quote

It seems i´m doing something wrong, but i did not work for me.
When i save the above patch under /etc/portage/x11-drivers/nvidia-drivers as written by @drescherjm, it did not even get applied.

Then I saved the above patch as nv311.patch under /etc/portage/patches/x11-drivers/nvidia-drivers
it now gets applied from portage.
But i get the following output:
Code:
***** nv311.patch *****
PWD: /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/work

=======================

PATCH COMMAND:  patch -p0 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//x11-drivers/nvidia-drivers/nv311.patch'

=======================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

patch program exited with status 1
=======================

PATCH COMMAND:  patch -p1 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//x11-drivers/nvidia-drivers/nv311.patch'

=======================
patching file kernel/nv-linux.h
Hunk #1 FAILED at 957.
1 out of 1 hunk FAILED -- saving rejects to file kernel/nv-linux.h.rej

patch program exited with status 1
=======================

PATCH COMMAND:  patch -p2 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//x11-drivers/nvidia-drivers/nv311.patch'

=======================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

patch program exited with status 1
=======================

PATCH COMMAND:  patch -p3 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//x11-drivers/nvidia-drivers/nv311.patch'

=======================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

patch program exited with status 1
=======================

PATCH COMMAND:  patch -p4 -g0 -E --no-backup-if-mismatch  < '/etc/portage/patches//x11-drivers/nvidia-drivers/nv311.patch'

=======================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

patch program exited with status 1


Could someone please explain what i need to do, to get this working?
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Mon Sep 16, 2013 12:09 pm    Post subject: Reply with quote

Oops.

The correct path was

/etc/portage/patches/x11-drivers/nvidia-drivers

Code:
jmd0 nvidia-drivers # cat /etc/portage/patches/x11-drivers/nvidia-drivers/linux-sources-3.11.patch
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -957,7 +957,11 @@ static inline int nv_execute_on_all_cpus
 #endif

 #if !defined(NV_VMWARE)
+#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()

_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Mon Sep 16, 2013 12:55 pm    Post subject: Reply with quote

wouldn't work for me until ( :oops: ) I set the path
to

Code:
/etc/portage/patches/x11-drivers/nvidia-drivers-325.15

_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
billium
Apprentice
Apprentice


Joined: 22 Mar 2003
Posts: 185

PostPosted: Tue Sep 17, 2013 8:34 pm    Post subject: Reply with quote

thanks drescherjm worked for me
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Sun Sep 22, 2013 9:13 am    Post subject: Reply with quote

I get the following error trying to compile nvidia-325.15 with the aforementioned patch:

Quote:

Applying user patches from /etc/portage/patches//x11-drivers/nvidia-drivers-325.15 ...
* linux-sources-3.11.patch ...

* Failed Patch: linux-sources-3.11.patch !
* ( /etc/portage/patches//x11-drivers/nvidia-drivers-325.15/linux-sources-3.11.patch )
*
* Include in your bugreport the contents of:
*
* /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/temp/linux-sources-3.11.patch.out

* ERROR: x11-drivers/nvidia-drivers-325.15 failed (prepare phase):
* Failed Patch: linux-sources-3.11.patch!
*
* Call stack:
* ebuild.sh, line 93: Called src_prepare
* environment, line 4125: Called epatch_user
* environment, line 1594: Called epatch
* environment, line 1567: Called die
* The specific snippet of code:
* die "Failed Patch: ${patchname}!";
*



Also, I have no idea why it says /etc/portage/patches// with 2 slashes?

My patch looks like this:

Quote:

--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -957,7 +957,11 @@ static inline int nv_execute_on_all_cpus
#endif

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


uname -r

Quote:

3.11.1-pf
Back to top
View user's profile Send private message
drescherjm
Advocate
Advocate


Joined: 05 Jun 2004
Posts: 2790
Location: Pittsburgh, PA, USA

PostPosted: Sun Sep 22, 2013 2:08 pm    Post subject: Reply with quote

The patch worked for me for pf-sources.

Code:
>>> Verifying ebuild manifests
>>> Running pre-merge checks for x11-drivers/nvidia-drivers-325.15
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.11.1-pf-jmd0
 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-3.11
 * <sys-kernel/vanilla-sources-3.11
 *
 * You are free to utilize epatch_user to provide whatever
 * support you feel is appropriate, but will not receive
 * support as a result of those changes.
 *
 * Do not file a bug report about this.
 * Checking for suitable kernel configuration options...                                                   [ ok ]

>>> Emerging (1 of 1) x11-drivers/nvidia-drivers-325.15
 * NVIDIA-Linux-x86_64-325.15.run SHA256 SHA512 WHIRLPOOL size ;-) ...                                     [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.11.1-pf-jmd0
>>> Unpacking source...
>>> Unpacking NVIDIA-Linux-x86_64-325.15.run to /auto/temp_data/var_tmp/portage/x11-drivers/nvidia-drivers-325.15/work
>>> Source unpacked in /auto/temp_data/var_tmp/portage/x11-drivers/nvidia-drivers-325.15/work
>>> Preparing source in /auto/temp_data/var_tmp/portage/x11-drivers/nvidia-drivers-325.15/work ...
 * Applying user patches from /etc/portage/patches//x11-drivers/nvidia-drivers ...
 *   linux-sources-3.11.patch ...                                                                          [ ok ]
 * Done with patching
>>> Source prepared.
>>> Configuring source in /auto/temp_data/var_tmp/portage/x11-drivers/nvidia-drivers-325.15/work ...
>>> Source configured.
>>> Compiling source in /auto/temp_data/var_tmp/portage/x11-drivers/nvidia-drivers-325.15/work ...
 * Preparing nvidia module


How did you save the patch file? I selected the text of the patch from this page in firefox and copied and pasted into nano and just saved the result.

John
_________________
John

My gentoo overlay
Instructons for overlay
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Sun Sep 22, 2013 2:23 pm    Post subject: Reply with quote

The same as you did. Do I have to make the patch executable or something?

And also, did you modify this line?

Quote:

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Sun Sep 22, 2013 2:30 pm    Post subject: Reply with quote

Quote:
The same as you did. Do I have to make the patch executable or something?


well ... worth a try
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Sep 22, 2013 2:36 pm    Post subject: Reply with quote

Code:
-#define NV_NUM_PHYSPAGES                num_physpages
+#define NV_NUM_PHYSPAGES                get_num_physpages

In fact, the only change needed is above, it will not work with older kernels any more of course. You can even do it by hand.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Sun Sep 22, 2013 2:38 pm    Post subject: Reply with quote

Didnt help.

But this is the ouput of /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/temp/linux-sources-3.11.patch.out

Quote:

***** linux-sources-3.11.patch *****
PWD: /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/work

====================================

PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//x11-drivers/nvidia-drivers-325.15/linux-sources-3.11.patch'

====================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored

patch program exited with status 1
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Sun Sep 22, 2013 5:01 pm    Post subject: Reply with quote

I see sphere911's patch has a blank first line. It's hard to
believe that is important but it is the only difference I
can see ... :?
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Sun Sep 22, 2013 5:20 pm    Post subject: Reply with quote

sPHERE911 wrote:
Didnt help.

But this is the ouput of /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/temp/linux-sources-3.11.patch.out

Quote:
***** linux-sources-3.11.patch *****
PWD: /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/work

====================================

PATCH COMMAND: patch -p0 -g0 -E --no-backup-if-mismatch < '/etc/portage/patches//x11-drivers/nvidia-drivers-325.15/linux-sources-3.11.patch'

====================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/kernel/nv-linux.h
|+++ b/kernel/nv-linux.h
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored

patch program exited with status 1


That is not the full output, this patch needs to apply with -p1 due to the a/ and b/ prefixes; so, we are missing details on why -p1 fails.
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Sun Sep 22, 2013 7:00 pm    Post subject: Reply with quote

Oh, sorry about that!

http://pastebin.com/tc6AAdxE
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Tue Sep 24, 2013 1:51 pm    Post subject: Reply with quote

Anyone?
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Tue Sep 24, 2013 5:21 pm    Post subject: Reply with quote

sPHERE911 wrote:
Anyone?


Use this patch:
Code:
--- kernel/nv-linux.h.orig      2013-09-24 13:14:30.023159426 -0400
+++ kernel/nv-linux.h   2013-09-24 13:17:23.105718632 -0400
@@ -958,7 +958,11 @@
 #endif

 #if !defined(NV_VMWARE)
+#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()

_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Tue Sep 24, 2013 5:29 pm    Post subject: Reply with quote

Same problem with this patch..:(
Back to top
View user's profile Send private message
croutch
n00b
n00b


Joined: 04 Aug 2012
Posts: 32
Location: göteborg

PostPosted: Tue Sep 24, 2013 6:14 pm    Post subject: Reply with quote

I use this patch.

Code:
--- a/kernel/nv-linux.h
+++ b/kernel/nv-linux.h
@@ -957,7 +957,11 @@ static inline int nv_execute_on_all_cpus
 #endif
 
 #if !defined(NV_VMWARE)
+#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()


and i use this "guide" change the numbers to you liking - from user n00berry post 3 https://forums.gentoo.org/viewtopic-t-963230-highlight-patch+nvidia.html

Steps (as root):
1) Copy contents of text into txt file:
/etc/portage/patches/x11-drivers/nvidia-drivers/Linux-3.11.patch
2) Convert version number to the relevant version:
perl -pi -e "s/319.17/319.32/g" /etc/portage/patches/x11-drivers/nvidia-drivers/Linux-3.11.patch
3) Make sure /etc/portage/bashrc contains the lines:
post_src_unpack() {
if type epatch_user >& /dev/null; then
cd "${S}"
epatch_user
fi
}
4) Emerge:
emerge -av x11-drivers/nvidia-drivers

croutch
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Tue Sep 24, 2013 7:23 pm    Post subject: Reply with quote

sPHERE911 wrote:
Same problem with this patch..:(


Odd. I had the same problem as you with the original posted patch but when I rolled my own it worked just fine. Have you examined the patch to make sure you overwrote the previous one and that it's the only patch in the /etc/portage/patches/x11-drivers/nvidia-drivers-325.15/ directory? And that you are indeed emerging nvidia-drivers-325.15?

Also make sure you don't have an /etc/portage/patches/x11-drivers/nvidia-drivers/ directory that you may pulling a previous patch from.
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Wed Sep 25, 2013 2:40 pm    Post subject: Reply with quote

Im beginning to think my kernel is the problem or something.

I have done all of the steps:

The only file(patch) I have, is in /etc/portage/patches/x11-drivers/nvidia-drivers-325.15/linux-3-11.patch

My /etc/portage/bashrc looks like this:

Quote:

post_src_unpack() {
if type epatch_user >& /dev/null; then
cd "${S}"
epatch_user
fi
}


And I have tried all of the different patches. Im thinking of changing to another kernel where I actually dont need the patch...
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Wed Sep 25, 2013 2:51 pm    Post subject: Reply with quote

sPHERE911 wrote:
My /etc/portage/bashrc looks like this:
Code:
post_src_unpack() {
if type epatch_user >& /dev/null; then
cd "${S}"
epatch_user
fi
}


I don't have that file at all. It may be causing you a problem as I don't think it is needed for this ebuild.
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
sPHERE911
n00b
n00b


Joined: 23 Mar 2008
Posts: 50

PostPosted: Wed Sep 25, 2013 3:02 pm    Post subject: Reply with quote

darkphader wrote:
sPHERE911 wrote:
My /etc/portage/bashrc looks like this:
Code:
post_src_unpack() {
if type epatch_user >& /dev/null; then
cd "${S}"
epatch_user
fi
}


I don't have that file at all. It may be causing you a problem as I don't think it is needed for this ebuild.


Removed /etc/portage/bashrc, copied the patch a couple of posts above into /etc/portage/patches/x11-drivers/nvidia-drivers/Linux-3.11.patch

emerge -av nvidia-drivers

Quote:

Failed Patch: Linux-3.11.patch !
* ( /etc/portage/patches//x11-drivers/nvidia-drivers/Linux-3.11.patch )
*
* Include in your bugreport the contents of:
*
* /var/tmp/portage/x11-drivers/nvidia-drivers-325.15/temp/Linux-3.11.patch.out
* ERROR: x11-drivers/nvidia-drivers-325.15 failed (prepare phase):
* Failed Patch: Linux-3.11.patch!
*
* Call stack:
* ebuild.sh, line 93: Called src_prepare
* environment, line 4124: Called epatch_user
* environment, line 1593: Called epatch
* environment, line 1566: Called die
* The specific snippet of code:
* die "Failed Patch: ${patchname}!";
*

Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Wed Sep 25, 2013 3:16 pm    Post subject: Reply with quote

/etc/portage/patches/x11-drivers/nvidia-drivers-325.15/ is the proper path. Mine is named kernel.patch but anything.patch should work just fine.
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum