NVIDIA on 64-bit

Issue #130 resolved
nightflier created an issue

Tested on two computers, one desktop with a GeForce 240 discrete video card and a laptop with Quadro NVS 140M, both using NVIDIA 340.96.

32-bit builds and runs without problems.

64-bit fails. 647.2 STD B1. Log file attached.

The display is messed up during the procedure on 64-bit, no spaces in text, but I have successfully built module on 7.1 under those conditions.

Comments (9)

  1. Moises Henriquez

    I dont know much about this but a couple of things that may help. The most concerning to us should be the fact that the results are different from arch to another, if anything, the results should be identical.

    As for a resolution to the problem, i'm not convinced this is a bug at all on our part. The problem stems from the nvidia code attempting to utilize some kernel functioning that has been locked away by the linux devs (this was probably not locked before, not sure). I believe this line from your build log really reveals the source of the problem as well as what is required to get around it.

    FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol 'mutex_lock_nested'

    I believe the reason for that output is that the kernel/locking/mutex.c file (from the linux kernel sources) defines the mutex_lock_nested as a GPL-Only symbol. Meaning that proprietary software can no longer use it.

    Check this output from a grep command ran on the extracted kernel source tarball.

    root:# grep -R '(mutex_lock_nested)' .
    ./kernel/locking/mutex.c:EXPORT_SYMBOL_GPL(mutex_lock_nested);
    

    If you're interested in compiling this module, you may have to patch the kernel source and rebuild.

    Try applying this patch

    --- kernel/locking/mutex.c.orig 2016-07-18 09:41:25.208337478 -0500
    +++ kernel/locking/mutex.c      2016-07-18 09:41:53.056475570 -0500
    @@ -619,7 +619,7 @@
                                subclass, NULL, _RET_IP_, NULL, 0);
     }
    
    -EXPORT_SYMBOL_GPL(mutex_lock_nested);
    +EXPORT_SYMBOL(mutex_lock_nested);
    
     void __sched
     _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest)
    

    After the kernel rebuilds, you'd have to reboot and try compiling the nvidia stuff again. Let us know if that works.

  2. nightflier reporter

    Did some stumbling around based on a few snippets of info and lots of assumptions.. added the above code in a .diff file in "/usr/src/build-4.4.14/patches", then ran the included slackbuild. Kernel built and installed. Rebooted.

    Edited "/usr/src/linux-4.4.14/kernel/locking/mutex.c" as indicated and tried building again. No change.

    FWIW, did this in a vb vm. The nvidia installer will run without an nvidia card, after warning about not finding an installed vcard.

  3. Moises Henriquez

    You would actually have to edit the SlackBuild to make sure the patch is applied. Just putting it in the patches dir will not do it.

    Can you post the link to the nvidia installer you are attempting to run?

  4. nightflier reporter

    Editing the slackbuild seems to have done it, the modules built this time. I'll be able to test it on real hardware this evening.

  5. Moises Henriquez

    It took a little effort, but I was finally able to try this (with some success). Here is how I did it.

    • Cloned the vl72 vabs repo (this repo)
    • Added the suggested patch above to the patches directory of the kernel4.4 dir with the name mutex-lock-nested.diff
    • Edited the kernel4.4.SlackBuild to add patch -Np0 --verbose -i $CWD/patches/mutex-lock-nested.diff in its patches section
    • Executed the SlackBuild.

    Once the packages were created, I ran installpkg on the kernel4.4-src package and was ready to attempt the nvidia installation.

    As it turns out, it looks like the nvidia installer runs some kind of detection because it would not run on my machine (i have no nvidia cards on it). It said I did not have a video card supported by the driver and it just exited. Then I remembered my vostro box has an nvidia card, so I turn to it.

    I was able to run the installer there in a vlsandbox after installing the patched kernel4.4-src package. The module compiled fine for me, but the installer was unable to load it (understandably, given that this was done inside docker which should not be able to load kernel modules). I should point out that the installer will not run if the nouveau module is loaded (it was in my case, so I had to blacklist it and reboot).

    Here is the build log from my attempt

    http://pastebin.com/ktaXrse3

  6. nightflier reporter

    Installed new kernel 4.4.15.

    Module builds, loads and runs.

    Will test on more machines before closing issue.

  7. nightflier reporter

    Tested new 4.4.15 pkgs from commit 88dd4d2 .. kernel, kernel-modules, kernel-headers and kernel-stripped-src.

    Successfully built and ran nvidia on three different computers, 64 and 32 bit.

    Looks good.

  8. Log in to comment