Results 1 to 50 of 376

Thread: (Guide) Installing Nvidia + Bumblebee + CUDA for Optimus enabled Laptops

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Down Under

    (Guide) Installing Nvidia + Bumblebee + CUDA for Optimus enabled Laptops

    Updated for Kali 2.0 Sana

    Hey guys, I'm rewriting this to use the repo as Kali Sana looks to have up-to-date nvidia drivers straight out of the gate.

    NVIDIA Driver 352.21
    CUDA 7.5.18 (the repo has 6.0.37-5, it's a bit old so I'm manually installing 7.5.18)
    VirtualGL 2.4.90
    Pyrit v308 (optional)
    cudaHashcat (optional)
    Couple of points

    1. This guide and all GPU passthrough software such as cuda_pyrit and cudahashcat will never work if run from within a Virtual Machine. Please don't post that it does not work for you in a VM because you should have read this.

    2. I'm going to assume that you are either on a fresh install of Kali or have the skills to clean up any conflicting software.

    3. I run 64bit software. If you don't, change the files you download to match what you use. (Edit: CUDA does not support 32bit anymore)

    4. If you have any issues or if something does not work, follow the template linked here and post the results of all commands.

    Lets get started.

    1. Update Kali
    apt-get update && apt-get upgrade && apt-get dist-upgrade
    2. Download VirtualGL and install it. Grab the latest non-beta
    Install with:
    cd ~
    dpkg -i virtualgl*.deb
    3. Download CUDA 7.5. Grab the x64 or 14.04 *.run file (should be 1.1gb)
    5. Install linux headers for your kernel
    apt-get install linux-headers-$(uname -r)
    6. Install dependencies we will need later. The first two are for CUDA and the last is for pyrit
    apt-get install freeglut3-dev libxmu-dev libpcap-dev
    7. Update system PATH. Notice that the PATH references CUDA 7.5. If you have a different version, change it to match.
    nano ~/.bashrc
    Add the following line and then save and close bashrc
    export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-7.5/bin
    8. Export the system path. We export the path from terminal so we can take advantage of it without restart. Run the following in terminal
    export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-7.5/bin
    9. Install bumblebee-nvidia and primus. Just press enter when the messages appear and ignore the warning about rrmod.
    apt-get install bumblebee-nvidia primus
    10. Edit the bumblebee config file so bumblebee knows we are using the NVIDIA driver. Change the 'Driver=' value. Should be line 22. The module from the repo driver is 'nvidia-current' but we set 'nvidia' here so that the nvidia section of bumblebee.conf is called.
    nano +22 /etc/bumblebee/bumblebee.conf
    Make it read:
    check line 55 and make sure it reads:
    Save and close
    11. Run the following and record the PCI address of your video card. It will look similar to 03:00.0
    lspci | egrep 'VGA|3D'
    12. Edit the xorg.conf.nvidia file so it knows the PCI address of your video card. Note that the last group of numbers is now seperated with a ":" instead of a ".". We are editing under the area 'Section "Device"'
    nano /etc/bumblebee/xorg.conf.nvidia
    Section "Device"
    Identifier "DiscreteNvidia"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BusID "PCI:03:00:0"
    14. Reboot
    shutdown -r now
    15. Now we have restarted, test the driver. glxsheres64 will test the driver and modinfo nvidia will show the version loaded.
    optirun glxspheres64
    modinfo nvidia
    16. Prepare CUDA for install
    cd ~
    chmod +x cuda*.run
    17. Run the CUDA install
    Accept the EULA
    Select yes to unsupported configuration
    No to graphics driver
    Yes to the toolkit
    Accept default location
    Yes to symbolic link
    Yes to samples
    Yes to default samples location
    The toolkit will install
    18. Set up the dynamic linker for CUDA. Notice that this is slightly different than the path added for .bashrc
    nano /etc/
    Match the contents below
    include /etc/*.conf
    19. Excute the following to load our changes
    20. Install libcuda1. You will get an incorrect driver version error if you don't.
    apt-get install libcuda1
    21. Build the NVIDIA samples so we can confirm CUDA is working with optirun
    cd /root/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery/
    22. Run deviceQuery and then post your pass! If you see a pass, it all worked out! If not, follow the link at the start of the guide and post everything asked.
    optirun ./deviceQuery
    Last edited by staticn0de; 2015-12-13 at 20:19.

Similar Threads

  1. Replies: 6
    Last Post: 2017-01-04, 19:39
    By jolubedju in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2014-06-03, 10:52
  3. Kali Linux 1.05 nvidia optimus cuda and pyrit
    By gfbaggio in forum TroubleShooting Archive
    Replies: 3
    Last Post: 2014-04-28, 20:15

Posting Permissions

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