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.
Couple of pointsCode: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)
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
2. Download VirtualGL and install it. Grab the latest non-betaCode:apt-get update && apt-get upgrade && apt-get dist-upgrade
3. Download CUDA 7.5. Grab the x64 or 14.04 *.run file (should be 1.1gb)Code:http://sourceforge.net/projects/virtualgl/files/ Install with: cd ~ dpkg -i virtualgl*.deb
5. Install linux headers for your kernelCode:https://developer.nvidia.com/cuda-downloads
6. Install dependencies we will need later. The first two are for CUDA and the last is for pyritCode:apt-get install linux-headers-$(uname -r)
7. Update system PATH. Notice that the PATH references CUDA 7.5. If you have a different version, change it to match.Code:apt-get install freeglut3-dev libxmu-dev libpcap-dev
8. Export the system path. We export the path from terminal so we can take advantage of it without restart. Run the following in terminalCode:nano ~/.bashrc Add the following line and then save and close bashrc 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.Code:export PATH=$PATH:/opt/VirtualGL/bin:/usr/local/cuda-7.5/bin
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.Code:apt-get install bumblebee-nvidia primus
11. Run the following and record the PCI address of your video card. It will look similar to 03:00.0Code:nano +22 /etc/bumblebee/bumblebee.conf Make it read: Driver=nvidia check line 55 and make sure it reads: KernelDriver=nvidia-current Save and close
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"'Code:lspci | egrep 'VGA|3D'
14. RebootCode:nano /etc/bumblebee/xorg.conf.nvidia Section "Device" Identifier "DiscreteNvidia" Driver "nvidia" VendorName "NVIDIA Corporation" BusID "PCI:03:00:0"
15. Now we have restarted, test the driver. glxsheres64 will test the driver and modinfo nvidia will show the version loaded.Code:shutdown -r now
16. Prepare CUDA for installCode:optirun glxspheres64 modinfo nvidia
17. Run the CUDA installCode:cd ~ chmod +x cuda*.run
18. Set up the dynamic linker for CUDA. Notice that this is slightly different than the path added for .bashrcCode:./cuda*.run 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
19. Excute the following to load our changesCode:nano /etc/ld.so.conf Match the contents below include /etc/ld.so.conf.d/*.conf /usr/local/cuda-7.5/lib64
20. Install libcuda1. You will get an incorrect driver version error if you don't.Code:ldconfig
21. Build the NVIDIA samples so we can confirm CUDA is working with optirunCode:apt-get install libcuda1
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.Code:cd /root/NVIDIA_CUDA-7.5_Samples/1_Utilities/deviceQuery/ make
Code:optirun ./deviceQuery