Lord777
Professional
- Messages
- 2,579
- Reaction score
- 1,493
- Points
- 113

Drivers and programs for cracking on the graphics card and the central processor in hashcat
This article shows you what drivers and programs to install so that hashcat and similar brute-force programs can use the video card and processor to crack passwords.
Hashcat currently uses OpenCL. As written on Wikipedia , OpenCL (Open Computing Language) is a framework for writing computer programs related to parallel computing on various graphics and central processing units, as well as FPGAs. OpenCL includes a programming language that is based on the C programming language standard C99 and an application programming interface. OpenCL provides instruction-level and data-level parallelism and is an implementation of the GPGPU technique. OpenCL is a completely open standard and royalty-free for its use.
The goal of OpenCL is to complement the open industry standards for 3D computer graphics and sound OpenGL and OpenAL with GPU capabilities for high performance computing. OpenCL is developed and supported by the non-profit consortium Khronos Group, which includes many large companies including AMD, Apple, ARM, Intel, Nvidia, Sony Computer Entertainment and others.
That is, thanks to this versatility of OpenCL, programs for performing computations, including hashcat, launch their tasks in a universal way on any device that supports OpenCL.
OpenCL is supported by AMD, NVIDIA, and Intel GPUs.
Information on supported Intel processors can be found at https://github.com/intel/compute-runtime (support for "Intel Graphics Compute Runtime for oneAPI Level Zero and OpenCL" appeared with Gen8) and https://www.intel.ru/content/www/ru/ru/support/articles/000005524/graphics-drivers.html (OpenCL support by different generations and processor models).
AMD, NVIDIA video cards also mostly support OpenCL, except for very old ones.
For OpenCL to work, you need to install a driver and tools for interacting with OpenCL. This article is about installing OpenCL on Linux. Similar instructions for Windows are given in the article "Hashcat Instructions: Launching and Using a Password Cracking Program" (see the section "Drivers for hashcat").
So, the requirements for hashcat to work with OpenCL are as follows:
- For AMD video cards you need: "RadeonOpenCompute (ROCm)" Software Platform (1.6.180 or later)
- Intel processors require: "OpenCL Runtime for Intel Core and Intel Xeon Processors" (16.1.1 or later)
- For NVIDIA video cards you need: "NVIDIA Driver" (367.x or later)
This article will show you how to install everything you need to use OpenCL on NVIDIA graphics cards and modern Intel processors. Instructions will be given using Kali Linux as an example (should also work for Debian, Linux Mint, Ubuntu and their derivatives) and Arch Linux (BlackArch).
How to enable OpenCL on Kali Linux (Debian, Linux Mint, Ubuntu) for hashcat
Enabling OpenCL for NVIDIA
Start with a full system update and then reboot:
Code:
sudo apt update && sudo apt full-upgrade -y
reboot
After we have updated the system, we need to check the nouveau kernel modules (free Nvidia drivers, they will conflict with the proprietary ones)
Code:
lsmod | grep -i nouveau
If the previous command output at least something, for example:
Code:
nouveau 1499136 1
mxm_wmi 16384 1 nouveau
wmi 16384 2 mxm_wmi, nouveau
video 40960 1 nouveau
this means they are on. Therefore, you need to add them to the blacklist:
Code:
echo -e "blacklist nouveau \ noptions nouveau modeset = 0 \ nalias nouveau off" | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
After changing the kernel parameters, we need to update our initramfs and reboot.
Code:
update-initramfs -u && reboot
After rebooting and verifying that the nouveau modules are not loaded, we move on to installing the OpenCL ICD loader, drivers, and the CUDA toolkit.
Code:
sudo apt install -y ocl-icd-libopencl1 nvidia-driver nvidia-cuda-toolkit
During driver installation, the system creates new kernel modules, so another reboot is required.
Checking installed drivers
Now our system should be ready, we need to check that the drivers are loaded correctly. We can quickly verify this by running the nvidia-smi tool.
Code:
nvidia-smi

The conclusion shows that our driver and GPU are in order - you can start cracking passwords. Before continuing, let's check again and make sure hashcat and CUDA work together.
Code:
hashcat -I
Note:
If you get an error clGetDeviceIDs (): CL_DEVICE_NOT_FOUND marked Platform ID Vendor: Mesa, then run:
Code:
sudo apt remove mesa-opencl-icd
Let's continue by running a performance test. Benchmark
Code:
hashcat -b -D 1,2 --force
Enabling OpenCL for Intel
If your CPU supports OpenCL, then install the following packages:
Code:
sudo apt install firmware-misc-nonfree intel-opencl-icd
Let's look at the list of devices again (a new device should be added):
Code:
hashcat -I

And let's run the benchmark again:
Code:
hashcat -b -D 1,2 --force


How to enable OpenCL on Arch Linux (BlackArch) for hashcat
Enabling OpenCL for NVIDIA
Remove xf86-video-nouveau there it is:
Code:
sudo pacman -R xf86-video-nouveau
Install the proprietary NVIDIA driver:
Code:
sudo pacman -S nvidia nvidia-utils
Install the CUDA driver and other required packages as well as hashcat:
Code:
sudo pacman -S opencl-nvidia opencl-headers cuda hashcat
Enabling OpenCL for Intel
Code:
sudo pacman -S linux-firmware intel-compute-runtime pocl
Now let's check the list of devices:
Code:
hashcat -I

Let's run the benchmark:
Code:
hashcat -b -D 1,2 --force


Beignet package
beignet is an OpenCL implementation for Intel IvyBridge and Haswell iGPUs. This package is currently deprecated and should be replaced by intel-compute-runtime. Install beignet on my system, then an additional OpenCL device appears - like on Kali Linux, where 3 OpenCL devices are also visible. But this device is unstable with Hashcat.
You can test how beignet behaves on your system. This is probably the only option for older processors.
OpenCL for AMD
If you are the owner of an AMD card, please share your experience of installing an AMD driver with OpenCL support. Write your commands for installation in the comments - and I will add a new section to the article. If possible, take screenshots and / or benchmarks.