View previous topic :: View next topic |
Author |
Message |
Chopstix n00b
Joined: 20 Oct 2012 Posts: 20
|
Posted: Sun Oct 27, 2013 10:43 pm Post subject: Patch nvidia-drivers-331.17 for gentoo-sources-3.11.* |
|
|
The problem:
Code: | * 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. |
The assumption:
You have already keyworded and emerged >=sys-kernel/gentoo-sources-3.11.6 and used eselect to select the new kernel.
The solution:
Code: | mkdir -p /etc/portage/patches/x11-drivers/nvidia-drivers-331.17/ |
Paste this into /etc/portage/patches/x11-drivers/nvidia-drivers-331.17/kernel.patch : Code: | --- a/kernel/nv-linux.h 2013-10-27 23:23:30.290956283 +0100
+++ b/kernel/nv-linux.h 2013-10-27 23:25:11.366952961 +0100
@@ -956,7 +956,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() |
Go ahead and emerge nvidia-drivers.
Last edited by Chopstix on Mon Oct 28, 2013 11:07 am; edited 1 time in total |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
Chopstix n00b
Joined: 20 Oct 2012 Posts: 20
|
Posted: Mon Oct 28, 2013 9:23 am Post subject: |
|
|
Yes, I traced the original post to this nvidia devtalk forum post, and saw some mention of it here too, but I also saw many posts that people couldn't get the patch to apply, so I re-made the patch to work with the latest versions available, thereby saving some people time and denying them the pleasure of learning how the diff and patch commands work, and how to integrate those with ebuilds... oh why did I do it |
|
Back to top |
|
|
witul n00b
Joined: 10 Feb 2009 Posts: 5
|
Posted: Mon Oct 28, 2013 10:47 pm Post subject: |
|
|
Why we have to patch manually almost all versions? |
|
Back to top |
|
|
Chopstix n00b
Joined: 20 Oct 2012 Posts: 20
|
Posted: Tue Oct 29, 2013 6:39 pm Post subject: |
|
|
The error message explains it: nvidia does not officially support the >=3.11 kernel yet. |
|
Back to top |
|
|
platojones Veteran
Joined: 23 Oct 2002 Posts: 1602 Location: Just over the horizon
|
Posted: Tue Oct 29, 2013 10:42 pm Post subject: |
|
|
witul wrote: | Why we have to patch manually almost all versions? |
To expand on what Chopstix said: The Gentoo dev who supports the nvidia-drivers has adopted the policy that Gentoo supports only what Nvidia officially supports. And Nvidia doesn't officially support the 3.11 kernels yet. That seems very reasonable to me, from a Gentoo dev perspective, otherwise, he's signed up for constantly digging up patches and handling all of the potential bugs that get filed for running the drivers with an unsupported kernel. That's also why he added the ability for users to easily apply their own patches to the ebuild, using Gentoo's brilliant ebuild patch mechanism.
So, it's no big deal...when Nvidia releases the drivers to support the 3.11 kernels, we get them. Until then, we just use the simple user patch mechanism. |
|
Back to top |
|
|
Martux Veteran
Joined: 04 Feb 2005 Posts: 1917
|
Posted: Sat Nov 02, 2013 8:18 pm Post subject: |
|
|
Gnah
For me the patch fails:
Code: |
die "Failed Patch: ${patchname}!";
|
Completely ~amd64 here, so I wonder why? _________________ "Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction" |
|
Back to top |
|
|
megaflow n00b
Joined: 11 Mar 2005 Posts: 60 Location: Maasmechelen
|
|
Back to top |
|
|
Chopstix n00b
Joined: 20 Oct 2012 Posts: 20
|
Posted: Sat Nov 02, 2013 11:50 pm Post subject: |
|
|
Megaflow are you suggesting he ditch portage and use the installer? Bad advice. How can someone who doesn't know how to apply a simple patch know how to clean his system from the nvidia installer when he decides to move back to portage...
Martux either provide more info on why it failed, or patch it yourself, it's simple. |
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Sun Nov 03, 2013 12:36 am Post subject: |
|
|
@megaflow
very thanks! I have posted a notice at
https://bugs.gentoo.org/show_bug.cgi?id=447566#c175
@Chopstix
you just put the one of the three patches you guess for example at:
/etc/portage/patches/x11-drivers/nvidia-drivers-325.15/get_num_physpages_325-331.patch
The portage tree nvidia ebuild has epatch_user active! |
|
Back to top |
|
|
Chopstix n00b
Joined: 20 Oct 2012 Posts: 20
|
Posted: Sun Nov 03, 2013 11:42 am Post subject: |
|
|
I assumed they wouldn't be compatible. |
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Sun Nov 03, 2013 12:06 pm Post subject: |
|
|
Chopstix wrote: | I assumed they wouldn't be compatible. |
If any patch is not compatible there is a very,very high chance it
simply doesn't patch and emerge errors out the build process.
Just try |
|
Back to top |
|
|
megaflow n00b
Joined: 11 Mar 2005 Posts: 60 Location: Maasmechelen
|
Posted: Sun Nov 03, 2013 12:33 pm Post subject: |
|
|
@Chopstix
i try the patch myself before posting it.
I assumed u know how to use epatch , to patch it
i stumble on the patch by a problem with world of warcraft using all my system memory. and make my system run very slow
so i made a quike response on this tread
sorry for that _________________ ----------------------------
Dell System XPS L702X/0XN71K,Intel(R) Core(TM) i7-2720QM |
|
Back to top |
|
|
Chopstix n00b
Joined: 20 Oct 2012 Posts: 20
|
Posted: Sun Nov 03, 2013 1:49 pm Post subject: |
|
|
I meant I thought the patch provided by nvidia would not work with portage only with nvidia's installer, which is why I assumed megaflow was encouraging Martux to ditch portage and use nvidia's installer. |
|
Back to top |
|
|
Wallsandfences Guru
Joined: 29 Mar 2010 Posts: 378
|
Posted: Sun Nov 03, 2013 6:30 pm Post subject: |
|
|
I'm not sure what your experiences are, but I have the same problem with the patch:
Code: | * /var/tmp/portage/x11-drivers/nvidia-drivers-331.17/temp/kernel.patch.out
* ERROR: x11-drivers/nvidia-drivers-331.17::gentoo failed (prepare phase):
* Failed Patch: kernel.patch!
*
* Call stack:
* ebuild.sh, line 93: Called src_prepare
* environment, line 4234: Called epatch_user
* environment, line 1650: Called epatch
* environment, line 1623: Called die
* The specific snippet of code:
* die "Failed Patch: ${patchname}!";
|
Rüdiger |
|
Back to top |
|
|
Martux Veteran
Joined: 04 Feb 2005 Posts: 1917
|
Posted: Sun Nov 03, 2013 6:42 pm Post subject: |
|
|
It just worked for me with the patch from the nvidia-site, megaflow provided earlier. _________________ "Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction" |
|
Back to top |
|
|
Wallsandfences Guru
Joined: 29 Mar 2010 Posts: 378
|
Posted: Sun Nov 03, 2013 7:01 pm Post subject: |
|
|
this is with megaflow's patch... |
|
Back to top |
|
|
Martux Veteran
Joined: 04 Feb 2005 Posts: 1917
|
Posted: Sun Nov 03, 2013 7:03 pm Post subject: |
|
|
Hm, you did an
Code: |
mkdir -p /etc/portage/patches/x11-drivers/nvidia-drivers-331.17/
|
first?
Also made sure, you're only using the one appropriate patch, namely the get_num_physpages_325-331.patch one? _________________ "Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction" |
|
Back to top |
|
|
Wallsandfences Guru
Joined: 29 Mar 2010 Posts: 378
|
Posted: Sun Nov 03, 2013 8:19 pm Post subject: |
|
|
Code: | cat /etc/portage/patches/x11-drivers/nvidia-drivers-331.17/kernel.patch
This patch will work on installers for the following versions of the
NVIDIA Linux driver:
325.15
331.13
331.17
It will not apply cleanly against older 325 drivers, but can be made to
work with some minor changes.
--- /dev/null
+++ kernel/patch-get_num_physpages.h
@@ -0,0 +1,10 @@
+#define NV_PATCH_get_num_physpages_DESCRIPTION \
+"This patch adds support for kernels such as Linux 3.11, which use the "\
+"get_num_physpages() function instead of the num_physpages variable to "\
+"report the number of physical pages. In order to avoid compatibility "\
+"problems that would otherwise result from differences between what "\
+"the removed num_physpages variable reported versus what is reported "\
+"by get_num_physpages(), the driver will fall back to a different memory "\
+"allocation strategy on systems where num_phsypages is not available, when "\
+"the amount of system memory matches or exceeds the upper bound of a given "\
+"GPU's physical address space.\n"
--- kernel/Makefile
+++ kernel/Makefile
@@ -125,6 +125,7 @@ COMPILE_TESTS = \
file_operations \
sg_init_table \
pci_get_domain_bus_and_slot \
+ get_num_physpages \
efi_enabled \
dom0_kernel_present \
drm_available \
--- kernel/conftest.sh
+++ kernel/conftest.sh
@@ -1676,6 +1676,30 @@ compile_test() {
fi
;;
+ get_num_physpages)
+ #
+ # Determine if the get_num_physpages() function is
+ # present.
+ #
+ echo "$CONFTEST_PREAMBLE
+ #include <linux/mm.h>
+ void conftest_get_num_physpages(void) {
+ get_num_physpages(NULL);
+ }" > conftest$$.c
+
+ $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+ rm -f conftest$$.c
+
+ if [ -f conftest$$.o ]; then
+ echo "#undef NV_GET_NUM_PHYSPAGES_PRESENT" | append_conftest "functions"
+ rm -f conftest$$.o
+ return
+ else
+ echo "#define NV_GET_NUM_PHYSPAGES_PRESENT" | append_conftest "functions"
+ return
+ fi
+ ;;
|
|
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Sun Nov 03, 2013 9:51 pm Post subject: |
|
|
That is a corrupted patch file. Ca 60percentage of the original.
A patch typically should not end with a '+' sign. |
|
Back to top |
|
|
Wallsandfences Guru
Joined: 29 Mar 2010 Posts: 378
|
Posted: Mon Nov 04, 2013 8:57 pm Post subject: |
|
|
Yeah, you were right, the file wasn't complete. It works now.
Rüdiger |
|
Back to top |
|
|
|