Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Patch nvidia-drivers-331.17 for gentoo-sources-3.11.*

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
21 posts • Page 1 of 1
Author
Message
Chopstix
n00b
n00b
User avatar
Posts: 20
Joined: Sat Oct 20, 2012 8:14 pm

Patch nvidia-drivers-331.17 for gentoo-sources-3.11.*

  • Quote

Post by Chopstix » Sun Oct 27, 2013 10:43 pm

The problem:

Code: Select all

 * 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: Select all

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: Select all

--- 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.
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Mon Oct 28, 2013 2:00 am

Chopstix,

great job!

Unfortunately ... many folks have posted it before, including myself ... and mine wasn't the first ... :oops:

Google
My Gentoo installation notes.
Please learn how to denote units correctly!
Top
Chopstix
n00b
n00b
User avatar
Posts: 20
Joined: Sat Oct 20, 2012 8:14 pm

  • Quote

Post by Chopstix » Mon Oct 28, 2013 9:23 am

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 :P
Top
witul
n00b
n00b
Posts: 5
Joined: Tue Feb 10, 2009 8:33 am

  • Quote

Post by witul » Mon Oct 28, 2013 10:47 pm

Why we have to patch manually almost all versions?
Top
Chopstix
n00b
n00b
User avatar
Posts: 20
Joined: Sat Oct 20, 2012 8:14 pm

  • Quote

Post by Chopstix » Tue Oct 29, 2013 6:39 pm

The error message explains it: nvidia does not officially support the >=3.11 kernel yet.
Top
platojones
Veteran
Veteran
User avatar
Posts: 1602
Joined: Wed Oct 23, 2002 10:48 pm
Location: Just over the horizon

  • Quote

Post by platojones » Tue Oct 29, 2013 10:42 pm

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.
Top
Martux
Veteran
Veteran
User avatar
Posts: 1917
Joined: Fri Feb 04, 2005 9:09 pm

  • Quote

Post by Martux » Sat Nov 02, 2013 8:18 pm

Gnah :(

For me the patch fails:

Code: Select all

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"
Top
megaflow
n00b
n00b
User avatar
Posts: 60
Joined: Fri Mar 11, 2005 10:23 am
Location: Maasmechelen

  • Quote

Post by megaflow » Sat Nov 02, 2013 10:12 pm

try this patch
https://devtalk.nvidia.com/cmd/default/ ... ent/59607/

and this link is to the site why u need this patch

https://devtalk.nvidia.com/default/topi ... r-kernels/
----------------------------
Dell System XPS L702X/0XN71K,Intel(R) Core(TM) i7-2720QM
Top
Chopstix
n00b
n00b
User avatar
Posts: 20
Joined: Sat Oct 20, 2012 8:14 pm

  • Quote

Post by Chopstix » Sat Nov 02, 2013 11:50 pm

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.
Top
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

  • Quote

Post by ulenrich » Sun Nov 03, 2013 12:36 am

@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!
Top
Chopstix
n00b
n00b
User avatar
Posts: 20
Joined: Sat Oct 20, 2012 8:14 pm

  • Quote

Post by Chopstix » Sun Nov 03, 2013 11:42 am

I assumed they wouldn't be compatible.
Top
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

  • Quote

Post by ulenrich » Sun Nov 03, 2013 12:06 pm

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 :)
Top
megaflow
n00b
n00b
User avatar
Posts: 60
Joined: Fri Mar 11, 2005 10:23 am
Location: Maasmechelen

  • Quote

Post by megaflow » Sun Nov 03, 2013 12:33 pm

@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
Top
Chopstix
n00b
n00b
User avatar
Posts: 20
Joined: Sat Oct 20, 2012 8:14 pm

  • Quote

Post by Chopstix » Sun Nov 03, 2013 1:49 pm

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.
Top
Wallsandfences
Guru
Guru
Posts: 378
Joined: Mon Mar 29, 2010 11:40 pm

  • Quote

Post by Wallsandfences » Sun Nov 03, 2013 6:30 pm

I'm not sure what your experiences are, but I have the same problem with the patch:

Code: Select all

 *   /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
Top
Martux
Veteran
Veteran
User avatar
Posts: 1917
Joined: Fri Feb 04, 2005 9:09 pm

  • Quote

Post by Martux » Sun Nov 03, 2013 6:42 pm

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"
Top
Wallsandfences
Guru
Guru
Posts: 378
Joined: Mon Mar 29, 2010 11:40 pm

  • Quote

Post by Wallsandfences » Sun Nov 03, 2013 7:01 pm

this is with megaflow's patch...
Top
Martux
Veteran
Veteran
User avatar
Posts: 1917
Joined: Fri Feb 04, 2005 9:09 pm

  • Quote

Post by Martux » Sun Nov 03, 2013 7:03 pm

Hm, you did an

Code: Select all

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"
Top
Wallsandfences
Guru
Guru
Posts: 378
Joined: Mon Mar 29, 2010 11:40 pm

  • Quote

Post by Wallsandfences » Sun Nov 03, 2013 8:19 pm

Code: Select all

 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
+        ;;
Top
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

  • Quote

Post by ulenrich » Sun Nov 03, 2013 9:51 pm

That is a corrupted patch file. Ca 60percentage of the original.
A patch typically should not end with a '+' sign.
Top
Wallsandfences
Guru
Guru
Posts: 378
Joined: Mon Mar 29, 2010 11:40 pm

  • Quote

Post by Wallsandfences » Mon Nov 04, 2013 8:57 pm

Yeah, you were right, the file wasn't complete. It works now.

Rüdiger
Top
Post Reply

21 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic