View previous topic :: View next topic |
Author |
Message |
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Fri Sep 06, 2013 8:35 pm Post subject: Patching nvidia-drivers-325.15 for kernel 3.11 |
|
|
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 |
|
|
ser666 n00b
Joined: 30 May 2013 Posts: 2
|
Posted: Sat Sep 07, 2013 7:58 pm Post subject: |
|
|
helped, thanks |
|
Back to top |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
Posted: Mon Sep 16, 2013 3:17 am Post subject: |
|
|
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 |
|
|
frank9999 n00b
Joined: 20 Feb 2013 Posts: 61 Location: Germany
|
Posted: Mon Sep 16, 2013 6:04 am Post subject: |
|
|
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 |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
Posted: Mon Sep 16, 2013 12:09 pm Post subject: |
|
|
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 |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Mon Sep 16, 2013 12:55 pm Post subject: |
|
|
wouldn't work for me until ( ) 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 |
|
|
billium Apprentice
Joined: 22 Mar 2003 Posts: 185
|
Posted: Tue Sep 17, 2013 8:34 pm Post subject: |
|
|
thanks drescherjm worked for me |
|
Back to top |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Sun Sep 22, 2013 9:13 am Post subject: |
|
|
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
|
|
Back to top |
|
|
drescherjm Advocate
Joined: 05 Jun 2004 Posts: 2790 Location: Pittsburgh, PA, USA
|
Posted: Sun Sep 22, 2013 2:08 pm Post subject: |
|
|
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 |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Sun Sep 22, 2013 2:23 pm Post subject: |
|
|
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 |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Sun Sep 22, 2013 2:30 pm Post subject: |
|
|
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 |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Sun Sep 22, 2013 2:38 pm Post subject: |
|
|
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 |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Sun Sep 22, 2013 5:01 pm Post subject: |
|
|
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 |
|
|
TomWij Retired Dev
Joined: 04 Jul 2012 Posts: 1553
|
Posted: Sun Sep 22, 2013 5:20 pm Post subject: |
|
|
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 |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
|
Back to top |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Tue Sep 24, 2013 1:51 pm Post subject: |
|
|
Anyone? |
|
Back to top |
|
|
darkphader Veteran
Joined: 09 May 2002 Posts: 1225 Location: Motown
|
Posted: Tue Sep 24, 2013 5:21 pm Post subject: |
|
|
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 |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Tue Sep 24, 2013 5:29 pm Post subject: |
|
|
Same problem with this patch..:( |
|
Back to top |
|
|
croutch n00b
Joined: 04 Aug 2012 Posts: 32 Location: göteborg
|
Posted: Tue Sep 24, 2013 6:14 pm Post subject: |
|
|
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 |
|
|
darkphader Veteran
Joined: 09 May 2002 Posts: 1225 Location: Motown
|
Posted: Tue Sep 24, 2013 7:23 pm Post subject: |
|
|
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 |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Wed Sep 25, 2013 2:40 pm Post subject: |
|
|
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 |
|
|
darkphader Veteran
Joined: 09 May 2002 Posts: 1225 Location: Motown
|
Posted: Wed Sep 25, 2013 2:51 pm Post subject: |
|
|
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 |
|
|
sPHERE911 n00b
Joined: 23 Mar 2008 Posts: 50
|
Posted: Wed Sep 25, 2013 3:02 pm Post subject: |
|
|
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 |
|
|
darkphader Veteran
Joined: 09 May 2002 Posts: 1225 Location: Motown
|
Posted: Wed Sep 25, 2013 3:16 pm Post subject: |
|
|
/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 |
|
|
|