1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

nVidia 3.40 Drivers on Kernel 4.6.6 and Above

Discussion in 'Hardware' started by Gizmo, Nov 26, 2016.

  1. Gizmo

    Gizmo Chief Site Administrator Staff Member

    Joined:
    Dec 6, 2012
    Messages:
    2,230
    Likes Received:
    156
    Trophy Points:
    63
    Location:
    Webb City, Missouri
    Home page:
    So, my son's laptop is a little long in the tooth, and running on an nVidia Quadro FX 2800M (it's my old laptop). This was a powerful video chip back in the day, but 'the day' was around 2010 or so (it's based on the G92 core, roughly equivalent to a GeForce 9600 GT or Radeon HD 5670). The laptop is a Dell Precision M6500, essentially the business-clothed version of the Alienware M17x laptop.

    Up to now things have rocked along fairly well. Although the lappy is getting older, it still works. However, nVidia dropped support for the Quadro FX 2800M after the 340-series drivers; nothing newer will work with the card.

    As has been noted elsewhere, the linux driver ABI is unstable, and so drivers have to be updated periodically to reflect the changes in the ABI. MOST of the time all that's needed is to just recompile the drivers, but with kernel 4.6.6, there was a change that pretty much BROKE the nVidia drivers (even compiling them failed). Since nVidia is no longer maintaining the 340 drivers, there was no fix from nVidia.
    The specific error was:
    Code:
    error: too many arguments to function ‘get_user_pages’
    Fortunately, after some googling, my son and I found a fix, but it wasn't entirely clear how to apply it. Apparently, some enterprising folks over at Arch Linux had figured out the exact issue and even created a patch for it (the patch can be downloaded here).

    There are a couple of different ways this patch can be applied, though this was not entirely obvious to either of us, and questions from others about 'how do I apply this?' had been met with the equivalent of "If you can't figure out how to apply it, you're too stupid to apply it".

    After some futzing about, Tony remembered that the nVidia installer had an option to --apply-patch. Ok, so we tried that:

    Code:
    ./nVidia-driver-package-installer.run --apply-patch patchname.patch
    (Yeah, I don't remember the exact names of the files, just work with me here, ok?)

    That came back with an error:
    Code:
    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/nvidia-drm/nvidia-drm-fb.c
    |+++ b/kernel/nvidia-drm/nvidia-drm-fb.c
    --------------------------
    File to patch:
    Umm.......ok.

    So, after MORE futzing about, Tony figured out that if you actually extract the nVidia drivers using the -x option, you can then apply the patch, and finally run the installer, like this:

    Code:
    #get the patch file
    wget 'https://git.archlinux.org/svntogit/packages.git/plain/trunk/linux-4.6.patch?h=packages/nvidia-340xx&id=bb665d69eca74f01003cb41112448260a1597dc4' -O linux-4.6.patch
    
    #extract the nvidia driver code
    ./NVIDIA-Linux-x86_64-340.96.run -x
    
    #cd to the directory created by extracting the code
    cd NVIDIA-Linux-x86_64-340.96
    
    #apply the patch
    patch -p1 -i ../linux-4.6.patch
    
    #run the installer - this compiles the code using the provided patch
    #and then installs the code.
    ./nvidia-installer
    (Hey! I got the filenames this time!)

    Once that was done, rebooted and things came up. Hooray!

    So, I'm posting this here for posterity, just in case someone else has trouble figuring out how to get the bloody thing to work. This should work for the nVidia 304 drivers also. You will obviously have to have the compilers and kernel headers and all that crap installed before you can do this. A really good guide for installing nVidia binary drivers on Fedora can be found over at if-not-true-then-false: https://www.if-not-true-then-false.com/2015/fedora-nvidia-guide/
    Last edited: Nov 26, 2016
    booman likes this.
  2. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    11,172
    Likes Received:
    161
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    Very much appreciate your sharing.
    Now make me feel completely awful about my knowledge base....
    How old is Tony now?
    I ask as you would never get that kind of help out of me...but then you know that! ":O}
  3. Gizmo

    Gizmo Chief Site Administrator Staff Member

    Joined:
    Dec 6, 2012
    Messages:
    2,230
    Likes Received:
    156
    Trophy Points:
    63
    Location:
    Webb City, Missouri
    Home page:
    He's 16 now. He's my 'mini-me', LOL.
    booman likes this.
  4. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    11,172
    Likes Received:
    161
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    This world can use a mini you...What is he under seven foot tall ":O}
  5. Gizmo

    Gizmo Chief Site Administrator Staff Member

    Joined:
    Dec 6, 2012
    Messages:
    2,230
    Likes Received:
    156
    Trophy Points:
    63
    Location:
    Webb City, Missouri
    Home page:
    He's about 2 inches shorter than me now, LOL.
  6. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    11,172
    Likes Received:
    161
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    So like around 6'2 not to worry he's still sprouting!
    So instead of billiards your teaching him computing?
    The Choices some people make! LOL
  7. Gizmo

    Gizmo Chief Site Administrator Staff Member

    Joined:
    Dec 6, 2012
    Messages:
    2,230
    Likes Received:
    156
    Trophy Points:
    63
    Location:
    Webb City, Missouri
    Home page:
    Oh, I've taught him 8-ball and 9-ball. Not Snooker though, no-one around here has a decent Snooker table any more.
  8. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    11,172
    Likes Received:
    161
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    Glad to hear your providing a well rounded education. How's you daughter and grandchild doing?
    Sorry I have to play catch up with you guys when ever I can!
  9. Gizmo

    Gizmo Chief Site Administrator Staff Member

    Joined:
    Dec 6, 2012
    Messages:
    2,230
    Likes Received:
    156
    Trophy Points:
    63
    Location:
    Webb City, Missouri
    Home page:
    Cece is engaged to a rather nice young man (oh dear Lord, did I just say that? I'm sounding like a little old lady from the 50's). She's just recently been promoted to Assistant Manager at her work.

    Anna is, well, Anna and 7 years old. She's an imp, and she's My Most Favoritest 7-year-old Granddaughter in the Whole Wide World! (LOL)

    Kristin is still living with us. I'm debating kicking her out, though. I'm not sure letting her live here is really helping her fulfill her potential, and I can't figure out any other way to get her to risk expanding her horizons.

    And we are getting dangerously close to needing to move this to another thread. LOL.
  10. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    11,172
    Likes Received:
    161
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    We all seem to need some form of local censorship to get though the day.":O}
    If you open another thread you will not be posting in vain, I promise.":O}
  11. booman

    booman Grand High Exalted Mystic Emperor of Linux Gaming Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    8,278
    Likes Received:
    614
    Trophy Points:
    113
    Location:
    Linux, Virginia
    Home page:
    Very nice post Gizmo!
    This is one thing I LOVE about Linux... legacy support. Even though its not supported, there is always a way to support it yourself. Requires a lot of research, but eventually there will be a way.
  12. Daniel~

    Daniel~ Chief BBS Administrator Staff Member

    Joined:
    Dec 17, 2012
    Messages:
    11,172
    Likes Received:
    161
    Trophy Points:
    63
    Location:
    Greenwater WA
    Home page:
    Gizmo Said:
    Cece is engaged to a rather nice young man (oh dear Lord, did I just say that? I'm sounding like a little old lady from the 50's)

    We all end up sounding like a little old lady from the Sixty's... Just don't start drinking Ice Tea or your finished!! ":O}

Share This Page