Quote Originally Posted by staticn0de View Post
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"

Restart bumblebee with the following and ignore any 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 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
Hi Static,

first things first: Sorry for my english, im German ^^

thx a lot for your How-To!

I have a Lenovo Y500 Ideapad with 2 GT650m SLI, 16GB RAM, Intel i7.
I have several Problems getting my GPU's to run properly with the Nvidia Driver.
Is there any way you can help me - i mean to chat with you over Whatsapp or something like that, sendind you Images from my Screen and having a real time help?
I am willing to pay for your efforts.

As I checked my Hardware in Windows there are only the both Nvidia GPU's listed, no Intel onboard GPU.
The Cards support Optimus technology, following the Nvidia Website, but do i really need Optimus, if there is no Intel onboard GPU?

Following your How-To step by step i get stuck after editing the Bumblebee .conf, i added both BusID's of the GPU's and the SLI Option

Section "Device"
Identifier "DiscreteNvidia"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "PCI:01:00:0"
BusID "PCI:02:00:0"
and activating the SLI in the Options.

After restarting bumblebee and stopping the GDM3 Service i get a black Screen with blinking cursor -> no way to get to TTY1 with "ALT CTRL F1", nor any other Hotkeys working.
I worked around that booting in the Recovery Mode in Console.

In Recovery mode its no Problem stopping the GDM3 and installing Nvidia.
After rebooting i tried the optirun glxspheres64 -> Error.

I also tried an other How-To without Bumblebee:
http://www.blackmoreops.com/2014/03/...er-kali-linux/

-> eveything worked fine (yeah, i edited the Xorg.conf with both BusID's and SLI and MultiGPU Option) until step 6
In booting process after the boot information "GDM3 start", my screens gets Black, flashing one time for a second, getting black again, then both GT650m's Fans getting full thrust (airflow getting very hot) and after 30 secs or something the Laptopn shuts down - no way to get to TTY1 or anything -> no way to have any influence after the GDM3 starts.

After reading many many Hours in Forums, HOW-To's, the Nvidia Support section, and the official Nvidia Documentation i have no Clue what to do.

Would be nice to get an answer from You.