PDA

View Full Version : Kali Linux 1.1.0 kernel install Nvidia proprietary drivers for GTX 970 and oclHashcat



upinarms247365
2015-04-09, 05:57
It turns out that the GTX 970 is not supported in the Kali repos yet. Kali is based on debian and its backport repos is up to 340.x, but the GTX 970 requires 346.x to work in Kali. Here are the steps I used in order to get my GeForce GTX 970 card working in the latest version of Kali. Props to staticn0de and his awesome guide for optimus enabled laptops, from which I used as a reference to help me accomplish this task.

This guide is written for a fresh installation of Kali 1.1.0

1. Add the Kali repositories to /etc/apt/sources.list

2. apt-get clean && apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y

3. reboot

4. cd ~/Downloads

5. Download the latest nvidia driver and cuda toolkit
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/346.59/NVIDIA-Linux-x86_64-346.59.run

6. chmod +x NVIDIA-Linux-x86_64-346.59.run

7. Download the latest cuda toolkit
wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run

8. chmod +x cuda_7.0.28_linux.run

9. Install Linux Headers for your current kernel
apt-get install linux-headers-$(uname -r)

10. Install the following
apt-get install freeglut3-dev libxmu-dev

11. CTRL+ALT+F1 to drop into a terminal shell

12. cd ~/Downloads

13. modprobe -r nouveau

14. /etc/init.d/gdm3 stop

15. Execute the following to install the Nvidia Drivers:
./NVIDIA-Linux-x86_64-346.59.run
NOTE: Do NOT run the nvidia-xconfig

16. reboot

17. Open Terminal and cd ~/Downloads

18. Execute the following to install the Nvidia Cuda Toolkit:
./cuda_7.0.28_linux.run
Accept the EULA
Select yes to unsupported configuration
No to graphics driver
Yes to the OpenGL libraries
Yes to the toolkit
Accept default location
Yes to symbolic link
Yes to samples
Yes to default samples location

19. nano /etc/ld.so.conf
Add the following line to the end of the file:
/usr/local/cuda-7.0/lib64

20. Execute the following to apply our changes:
ldconfig

21. Build the NVIDIA samples so we can confirm CUDA is working
cd /root/NVIDIA_CUDA-7.0_Samples/
make
NOTE: This step takes quite a bit of time to complete.

22. cd 1_Utilities/deviceQuery

23. Execute the following to test:
./deviceQuery


To install oclHashcat for CUDA

1. cd /opt

2. wget http://hashcat.net/files/cudaHashcat-1.35.7z

3. p7zip -d cudaHashcat-1.35.7z

4. cd cudaHashcat-1.35/

5. Execute the following to test cudaHashcat:
./cudaHashcat64.bin -t 32 -a 7 example0.hash ?a?a?a?a example.dict
Accept the EULA by entering YES in all caps

Thanks for taking the time to check out this guide. I hope that you find it useful!

MJCRO
2015-04-10, 21:42
Awesome write up! Will a variation of this guide work for USB persistence? Only issue I'm having is by step 17, if I CRTL+ALT+F1, I encounter a black screen (which I can recover from with CRTL+ALT+F7). Tried to configure Kali to boot directly to the terminal directly, but it breaks the OS. Not sure if it due to persistence or something else.

upinarms247365
2015-04-11, 14:15
Thanks MJCRO!

Does it appear when you're logged into the GUI, before attempting to drop to a terminal using CRTL+ALT+F1, that your video settings are configured correctly? To elaborate, do the correct display settings apply for your adapter (resolution)? I ask because if your resolution is not set correctly, you may be not seeing the login prompt when you drop to a terminal because the resolution is set to something beyond or below the capabilities of your monitor. I'm not saying that this is your problem per say, but it would be something I checked on before proceeding to step 17.

I had issues with a total black screen and no cursor before I came up with this solution, but my issues stemmed from trying to use other build processes that utilized the nvidia-xconfig package and drivers for the GPU and CUDA from the repos, instead of using the drivers for both direct from Nvidia.

I haven't tried this process for a "USB w/ persistence" build, so I'm not sure what would be the cause of your black screen when performing step 17. I can give it a try later this weekend and see how it works for my setup.

MJCRO
2015-04-14, 00:33
Thanks MJCRO!

Does it appear when you're logged into the GUI, before attempting to drop to a terminal using CRTL+ALT+F1, that your video settings are configured correctly? To elaborate, do the correct display settings apply for your adapter (resolution)? I ask because if your resolution is not set correctly, you may be not seeing the login prompt when you drop to a terminal because the resolution is set to something beyond or below the capabilities of your monitor. I'm not saying that this is your problem per say, but it would be something I checked on before proceeding to step 17.

I had issues with a total black screen and no cursor before I came up with this solution, but my issues stemmed from trying to use other build processes that utilized the nvidia-xconfig package and drivers for the GPU and CUDA from the repos, instead of using the drivers for both direct from Nvidia.

I haven't tried this process for a "USB w/ persistence" build, so I'm not sure what would be the cause of your black screen when performing step 17. I can give it a try later this weekend and see how it works for my setup.

Yeah that may be it. The only resolutions that appear in the GUI display settings are 800x600 and 1024x768, which the latter of I used. I'm gonna try again with a fresh image and play around with the display settings, worse comes to worst, I can always configure Kali to boot to text mode and do everything from there. Just need to find a way to do that lol, haven't used Kali/BT in over two years so I'm pretty rusty with Linux. I'll post back with results when I get it working.

staticn0de
2015-04-15, 06:42
Hey there upinarms247365,

Thanks for the mention. I can see you have taken a bit from guide, couple of things you don't need in here as you aren't installing pyrit or running bumblebee

You don't need VirtualGL or libpcap-dev. The latter is only required for pyrit.

You also don't need to kll gdm3 before the cuda install. You only close it before the nvidia driver so the driver can install.

Otherwise, great work. I have no doubt a lot of people have found it helpful!

upinarms247365
2015-04-16, 16:57
Hey there upinarms247365,

Thanks for the mention. I can see you have taken a bit from guide, couple of things you don't need in here as you aren't installing pyrit or running bumblebee

You don't need VirtualGL or libpcap-dev. The latter is only required for pyrit.

You also don't need to kll gdm3 before the cuda install. You only close it before the nvidia driver so the driver can install.

Otherwise, great work. I have no doubt a lot of people have found it helpful!


Hey staticn0de! No problem at all. Thanks for following up with input. I'll adjust the original post accordingly.

upinarms247365
2015-04-17, 17:04
I have adjusted the original post accordingly.

JamesL
2015-04-19, 14:04
I found that for me when getting cpyrit and cudahashcat to run, that the 463 driver in 7.0 were needed and to turn off dkms. Just as some independent convergence on this technique.

Also, no to xconfig to avoid black screens.

MJCRO
2015-04-20, 21:24
Yeah, still having troubles here with persistence. After reading around, it seems Kali needs to be installed to a disk. Even after installing CUDA and GPU drivers to the USB, my card would still not get recognized. Gonna do more reading and see if I can get something working with USB.

upinarms247365
2015-04-23, 16:59
Yeah, still having troubles here with persistence. After reading around, it seems Kali needs to be installed to a disk. Even after installing CUDA and GPU drivers to the USB, my card would still not get recognized. Gonna do more reading and see if I can get something working with USB.

I had issues too trying it with a persistent USB. I didn't have enough cycles at the time to persue an answer. Let me know what you figure out and if I come into some free time, I'll do the same.

hosnappp
2015-06-08, 17:44
Would this still work for the newest version of Kali and NVIDIA drivers? Trying to do some CUDA stuff as well and so far I've just compromised my display manager a bunch :P

s2robbin
2015-10-11, 15:12
after step 15 reboot
I get a black screen, what could be the problem

merlin1
2015-11-12, 21:14
I have a questionto OP of this post
for this only question I made this account ... so please I will be needing a helping hand here..
while i was in make process of Cuda Tools 7.5 i notice some warning... im pasting them here ... rest all worked well .. please review and let me know what I should do inorder not to get these warnings
Im using Kali Sana 2.0
My Specs are
CPU : Intel i7 4770k
GPU : MSI GTX 970 4GB
RAM : 16GB


Warning I am receiving during cuda make process

WARNING - libGL.so not found, refer to CUDA Getting Started Guide for how to find and install them.
<<< >>> WARNING - libGLU.so not found, refer to CUDA Getting Started Guide for how to find and install them.
<<< >>> WARNING - libX11.so not found, refer to CUDA Getting Started Guide for how to find and install them.