The default Kali installation can be augmented with the ability to use its Graphics Processing Unit (GPU) to boost the performance of specific tools. Kali utilizes the open source nouveau driver to support graphics cards that does not support the usage of GPU based applications. So the first step is to install the NVIDIA Accelerated Linux Graphics Driver and then the CUDA toolkit. Once CUDA is installed the GPU based applications will then be able to utilize the GPU to perform tasks which will increase the effectiveness of the tools. This article will walk through the steps to install the NVIDIA graphics driver and CUDA toolkit 6. Once they are installed pyrit will be used to verify installation and check performance.
First Step: Update Kali
Update the repositories to be able to access all sources during an update. Open /etc/apt/sources.list with either vi or nano and verify/update the following:
Once all the repositories are configured, then run an update:
Second Step: Install Linux Headers
The following command installs the Linux Headers which is required to build the NVIDIA kernel module:
At this point we are ready to start the actual install of the NVIDIA Accelerated Linux Drivers.
Third Step: Install NVIDIA Dynamic Kernel Module Support
Fourth Step: Install NVIDIA XConfig
Installs a utility called nvidia-xconfig, which is designed to make editing the X configuration file
Fifth Step: Run the NVIDIA XConfig Utility
nvidia-xconfig will find the X configuration file and modify it to use the NVIDIA X driver instead of the nouveau driver
Sixth Step: Reboot Kali
If during the boot up process a blank screen with a blinking cursor then do the following:
# rm /etc/X11/xorg.conf
# nvidia-xconfig
Reboot the system
Seventh Step: Verify that NVIDIA Driver Installed correctly
Checking the glxinfo to see if direct rendering is set to “Yes”
Eighth Step: Install NVIDIA CUDA 6 Toolkit
Ninth Step: Install NVIDIA OpenCL
At this point NVIDIA drivers are installed and ready to be tested. Pyrit will be the GPU application that we will utilize to verify our installation.
Installation of Pyrit
Kali comes with an older version of pyrit which we will uninstall:
Once it has been removed there are dependencies that need to be installed:
Download the latest pyrit, cpyrit-cuda, and cpyrit-opencl at https://code.google.com/p/pyrit/downloads/list
Extract the files into the /home directory:
# tar xvzf cpyrit-cuda-0.4.0.tar.gz
# tar xvzf cpyrit-opencl-0.4.0.tar.gz
Compile pyrit:
# python setup.py build
If no errors during the compile then:
After Pyrit is installed the CUDA modules will be next.
# cd cpyrit-cuda-0.4.0
# python setup.py build
If no errors during the compile then:
Installing OpenCL is optional:
# cd cpyrit-opencl-0.4.0
# python setup.py build
If no errors during the compile then:
Pyrit is now installed and we can check to see if it sees the correct cores:
If no CUDA or OpenCL device is displayed then either the drivers were installed incorrectly or the Graphics card does not support CUDA or OpenCL.
Pyrit also has a benchmark command that can be utilized to check for performance and verify functionality:
Kali is now utilizing the NVIDIA Accelerated Linux Drivers, CUDA Toolkit, and OpenCL. This will allow for better performance for applications that support CUDA or OpenCL. If you have any comments or questions please do not hesitate to leave a reply below.