Results 1 to 17 of 17

Thread: Install Nvidia 340.76 Driver in Kali Linux 2.0

  1. #1
    Join Date
    2013-Mar
    Posts
    6

    Install Nvidia 340.76 Driver in Kali Linux 2.0

    I have an older laptop in which the usual methods of installing an Nvidia driver do not work. The last driver supporting the laptop's gpu is 340.76. In case anyone runs across this problem, I hope this will help. References are at the end.

    - Install Kali

    - Install kernel headers, and dkms
    Code:
    apt-get update
    apt-get dist-upgrade
    apt-get install -y linux-headers-$(uname -r) dkms
    - Download Nvidia driver installation, and change its permissions to executable
    Code:
    wget http://us.download.nvidia.com/XFree86/Linux-x86_64/340.76/NVIDIA-Linux-x86_64-340.76.run
    chmod +x NVIDIA-Linux-x86_64-340.76.run
    - Prevent nouveau from loading
    Code:
    sed 's/quiet/quiet nouveau.modeset=0/g' -i /etc/default/grub
    update-grub
    reboot
    - Once rebooted, switch to a virtual console (ctrl+alt+f1 for instance) and stop the gdm3 service
    Code:
    service gdm3 stop
    - Run the nvidia driver installation
    Code:
    ./NVIDIA-Linux-x86_64-340.76.run
    - During the installation, choose yes to register the kernel module with DKMS, and no to install 32-bit compatibility libraries. The installation errors out. This is fine

    - Edit /usr/src/nvidia-340.76/nv-pat.c, then use dkms to fix things up, then use nvidia-xconfig to generate an /etc/X11/xorg.conf file, then reboot
    Code:
    nano /usr/src/nvidia-340.76/nv-pat.c
    - "about 35 line change "read_cr4" to "__read_cr4" and "write_cr4" to "__write_cr4" or copy-paste:"
    Code:
    static inline void nv_disable_caches(unsigned long *cr4)
    {
        unsigned long cr0 = read_cr0();
        write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
        wbinvd();
        *cr4 = __read_cr4();
        if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
        __flush_tlb();
    }
    
    static inline void nv_enable_caches(unsigned long cr4)
    {
        unsigned long cr0 = read_cr0();
        wbinvd();
        __flush_tlb();
        write_cr0((cr0 & 0x9fffffff));
        if (cr4 & 0x80) __write_cr4(cr4);
    }
    Code:
    sudo dkms autoinstall -k 4.0.0-kali1-amd64 -m nvidia-340 -v 340.76
    nvidia-xconfig
    reboot
    - And, you should be ready to drive on.

    References:
    http://docs.kali.org/general-use/ins...-on-kali-linux
    https://bugs.launchpad.net/ubuntu/+s...s/+bug/1431278
    https://bugs.launchpad.net/ubuntu/+s...278/comments/6
    Last edited by ColForbin; 2015-08-14 at 15:24.
    "Whatever happened to playing a hunch, Scully? The element of surprise, random acts of unpredictability? If we fail to anticipate the unforeseen or expect the unexpected in a universe of infinite possibilities, we may find ourselves at the mercy of anyone or anything that cannot be programmed, categorized or easily referenced."

  2. #2
    Join Date
    2013-Mar
    Posts
    5
    Thanks for the tutorial!

    I followed these instructions, however it failed. I was able however to simply download (from www.nvidia.com) driver version 346.72, which worked, and it worked without having to edit the "nv-pat.c" file. This was on an HP laptop with a K3100M GPU.

  3. #3
    Join Date
    2015-May
    Posts
    5
    Has anyone tried using apt-get install nvidia-kernel-dkms? I get a 404 not found from the sana repositories.

  4. #4
    Join Date
    2015-Aug
    Posts
    1
    i tried nvidia-kernel-dkms and it succeed , but after reboot a white screen came up with " Oops , Somthing Went Wrong " and thers a logoff button there . anyone else havin the same problem ?

  5. #5
    Join Date
    2013-Mar
    Posts
    5
    Yes I had originally attempted the nvidia-kernel-dkms, however it points to *-2kali_amd64.deb, which is for Kali v1, the repos have it listed as -3_amd64.deb (or at least on 8/11/2015 when I did this), and there were about a dozen packages that all listed the same type of issue. I worked my way through all of them, and did get it to install, however when I rebooted I had an issue as well. This tutorial has worked well so far with Kali v2. If you try to install kali-linux-gpu (which includes some of the same packages) it will actually fail as it is looking for version 1.67, yet the repos only have version 1.55. I am hopeful that all of the repos will get upgraded with the version 2 packages before too long.

  6. #6
    Join Date
    2015-Aug
    Posts
    3
    After installing Nvidia drivers it crashed the GUI. When I restarted the last time, GDM3 was blank with a flashing cursor.
    Last edited by drapheus; 2015-08-16 at 03:42.

  7. #7
    Join Date
    2014-May
    Posts
    28
    Quote Originally Posted by drapheus View Post
    After installing Nvidia drivers it crashed the GUI. When I restarted the last time, GDM3 was blank with a flashing cursor.
    1.ctrl+alt+F1

    login:user pass

    2.nvidia-xconfig

    3.reboot

  8. #8
    Join Date
    2015-Aug
    Posts
    3
    Quote Originally Posted by aetos View Post
    1.ctrl+alt+F1

    login:user pass

    2.nvidia-xconfig

    3.reboot
    unfortunately it didn't work.
    Same thing on a fresh install and the only change was nvidia driver install.

  9. #9
    Join Date
    2015-Jul
    Posts
    15
    ****, This technique posted by ColForbin worked flawless on 1.x

    Now i guess i will hang with nouveau till a fix makes itself known.

    Quiet sure my card gets no dice in this 2.0 version

    02:00.0 VGA compatible controller: NVIDIA Corporation G96 [GeForce 9500 GT] (rev a1)

  10. #10
    Join Date
    2015-Aug
    Posts
    1
    I installed the driver this way..

    1.

    Code:
    apt-get update
    apt-get dist-upgrade
    apt-get install -y linux-headers-$(uname -r) dkms

    2.


    Download the newest driver from the offical nvidia website.

    3.

    Code:
    sed 's/quiet/quiet nouveau.modeset=0/g' -i /etc/default/grub
    update-grub
    reboot

    4.


    You coming to the login screen. Just don't log in. Press CTRL+ALT+F1

    5.


    Login in with "root" and your password.

    6.

    Code:
    service gdm3 stop

    8.


    Cd to the place where the nvidia drive is. And..
    Code:
    sudo bash NVIDIA-Linux-x86_64-XXX.XX.run
    reboot
    Hope that help!

  11. #11
    Join Date
    2015-Aug
    Posts
    1
    Hi Everyone:

    I have followed the explanation of ColForbin but there is an error at the end, when i enter:
    sudo dkms autoinstall -k 4.0.0-kali1-amd64 -m nvidia-340 -v 340.76

    The system says:
    "............(bad exit status: 2)
    Error! Bad return status for module build on kernel: 4.0.0-kali1-amd64 (x86_64)"

    Could you please help me ?

    Thanks

  12. #12
    Join Date
    2013-Mar
    Posts
    23
    i havnt been able to get any nvidia drivers to work for the new kali sana.

    i had to reinstall after following the kali guide in the kali docs. I dont think they have updated it from kali 1.x

  13. #13
    Join Date
    2015-Aug
    Posts
    1
    Yep. I followed the various suggestions in this thread and I was unsuccessful. I would try a newer driver; however, I am running an NVS 3100M and 340.76 appears to be the latest that supports my card. So far, my options appear to be to stick with nouveau or use Kali 1.x. ~_~

  14. #14
    Join Date
    2015-Aug
    Posts
    3
    I tried the steps and it didn't work, all I got was a black screen with a flashing cursor in the top left.

  15. #15
    Join Date
    2015-Aug
    Posts
    2
    Quote Originally Posted by SiiXFX View Post
    I installed the driver this way..

    1.

    Code:
    apt-get update
    apt-get dist-upgrade
    apt-get install -y linux-headers-$(uname -r) dkms

    2.


    Download the newest driver from the offical nvidia website.

    3.

    Code:
    sed 's/quiet/quiet nouveau.modeset=0/g' -i /etc/default/grub
    update-grub
    reboot

    4.


    You coming to the login screen. Just don't log in. Press CTRL+ALT+F1

    5.


    Login in with "root" and your password.

    6.

    Code:
    service gdm3 stop

    8.


    Cd to the place where the nvidia drive is. And..
    Code:
    sudo bash NVIDIA-Linux-x86_64-XXX.XX.run
    reboot
    Hope that help!
    It ends with Oh no ! Something has gone wrong.
    The same issue when I followed official instruction.

    Additionaly I log in to CLI and executed nvidia-xconfig
    after reboot last system message was
    Started Update UTMP about System Runlevel Changes.
    and it stuck there forever.

  16. #16
    Join Date
    2015-Jul
    Posts
    15
    The method of of installing Nvidia drivers on Kali Linux 1.0 or 1.1 won't work on Kali Sana 2.0. I made a guide for installing Nvidia drivers on Kali SANA. It works perfectly. Try it.
    https://forums.kali.org/showthread.p...A-2-0-(Solved)

  17. #17
    Quote Originally Posted by drapheus View Post
    unfortunately it didn't work.
    Same thing on a fresh install and the only change was nvidia driver install.
    .
    Quote Originally Posted by MrUnruly View Post
    I tried the steps and it didn't work, all I got was a black screen with a flashing cursor in the top left.


    Same exact issue...
    Not sure where to go from here.

Similar Threads

  1. Kali Linux 2.0 64Bit NVIDIA Driver cant install.. (GT 750M)
    By KaliLinux0 in forum TroubleShooting Archive
    Replies: 4
    Last Post: 2015-12-23, 23:06
  2. Kali Linux 2.0 Install nvidia driver and change resolution!
    By NukeDK in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2015-11-26, 14:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •