Page 3 of 38 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 376

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

  1. #21
    Junior Member
    Join Date
    Jul 2014
    Posts
    9
    staticn0de, thank you for the write-up!

    I did everything succesfully and the tests worked, but I'm unsure about a few things.
    1. If the nVidia driver automatically removes nouveau then why is there a xorg.conf.nouveau file in the /etc/bumblebee directory?
    2. How can I make sure the nVidia driver is the default driver at startup?
    3. Lastly, when I lsmod | grep nvidia there is no output, when I lsmod | grep nouveau there is also no output. Shouldn't at least one of them show something?

  2. #22
    Senior Member
    Join Date
    Apr 2014
    Location
    Down Under
    Posts
    315
    Quote Originally Posted by London View Post
    staticn0de, thank you for the write-up!

    I did everything succesfully and the tests worked, but I'm unsure about a few things.
    1. If the nVidia driver automatically removes nouveau then why is there a xorg.conf.nouveau file in the /etc/bumblebee directory?
    2. How can I make sure the nVidia driver is the default driver at startup?
    3. Lastly, when I lsmod | grep nvidia there is no output, when I lsmod | grep nouveau there is also no output. Shouldn't at least one of them show something?
    Hi there, don't mistake my guide as making me an expert on bumblebee, but i'll try and answer your question.

    1. The nvidia driver does not remove nouveau, bumblebee changes between the graphics card which includes disabling one driver and enabling the nvidia driver. Both remain on the system. The xorg.conf.nouveau does not matter as it is only called if you set driver=nouveau in the bumblebee.conf file.

    2. You don't set nvidia to start at start up. The reason bumblebee is used is so you can benefit from the power saving of having the intel card in use when the graphics card is not needed. When you use optirun glxspheres64 (for example) the nvidia card is enabled which uses more power so that the graphicly demanding application has a performance boost.

    3. Unless you have used optirun, the nvidia modules will not be loaded. For example, run the command lsmod | grep -i nvidia and you will receive nothing. Run optirun glxspheres64 and while it is running use lsmod | grep -i nvidia and it will display the nvidia modules are the driver has loaded to use the discrete card.

  3. #23
    Junior Member
    Join Date
    Jul 2014
    Posts
    9
    Thank you! that really brings it all together for me. I usually have to run the optispheres64 command twice before it works, but everything is working perfectly other than that. Really appreciate it!

  4. #24
    Senior Member
    Join Date
    Apr 2014
    Location
    Down Under
    Posts
    315
    Quote Originally Posted by Quest View Post
    that's cool

    even though most can figure it out for themselves, I was thinking that maybe(?) it would be nice to have all the command lines, and links to, an OFF_LINE installation. There's nothing wrong with this procedure as is, but we already DLing CUDA (and now probly new NVIDIA drivers), so maybe DL everything and than install?
    Hmmm I like the idea, it would save some effort. My concern is that bumblebee is a decent effort to compile and then install. That, and it has dependencies. And those dependencies have dependencies.Trying to install all them without a repo would be a pain.

    On another note, if you can't go to the mountain, you can always bring the mountain to you. You could host your own repo on your local network. I've looked into it but Kali looks after it a little different to other distros where you can just clone them with rsync. If you had a local repo, you won't need the internet anymore. This clearly isn't the solution for everyone....

    In short, I don't really have the time (and maybe not the skill!) to document the requirements for this as an offline install. Although, I'm about to type up the CUDA6 and NVIDIA 340.24 version and with the exception of bumblebee (not bumblebee-nvidia) it is an offline install. It's easier to install than what I already wrote as it does not need manual modifications to nvidia-uvm.ko.
    Last edited by staticn0de; 2014-07-13 at 10:16 AM.

  5. #25
    Senior Member
    Join Date
    Apr 2014
    Location
    Down Under
    Posts
    315
    The following will install the latest at the time (340.24) NVIDIA driver and latest CUDA (version 6) on Kali with
    Bumblebee for Optimus laptops. Usual notes about clean installs and selecting either 32bit or 64bit depending on your
    needs from the first page still apply.

    First, update and upgrade Kali to latest
    apt-get update && apt-get upgrade && apt-get dist-upgrade

    Download VirtualGL
    http://downloads.sourceforge.net/pro...se_mirror=ufpr

    Download CUDA (this is V6 64bit)
    http://developer.download.nvidia.com...7_linux_64.run

    Download the nvidia*.run driver. Follow the bouncing ball to get what you need for your hardware
    http://www.nvidia.com/Download/index.aspx?lang=en-us

    Install VirtualGL
    cd ~
    dpkg -i virtualgl*.deb


    Add the path for VirtualGL to .bashrc
    nano ~/.bashrc
    Add a line somewhere near the top that reads:
    export PATH=$PATH:/opt/VirtualGL/bin

    Export the path so we don't have to log out and in. Run the following from terminal
    export PATH=$PATH:/opt/VirtualGL/bin

    Install the linux headers
    apt-get install linux-headers-$(uname -r)

    Some dependencies for CUDA later
    apt-get install freeglut3-dev libxmu-dev


    Add the wheezy backports Repo (yes, still needed for bumblebee but not the NVIDIA driver)
    nano /etc/apt/sources.list
    Add the following line to the file and then save
    deb http://ftp.debian.org/debian wheezy-backports main contrib non-free
    apt-get update


    Install bumblebee (not bumblebee-nvidia)
    apt-get install bumblebee primus

    Edit the bumblebee.conf file
    nano /etc/bumblebee/bumblebee.conf

    Change line 22 so it reads:
    Driver=nvidia

    We do not need to edit line 55 as the module the nvidia installer will build is called nvidia and not nvidia-current.

    Save and close.

    Run the following and record your PCI address for your video card. It will look similar to 03:00.0

    lspci | egrep 'VGA|3D'

    Edit xorg.conf.nvidia and add a line under the 'Section "Device"' area so that is matches what is shown below. Change the bus ID to match what you recorded previously and take note that you recored a . before the last number and it is now a ':'. You need the ':'.
    Section "Device"
    Identifier "DiscreteNvidia"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BusID "PCI:03:00:0"


    Change NVIDIA installer permissions

    cd ~
    chmod +x NVIDIA*.run


    You now need to close gdm3 because it can't be running for the driver install. Record what you need now. If you don't get a login screen when you close gdm3, press control + alt + F1
    /etc/init.d/gdm3 stop

    Now the install
    cd ~
    ./NVIDIA*.run --dkms -z


    Accept the EULA
    Select yes to register the kernel module with DKMS
    No to libs (unless you want them)
    Ok to acknowledge the website libs
    The install will take place
    Do not run X-Config. Select NO.
    The installer will close.

    Restart kali with
    shutdown -r now

    When rebooted, run optirun glxspheres64 and confirm it's working. A 'modinfo nvidia' will show that you now have the 340.24 module loaded.

    To install CUDA, chmod the installer first
    cd ~
    chmod +x cuda*.run


    And now to install
    ./cuda*.run

    Accept the EULA
    Select yes to unsupporrted 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

    For the path, we will add a little more to what we defined for VirtualGL. It should look like this in your bashrc file
    nano ~./bashrc
    export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-6.0/bin


    Run the following so we don't have to log out
    export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-6.0/bin

    Edit the following file so the contents match those shown below
    nano /etc/ld.so.conf

    Code:
    include /etc/ld.so.conf.d/*.conf
    /usr/local/cuda-6.0/lib64
    Save and close

    Run:
    ldconfig

    Build the nvidia samples

    cd /root/NVIDIA_CUDA-6.0_Samples
    make


    Follow the steps from the second post to run the CUDA deviceQuery script and you should see pass.

    Remember to remove or comment out the wheezy backports repo
    Last edited by staticn0de; 2014-09-14 at 10:31 AM.

  6. #26
    Senior Member
    Join Date
    Aug 2013
    Location
    lost in space
    Posts
    580

    Cool

    Code:
    root@kali:~/NVIDIA_CUDA-6.0_Samples/1_Utilities/deviceQuery# optirun ./deviceQuery
    ./deviceQuery Starting...
    
     CUDA Device Query (Runtime API) version (CUDART static linking)
    
    Detected 1 CUDA Capable device(s)
    
    Device 0: "GeForce GT 630M"
      CUDA Driver Version / Runtime Version          6.5 / 6.0
      CUDA Capability Major/Minor version number:    2.1
      Total amount of global memory:                 2048 MBytes (2147155968 bytes)
      ( 2) Multiprocessors, ( 48) CUDA Cores/MP:     96 CUDA Cores
      GPU Clock rate:                                950 MHz (0.95 GHz)
      Memory Clock rate:                             900 Mhz
      Memory Bus Width:                              128-bit
      L2 Cache Size:                                 131072 bytes
      Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65535), 3D=(2048, 2048, 2048)
      Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
      Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048 layers
      Total amount of constant memory:               65536 bytes
      Total amount of shared memory per block:       49152 bytes
      Total number of registers available per block: 32768
      Warp size:                                     32
      Maximum number of threads per multiprocessor:  1536
      Maximum number of threads per block:           1024
      Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
      Max dimension size of a grid size    (x,y,z): (65535, 65535, 65535)
      Maximum memory pitch:                          2147483647 bytes
      Texture alignment:                             512 bytes
      Concurrent copy and kernel execution:          Yes with 1 copy engine(s)
      Run time limit on kernels:                     Yes
      Integrated GPU sharing Host Memory:            No
      Support host page-locked memory mapping:       Yes
      Alignment requirement for Surfaces:            Yes
      Device has ECC support:                        Disabled
      Device supports Unified Addressing (UVA):      Yes
      Device PCI Bus ID / PCI location ID:           1 / 0
      Compute Mode:
         < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
    
    deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 6.5, CUDA Runtime Version = 6.0, NumDevs = 1, Device0 = GeForce GT 630M
    Result = PASS
    root@kali:~/NVIDIA_CUDA-6.0_Samples/1_Utilities/deviceQuery#
    i have to tell ya, I've been meaning to do this now for over 7 months with a week of intense web search, and that last Howto above f i n a l l y did it!

    Many thanks staticn0de ! =]
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  7. #27
    Senior Member
    Join Date
    Apr 2014
    Location
    Down Under
    Posts
    315
    Hi Quest,

    I'm happy to hear that. I'll update the first post so others know the newer drivers may work in lieu of the old.

    Thanks for posting to let everyone know it worked for you.

  8. #28
    Senior Member
    Join Date
    Aug 2013
    Location
    lost in space
    Posts
    580
    That's my 'dummyproof' edited version of your guide.

    Code:
    Update and upgrade Kali to latest
    
    apt-get update && apt-get upgrade && apt-get dist-upgrade
    
    Downloads
    You will need the files below (64 bit) I always go with 64bit as I am on Kali 64bit. Download in the Home folder or place them in the Home folder after.
    
    
    
    Install VirtualGL
    cd ~
    
    dpkg -i virtualgl*.deb
    
    Add the path for VirtualGL to .bashrc
    
    nano ~/.bashrc
    
    Add a line somewhere at the top that reads:
    export PATH=$PATH:/opt/VirtualGL/bin
    
    Save the file(Ctrl+x, then Y, then Enter)
    
    Export the path so we don't have to log out and in.
    
    export PATH=$PATH:/opt/VirtualGL/bin
    
    Install the linux headers
    
    apt-get install linux-headers-$(uname -r)
    
    Some dependencies for CUDA for later
    
    apt-get install freeglut3-dev libxmu-dev
    
    Add the wheezy backports Repo (yes, still needed for bumblebee but not the NVIDIA driver)
    Go to Computer > File System > etc > apt > souces.list, and open it with Leafpad, and add the following line to the file and then save.
    deb http://ftp.debian.org/debian wheezy-backports main contrib non-free
    
    apt-get update
    
    Install bumblebee (not bumblebee-nvidia)
    
    apt-get install bumblebee primus
    
    Edit the bumblebee.conf file
    
    nano /etc/bumblebee/bumblebee.conf
    
    Change line 22 so it reads:
    Driver=nvidia
    
    Run the following and record your PCI address for your video card. It will look similar to 03:00.0 (yours might be different)
    
    lspci | egrep 'VGA|3D'
    
    Edit xorg.conf.nvidia 
    
    nano /etc/bumblebee/xorg.conf.nvidia
    
    add a line under the 'Section "Device"' area so that is matches what is shown below. Change the bus ID to match what you recorded previously and take note that you recored a . before the last number and it is now a ':'. You need the ':'.
    
    Section "Device"
    Identifier "DiscreteNvidia"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BusID "PCI:03:00:0"
    
    Restart bumblebee with the following and ignore any ERROR/FAIL warnings
    
    /etc/init.d/bumblebeed restart
    
    Change NVIDIA installer permissions
    cd ~
    
    chmod +x NVIDIA*.run
    
    You now need to close gdm3 because it can't be running for the driver install. 
    Record what you need now. If you don't get a login screen when you close gdm3, press control + alt + F1
    
    /etc/init.d/gdm3 stop
    
    Now the NVIDIA install
    cd ~
    
    ./NVIDIA*.run --dkms -z
    
    -Accept the EULA
    -Select yes to register the kernel module with DKMS
    -No to libs (unless you want them)
    -Ok to acknowledge the website libs
    The install will take place...
    -Do not run X-Config. Select NO.
    The installer will close. 
    
    Restart kali with
    
    shutdown -r now 
    
    or Ctrl+Alt+Del
    
    When rebooted, run 
    
    optirun glxspheres64
    
    A 'modinfo nvidia' will show that you now have the 340.24 module loaded.
    
    modinfo nvidia
    
    To install CUDA, chmod the installer first
    cd ~
    
    chmod +x cuda*.run
    
    And now to install CUDA
    
    ./cuda*.run
    
    -Accept the EULA (Tab then, accept)
    -Select yes to unsupported configuration
    -No to graphics driver
    -Yes to the toolkit
    -Accept default location (press Enter only)
    -Yes to symbolic link
    -Yes to samples
    -Yes to default samples location (press Enter only)
    The toolkit will install...
    
    For the path, we will add a little more to what we defined for VirtualGL earlier.
    
    nano ~/.bashrc
    
     It should look like this in your bashrc file 
     export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-6.0/bin
    
    Run the following so we don't have to log out
    
    export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-6.0/bin
    
    Edit the following file so the contents match those shown below
    
    nano /etc/ld.so.conf
    
    Contents:
    include /etc/ld.so.conf.d/*.conf
    add /usr/local/cuda-6.0/lib64
    
    Save and close
    
    Run
    
    ldconfig
    
    Build the nvidia samples
    
    cd /root/NVIDIA_CUDA-6.0_Samples
    
    make
    
    cd 1_Utilities/deviceQuery
    
    optirun ./deviceQuery
    
    You should see Result = PASS!
    
    Now, I know you want to see it in action so the next part we'll install Pyrit.
    
    First, remove the Wheezy repo. 
    You may either comment out the line we added or delete it.
    Computer > File System > etc > apt > souces.list,
    Save the file. 
    
    apt-get update
    
    Checkout Pyrit
    
    svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn
    
    Install required libraries and add CUDA support
    
    apt-get install libpcap-dev
    
    cd pyrit_svn/pyrit/
    
    python setup.py build
    
    python setup.py install
    
    cd ../cpyrit_cuda/
    
    python setup.py build
    
    python setup.py install
    
    Now, what we have been waiting for this entire time. Lets see it work.
    
    optirun pyrit benchmark


    as a side note, after all this my Kali installation went from a little less then 8Gb to 11Gb. Interesting...
    Last edited by Quest; 2014-07-18 at 06:11 AM.
    Kali Linux USB Installation using LinuxLive USB Creator
    Howto Install HDD Kali on a USB Key
    Clean your laptop fan | basic knowledge

  9. #29
    Junior Member
    Join Date
    Jul 2014
    Posts
    2
    Quote Originally Posted by staticn0de View Post
    Run the command below to confirm that bumblebee is working
    optirun glxspheres64
    Hi,
    I have the following problem: when I enter this last command optirun glxspheres64, my screen goes totally black and my nvidia vgas start to run on full speed (vents go on full throttle) and after 20s my laptop shuts down. I suppose my hardware causes the peoblem, I have 3VGAs: the integrated intel hd4400, and 2 nvidia gt750M. I don't want to use SLI, I only want to use one VGA which makes me able to change the kali's resolution to fullhd.

  10. #30
    Junior Member
    Join Date
    Jul 2014
    Posts
    5
    Hi staticn0de and all,

    I have problems with bumblebee, my gear is: Lenovo thinkpad T440p with geforce 730m card.

    My source.list file:

    ## Regular Updates
    deb http://http.kali.org/kali kali main non-free contrib
    deb http://security.kali.org/kali-security kali/updates main contrib non-free

    ## Source Updates
    deb-src http://http.kali.org/kali kali main non-free contrib
    deb-src http://security.kali.org/kali-security kali/updates main contrib non-free

    ## Bumblebee
    #deb http://ftp.debian.org/debian wheezy-blackports main contrib non-free

    The last entry is commented out I'm deleting the comment before installing bumblebee primus and apt-get update

    With above configuration of source list I have an error while apt-get update && apt-get upgrade -y && apt-get dist-update -y:

    Errors were encountered while processing:
    Linux-image-3.14-kali1-amd64
    extlinux
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    After Configuring bumblebee.conf and xorg.conf.nvidia and restarting bumblebeed service which fails I did /etc/init.d/gdm3 stop and i receive the following error:

    bash: /etc/init.d/gdm3: cannot execute binary file

    I need to hard restart the laptop and after this me kali installation totally breaks. I have an error while booting:

    The root filesystem is currently mounted in read-only mode. A maintenece will now be started. After performing system maintenance, press Ctrl+D to terminate the maintenance shell and restart the system...

    If You need more additional info on the behavior or configuration files please let me know.
    If you have any ideas whats wrong Please let me know

Posting Permissions

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