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