View Issue Details

IDProjectCategoryView StatusLast Update
0003432Kali LinuxKali Package Bugpublic2018-01-29 12:53
Reporterfantomaster Assigned Torhertzog  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionsuspended 
Product Version2016.1 
Summary0003432: hashcat v3.00 error
Description

hashcat v3.00 returns an error when attempting to crack a hash. I've been able to reproduce this on both a VM and physical box, different attack methods, and different hashed

Steps To Reproduce

apt-cache policy hashcat

hashcat:
Installed: 2.00-0kali3
Candidate: 3.00-3
Version table:
3.00-3 500
500 http://http.kali.org/kali kali-rolling/main amd64 Packages
*** 2.00-0kali3 100
100 /var/lib/dpkg/status

echo -n foobar |md5sum |sed 's/ .*//' |tee md5.hash

3858f62230ac3c915f300c664312c63f

hashcat -a3 -m0 --quiet md5.hash foobar

3858f62230ac3c915f300c664312c63f:foobar

apt install --only-upgrade hashcat -y -qqq

apt-cache policy hashcat

hashcat:
Installed: 3.00-3
Candidate: 3.00-3
Version table:
*** 3.00-3 500
500 http://http.kali.org/kali kali-rolling/main amd64 Packages
100 /var/lib/dpkg/status

hashcat -a3 -m0 --quiet md5.hash foobar

ERROR: clGetDeviceIDs() : -1 : CL_DEVICE_NOT_FOUND

Additional Information

https://hashcat.net/wiki/doku.php?id=troubleshooting_clgetdeviceids_-1

Activities

rhertzog

rhertzog

2016-07-20 08:52

administrator   ~0005557

Do you have mesa-opencl-icd installed or some other OpenCL implementation?

Does the OpenCL implementation that you have match your hardware? From here it looks like a problem with your OpenCL setup more than a problem in hashcat.

That said I can reproduce the problem and I don't know what would have to be done to have a working OpenCL setup that can be used by hashcat...

fantomaster

fantomaster

2016-07-20 09:01

reporter   ~0005558

mesa-opencl-icd is installed. Both installations I tested (physical and VM) are fairly new installations and I haven't made any alterations to the system.

apt-cache policy mesa-opencl-icd

mesa-opencl-icd:
Installed: 11.2.2-1
Candidate: 11.2.2-1
Version table:
*** 11.2.2-1 500
500 http://http.kali.org/kali kali-rolling/main amd64 Packages
100 /var/lib/dpkg/status

rhertzog

rhertzog

2016-07-20 09:10

administrator   ~0005559

https://hashcat.net/hashcat/ mentions GPU requirements that can't always be fulfilled with freely available packages.

For Intel GPUs, we have beignet-opencl-icd version 1.1.2 but that doesn't match the "Intel users require Intel OpenCL Runtime 14.2 or later (recommended 16.2 or later)". So you need to setup your own OpenCL

For AMD GPUs, the fglrx-driver was providing the OpenCL implementation, but that package is gone from Debian/Kali as upstream is not keeping up with Xorg releases...

For Nvidia GPUs, we have nvidia-opencl-icd version 352.79-10 matching the requirements of hashcat: "NVidia users require NVidia drivers 346.59 or later (recommended 367.27 or later)"

That said, further down the page, it says this:
Supported OpenCL runtimes

AMD
Apple
Intel
Mesa (Gallium)
NVidia
pocl

So it should really work with the basic "mesa-opencl-icd" as well. Not sure what's wrong.

dookie

dookie

2016-07-20 20:13

reporter   ~0005563

After installing beignet-opencl-icd, we're given a much more verbose error (see below), although I'm not if it's of any use. I also did a fresh checkout of their repo and built it but I'm still getting the same errors.

root@kali:~# hashcat -b
hashcat (v3.00) starting in benchmark-mode...

DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)

ERROR: clGetDeviceIDs() : -1 : CL_DEVICE_NOT_FOUND

dookie

dookie

2016-07-20 21:46

reporter   ~0005564

To summarize what I've looked at so far, here are the things that don't work:

  • Kali package (with beignet and mesa)
  • Running "export DISPLAY=:0" first
  • 3.00 binaries from hashcat.net
  • 3.00 built from source
  • 3.00-beta built from source
  • beignet-opencl-icd_1.1.2-4 from sid
  • mesa-opencl-icd_12.0.1-3 from experimental

root@kali:~# clinfo
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
Number of platforms 2
Platform Name Intel Gen OCL Driver
Platform Vendor Intel
Platform Version OpenCL 1.2 beignet 1.1.2
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_spir cl_khr_icd
Platform Extensions function suffix Intel
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)

Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 MESA 11.2.2
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA

Platform Name Intel Gen OCL Driver
Number of devices 0

Platform Name Clover
Number of devices 0

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Intel Gen OCL Driver
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) <error: 0 devices, multiple matching platforms!>
clCreateContext(NULL, ...) [default] No devices found in platform
clCreateContext(NULL, ...) [other] <error: no devices in non-default plaforms>
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No devices found in platform

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.9
ICD loader Profile OpenCL 2.1

dookie

dookie

2016-07-21 07:03

reporter   ~0005567

This issue is not limited to Kali. I get the same issue with Debian:

dookie@debian:~/hashcat-3.00$ ./hashcat64.bin -b
hashcat (v3.00-1-g67a8d97) starting in benchmark-mode...

ERROR: clGetDeviceIDs() : -1 : CL_DEVICE_NOT_FOUND

dookie@debian:~/hashcat-3.00$ uname -a
Linux debian 3.16.0-4-amd64 0000001 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux
dookie@debian:~/hashcat-3.00$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.5 (jessie)
Release: 8.5
Codename: jessie
dookie@debian:~/hashcat-3.00$

rhertzog

rhertzog

2016-07-21 11:58

administrator   ~0005569

This is not surprising, we use the same packages as Debian for hashcat and for OpenCL related packages.

thefox

thefox

2016-09-11 21:05

reporter   ~0005826

Ok i have come up with a solution. You need the OpenCL Intel runtime. The one i used was http://registrationcenter-download.intel.com/akdlm/irc_nas/9019/opencl_runtime_16.1.1_x64_ubuntu_6.4.0.25.tgz. The main page is https://software.intel.com/en-us/articles/opencl-drivers, Just use the Ubuntu version for Kali, It will say its unsupported but will install anyways. and it works!!

f0xy@f0xy:~$ clinfo
Number of platforms 2
Platform Name Intel(R) OpenCL
Platform Vendor Intel(R) Corporation
Platform Version OpenCL 1.2 LINUX

f0xy@f0xy:~$ hashcat -b
hashcat (v3.10) starting in benchmark-mode...

OpenCL Platform 0000001: Intel(R) Corporation

  • Device 0000001: Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz, 719/2876 MB allocatable, 4MCU
atom

atom

2016-10-07 08:08

reporter   ~0006036

As requested on here: https://twitter.com/raphaelhertzog/status/783921727332085760

Installing OpenCL can be kind of tricky. There's mainly two reasons why:

  • There's multiple different packages with the same purpose and even worse, they are incompatible to each other. It's very important to install only components you really need, otherwise some 3rd party application will use the wrong one and it will not work.
  • OpenCL is used mainly by nieche products. Compared to OpenGL there's not much going on in the GPGPU world. The results is that the software components that build the base OpenCL structure are kind of "new" and instable because with such a small user base there's not much feedback to the developers. If something has a small user base vendors are typically not much motivated to put alot of energy into it. That's why we often see so many bugs in mainstream drivers when it comes to OpenCL.

The basic 4 OpenCL components are:

  • OpenCL runtime. This is the device specific (translation) interface. You need to install this runtime for each of the devices you want to use with OpenCL.

    • NVidia GPU: Comes as part of their driver. This is the most easy installation.
    • AMD CPU and GPU: Bundled as part of their driver till version 15.12. After that, when they started with amd-gpu-pro driver, it's only the GPU runtime. Unfortionally they do not provide some standalone CPU installer but we can use pocl (see later).
    • Intel CPU and GPU: Intel has a standalone installer, but note that there's two of them. One for CPU and one for GPU.
  • OpenCL ICD loader. That is some kind of concentrator system and it provides the "libOpenCL.so" that all OpenCL applicates make use of and link to. The OpenCL runtimes register themself to the OpenCL ICD system. That is the stuff in /etc/OpenCL/vendors/. Most of the vendor provide their own OpenCL ICD loader, but we need to make sure not to use any of them. There's that one open-source ICD loader from Khronos themself (the consortium that created OpenCL and OpenGL) which you can find on https://github.com/KhronosGroup/OpenCL-ICD-Loader and you should use only this one. As far as I've tested, all OpenCL runtimes work flawless with that one. Tripple check not to install any other ICD's in parallel.

  • OpenCL SDK. Each provider provides their own SDK, for example CUDA SDK or AMD-APP-SDK. The problem with them is that often also ship with their own, special OpenCL runtime library. This one needs to be compatible with the device' driver, otherwise all kind of weird and hard to debug errors. But in most of the cases SDK are much older than the latest driver, which you usually want to use. Beside this disadvantage they provide no advatage in case you want to use an OpenCL application. The SDK usually contains only the headers you need to compile an OpenCL applicate, but we have a good alternative for this:

  • OpenCL Headers. Same as with the OpenCL ICD loader, there's one open-source OpenCL header provided from Khronos themself which you can find on https://github.com/KhronosGroup/OpenCL-Headers.git and you should use only this one.

There's some additional special things to know:

  • If you are on NVidia you might think you need CUDA. But you don't. Using OpenCL does not require CUDA at all. CUDA is also not better of faster than OpenCL, it has exactly the same performance. NVidia pushes CUDA because it has additional features for developers and make it kind of easy to use compared to OpenCL, but for hashcat we don't need that. So the message here: Don't install anything related to CUDA.

  • Hardware management for AMD and NVidia GPU is something you really want. That's to abort hashcat in case you GPU overheats, control the fans in a way to hold on a specific temperature, detect GPU bios downclocks on temperature thresholds or even enable the powermanagement in a way to get everything out of your device. To get there we have to use some special 3rd party libraries. For NVidia it's the two NVML and xnvctrl and for AMD it's ADL. All of them require you to run X11. That doesn't mean neccessarily to be logged in into a X11 session, but you need to have access control over it. That means if you want to use hashcat via SSH you need to connect to the X11 session via export DISPLAY=:0 (hashcat automatically set that for your), but your X11 server needs to have either ACL disabled or ideally limited to your local host. If you run hashcat from within an X11 session, no extra permissions are needed. However, for NV, if you want to use power management modes, you need to run as root (driver limitation), but this doesn't have much effect on most devices. There's a small section on how to handle XDM on here: https://hashcat.net/wiki/doku.php?id=linux_server_howto#installing_a_minimal_x11_environment This provides a way to enable hardware management from SSH.

  • There's some alternative 3rd party, general device OpenCL runtimes like pocl and MESA. Both of them are extremely unstable and not ready for real cracking. Reason here is the same as above. The small user base does not provide enough feedback and motivation back to the developers. We can only hope this will change in the future, but for now don't use them.

  • Some good OpenCL overview: https://wiki.tiker.net/OpenCLHowTo

As a conclusion, kalilinux should do the following:

  • Let the user choose only Khronos' OpenCL ICD
  • Provide the Khronos' OpenCL header as a package
  • For NV, you can use modern driver you want, they all work pretty good.
  • For AMD, the best driver is 15.12, but this one is not compatible to latest GPU series. There maybe no way around amd-gpu-pro for an RX480 for example.
  • For Intel CPU, there's a special OpenCL runtime called "OpenCL™ Runtime for Intel® Core™ and Intel® Xeon® Processors". This is the only thing you want.
  • For Intel GPU, there's also a special OpenCL runtime called "OpenCL™ 2.0 Driver+Runtime for Intel® HD, Iris™, and Iris™ Pro Graphics for Linux* (64-bit)". This one is known as unstable but there's no alternative to it.
  • Drop CUDA SDK, AMD-APP-SDK, Intel OpenCL SDK Studio
  • Drop anything related to CUDA
  • Drop OSS nvidia driver
  • Drop MESA/clover OpenCL
  • With drop i mean remove it as a package, so that the user can not falsly select it which then leads to an incompatibility.
  • Install pocl only if there's no alternative (that is if the user has an AMD CPU)
  • Add packages for ADL and NVML and xnvctrl for hardware management.
  • Drop hashcat v2.xx packages
  • Drop oclHashcat v2.xx packages
  • Build hashcat v3.10 package from github
rhertzog

rhertzog

2016-10-11 08:39

administrator   ~0006045

Last edited: 2016-10-11 08:51

Thanks atom for your feedback. But it's hard to translate your comments into any concrete packaging improvement. First of, let me state that we have hashcat v3.10 in kali-rolling and that we strive to keep it relatively up-to-date.

The hashcat package depends on an OpenCL runtime but it cannot depend on the right one for the user's specific hardware, so it depends by default on what seemed like the most generic one and accept that the user installs another one and drop that one by using this dependency “mesa-opencl-icd | opencl-icd”. The other OpenCL runtimes that are available in Debian/Kali are the following:
https://packages.debian.org/sid/mesa-opencl-icd (generic)
https://packages.debian.org/sid/pocl-opencl-icd (generic)
https://packages.debian.org/sid/beignet-opencl-icd (intel)
https://packages.debian.org/sid/nvidia-opencl-icd (nvidia)

The AMD one used to be available but fglrx-driver not being compatible with latest Xorg releases, it got dropped...
https://packages.debian.org/amd-opencl-icd (AMD)

The OpenCL ICD loader gets installed through the the "libopencl1" dependency and by default we have ocl-icd-libopencl1:
https://packages.debian.org/sid/ocl-icd-libopencl1

The only other alternative available in Debian/Kali is the one of NVidia:
https://packages.debian.org/sid/nvidia-libopencl1

A few questions for you:

  • you state that we should use the Kronos OpenCL ICD Loader, is ocl-icd-libopencl1 the correct one? If not, what's the problem with that one which is available in Debian and described as the reference implementation in https://wiki.tiker.net/OpenCLHowTo#Debian ?

  • Can you include all your latest recommendations in some README file in the hashcat repository?

  • You state that we should only install what's needed for the current hardware. But is there any harm to install all the available runtime and let hashcat figure out which one is actually working?

  • You state that the pocl/MESA runtimes are unstable... but can they at least work even if unreliable? Because I have the feeling that they are not even considered which obviously does not help those projects to mature.

Output of clinfo with only mesa-opencl-icd installed:

clinfo

Number of platforms 1
Platform Name Clover
Platform Vendor Mesa
Platform Version OpenCL 1.1 Mesa 12.0.3
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix MESA

Platform Name Clover
Number of devices 0

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Clover
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Clover
clCreateContext(NULL, ...) [default] No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No devices found in platform

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.9
ICD loader Profile OpenCL 2.1

Output of clinfo with only pocl-opencl-icd loaded:

clinfo

Number of platforms 1
Platform Name Portable Computing Language
Platform Vendor The pocl project
Platform Version OpenCL 2.0 pocl 0.13, LLVM 3.8.1
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd
Platform Extensions function suffix POCL

Platform Name Portable Computing Language
Number of devices 1
Device Name pthread-Intel Xeon E312xx (Sandy Bridge)
Device Vendor GenuineIntel
Device Vendor ID 0x6c636f70
Device Version OpenCL 2.0 pocl
Driver Version 0.13
Device OpenCL C Version OpenCL C 2.0
Device Type CPU, Default
Device Profile FULL_PROFILE
Max compute units 1
Max clock frequency 2893MHz
Device Partition (core)
Max number of sub-devices 1
Supported partition types equally, by counts
Max work item dimensions 3
Max work item sizes 4096x4096x4096
Max work group size 4096
Preferred work group size multiple 8
Preferred / native vector sizes
char 16 / 16
short 8 / 8
int 4 / 4
long 2 / 2
half 8 / 8 (n/a)
float 4 / 4
double 2 / 2 (cl_khr_fp64)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (cl_khr_fp64)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Address bits 64, Little-Endian
Global memory size 1576510464 (1.468GiB)
Error Correction support No
Max memory allocation 1576510464 (1.468GiB)
Unified memory for Host and Device Yes
Shared Virtual Memory (SVM) capabilities (core)
Coarse-grained buffer sharing Yes
Fine-grained buffer sharing Yes
Fine-grained system sharing No
Atomics Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Preferred alignment for atomics
SVM 0 bytes
Global 0 bytes
Local 0 bytes
Max size for global variable 0
Preferred total size of global vars 0
Global Memory cache type Read/Write
Global Memory cache size 32768
Global Memory cache line 64 bytes
Image support Yes
Max number of samplers per kernel 16
Max size for 1D images from buffer 98531904 pixels
Max 1D or 2D image array size 2048 images
Max 2D image size 8192x8192 pixels
Max 3D image size 2048x2048x2048 pixels
Max number of read image args 128
Max number of write image args 128
Max number of read/write image args <printDeviceInfo:106: get CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS : error -30>
Max number of pipe args 16
Max active pipe reservations 1
Max pipe packet size 1024
Local memory type Global
Local memory size 1576510464 (1.468GiB)
Max constant buffer size 1576510464 (1.468GiB)
Max number of constant args 8
Max size of kernel argument 1024
Queue properties (on host)
Out-of-order execution No
Profiling Yes
Queue properties (on device)
Out-of-order execution Yes
Profiling Yes
Preferred size 16384 (16KiB)
Max size 262144 (256KiB)
Max queues on device 1
Max events on device 1024
Prefer user sync for interop Yes
Profiling timer resolution 1ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels Yes
SPIR versions 1.2
printf() buffer size 1048576 (1024KiB)
Built-in kernels
Device Available Yes
Compiler Available Yes
Linker Available Yes
Device Extensions cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir cl_khr_int64 cl_khr_fp64 cl_khr_int64_base_atomics cl_khr_int64_extended_atomics

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Portable Computing Language
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [POCL]
clCreateContext(NULL, ...) [default] Success [POCL]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) Success (1)
Platform Name Portable Computing Language
Device Name pthread-Intel Xeon E312xx (Sandy Bridge)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Portable Computing Language
Device Name pthread-Intel Xeon E312xx (Sandy Bridge)

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.9
ICD loader Profile OpenCL 2.1

=> looks pocl-opencl-icd is doing better than the mesa one on my KVM test VM.

The beignet-opencl-icd fails with multiple error messages due to lack of Intel GPU:

clinfo

DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [12]
param: 4, val: 0
Number of platforms 1
Platform Name Intel Gen OCL Driver
Platform Vendor Intel
Platform Version OpenCL 1.2 beignet 1.2
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation cl_intel_subgroups
Platform Extensions function suffix Intel
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [12]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)

Platform Name Intel Gen OCL Driver
Number of devices 0

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Intel Gen OCL Driver
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [12]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Intel Gen OCL Driver
clCreateContext(NULL, ...) [default] No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [12]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [12]
param: 4, val: 0
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware
(If you have multiple ICDs installed and OpenCL works, you can ignore this message)
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) No devices found in platform

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.9
ICD loader Profile OpenCL 2.1

I can't test on NVidia (no such hardware). Testing beignet-opencl-icd on a real Intel machine seems to work partly, at least clinfo provides lots of data but the "hashcat -b" call ends up in a beignet one.
$ clinfo
Number of platforms 1
Platform Name Intel Gen OCL Driver
Platform Vendor Intel
Platform Version OpenCL 1.2 beignet 1.2
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation cl_intel_subgroups
Platform Extensions function suffix Intel

Platform Name Intel Gen OCL Driver
Number of devices 1
Device Name Intel(R) HD Graphics IvyBridge M GT2
Device Vendor Intel
Device Vendor ID 0x8086
Device Version OpenCL 1.2 beignet 1.2
Driver Version 1.2
Device OpenCL C Version OpenCL C 1.2 beignet 1.2
Device Type GPU
Device Profile FULL_PROFILE
Max compute units 16
Max clock frequency 1000MHz
Device Partition (core)
Max number of sub-devices 1
Supported partition types None, None, None
Max work item dimensions 3
Max work item sizes 512x512x512
Max work group size 512
Preferred work group size multiple 16
Preferred / native vector sizes
char 16 / 8
short 8 / 8
int 4 / 4
long 2 / 2
half 0 / 8 (n/a)
float 4 / 4
double 0 / 2 (n/a)
Half-precision Floating-point support (n/a)
Single-precision Floating-point support (core)
Denormals No
Infinity and NANs Yes
Round to nearest Yes
Round to zero No
Round to infinity No
IEEE754-2008 fused multiply-add No
Support is emulated in software No
Correctly-rounded divide and sqrt operations No
Double-precision Floating-point support (n/a)
Address bits 32, Little-Endian
Global memory size 2147483648 (2GiB)
Error Correction support No
Max memory allocation 1610612736 (1.5GiB)
Unified memory for Host and Device Yes
Minimum alignment for any data type 128 bytes
Alignment of base address 1024 bits (128 bytes)
Global Memory cache type Read/Write
Global Memory cache size 8192
Global Memory cache line 64 bytes
Image support Yes
Max number of samplers per kernel 16
Max size for 1D images from buffer 65536 pixels
Max 1D or 2D image array size 2048 images
Base address alignment for 2D image buffers 4096 bytes
Pitch alignment for 2D image buffers 1 bytes
Max 2D image size 8192x8192 pixels
Max 3D image size 8192x8192x2048 pixels
Max number of read image args 128
Max number of write image args 8
Local memory type Global
Local memory size 65536 (64KiB)
Max constant buffer size 134217728 (128MiB)
Max number of constant args 8
Max size of kernel argument 1024
Queue properties
Out-of-order execution No
Profiling Yes
Prefer user sync for interop Yes
Profiling timer resolution 80ns
Execution capabilities
Run OpenCL kernels Yes
Run native kernels Yes
SPIR versions 1.2
printf() buffer size 1048576 (1024KiB)
Built-in kernels cl_copy_region_align4;__cl_copy_region_align16;cl_cpy_region_unalign_same_offset; cl_copy_region_unalign_dst_offset;__cl_copy_region_unalign_src_offset; cl_copy_buffer_rect;cl_copy_image_1d_to_1d;__cl_copy_image_2d_to_2d; cl_copy_image_3d_to_2d;cl_copy_image_2d_to_3d;__cl_copy_image_3d_to_3d; cl_copy_image_2d_to_buffer;cl_copy_image_3d_to_buffer; __cl_copy_buffer_to_image_2d;cl_copy_buffer_to_image_3d; cl_fill_region_unalign;__cl_fill_region_align2;cl_fill_region_align4; cl_fill_region_align8_2;cl_fill_region_align8_4; cl_fill_region_align8_8;cl_fill_region_align8_16; cl_fill_region_align128;__cl_fill_image_1d;cl_fill_image_1d_array; __cl_fill_image_2d;cl_fill_image_2d_array;cl_fill_image_3d; block_motion_estimate_intel;
Device Available Yes
Compiler Available Yes
Linker Available Yes
Device Extensions cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation cl_intel_subgroups

NULL platform behavior
clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...) Intel Gen OCL Driver
clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...) Success [Intel]
clCreateContext(NULL, ...) [default] Success [Intel]
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU) Success (1)
Platform Name Intel Gen OCL Driver
Device Name Intel(R) HD Graphics IvyBridge M GT2
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM) No devices found in platform
clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL) Success (1)
Platform Name Intel Gen OCL Driver
Device Name Intel(R) HD Graphics IvyBridge M GT2

ICD loader properties
ICD loader Name OpenCL ICD Loader
ICD loader Vendor OCL Icd free software
ICD loader Version 2.2.9
ICD loader Profile OpenCL 2.1
$ hashcat -b
hashcat (v3.10) starting in benchmark-mode...

OpenCL Platform 0000001: Intel

  • Device 0000001: Intel(R) HD Graphics IvyBridge M GT2, 1536/2048 MB allocatable, 16MCU

Hashtype: MD4

Speed.Dev.0000001.: 317.6 MH/s (96.86ms)

Hashtype: MD5

Speed.Dev.0000001.: 205.2 MH/s (93.17ms)

Hashtype: Half MD5

Speed.Dev.0000001.: 132.8 MH/s (98.09ms)

Hashtype: SHA1

Speed.Dev.0000001.: 65315.6 kH/s (97.45ms)

Hashtype: SHA256

Speed.Dev.0000001.: 26587.3 kH/s (94.53ms)

ASSERTION FAILED: !(ctx->getErrCode() == OUT_OF_RANGE_IF_ENDIF && ctx->getIFENDIFFix())
at file /build/beignet-R2keFh/beignet-1.2.0/backend/src/backend/gen_program.cpp, function virtual gbe::Kernel* gbe::GenProgram::compileKernel(const gbe::ir::Unit&, const string&, bool, int), line 224
Trappe pour point d'arrêt et de trace

I note that you make it hard to use the pocl opencl ICD:
$ hashcat -b
hashcat (v3.10) starting in benchmark-mode...

OpenCL Platform 0000001: The pocl project

  • Device 0000001: WARNING: Not a native Intel OpenCL runtime, expect massive speed loss
    You can use --force to override this but do not post error reports if you do so
  • Device #0000001: pthread-Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz, skipped

ERROR: No devices found/left

But with --force I get decent performances (approximately 50% compared to beignet-opencl-icd) so is this really warranted?

rhertzog

rhertzog

2016-10-11 08:48

administrator   ~0006046

BTW, can you provide links to the other special-purpose OpenCL runtime that you mentioned (for AMD and Intel)? Maybe we should consider packaging them in Debian/Kali.

atom

atom

2016-10-15 16:10

reporter   ~0006060

But it's hard to translate your comments into any
concrete packaging improvement.

That's too bad. They way it's currently done is far from being useable. The users usually don't want to struggle in how to install OpenCL correctly. They just want it to work magically out of the box. So they install all packages that include the substring "opencl". That's what breaks it because of the incompatibility of the packages to each other.

The other OpenCL runtimes that are available in Debian/Kali are the following:
https://packages.debian.org/sid/mesa-opencl-icd (generic)
https://packages.debian.org/sid/pocl-opencl-icd (generic)
https://packages.debian.org/sid/beignet-opencl-icd (intel)
https://packages.debian.org/sid/nvidia-opencl-icd (nvidia)

It's important to understand, those are not runtimes. The ICD loader is a layer above the runtimes. In theorey, they should do all the same, because they do not include any vendor specific features.

The OpenCL ICD loader gets installed through the the "libopencl1" dependency and by default we have ocl-icd-libopencl1:
you state that we should use the Kronos OpenCL ICD Loader, is ocl-icd-libopencl1 the correct one? If not, what's the problem with that one which is available in Debian and described as the reference implementation in https://wiki.tiker.net/OpenCLHowTo#Debian ?
BTW, can you provide links to the other special-purpose OpenCL runtime that you mentioned (for AMD and Intel)? Maybe we should consider packaging them in Debian/Kali.

All of those 3 quotes are related basically the same question. And yes, that's the correct one. So the first thing you could do would be to drop the other ICD loader:

  • mesa-opencl-icd (generic)
  • pocl-opencl-icd (generic)
  • beignet-opencl-icd (intel)
  • nvidia-opencl-icd (nvidia)
  • amd-opencl-icd (AMD)

You can't have them installed in parallel anyway as there can be only one libOpenCL.so. However, the latest AMD for example can't handle quotes in the clBuild..() parameters, which then breaks compiling OpenCL kernel on paths with a space in installation folder.

Can you include all your latest recommendations in some README file in the hashcat repository?

I could, but hashcat is just using OpenCL, not installing it. It's the wrong place to keep this. Also, those stuff changes very fast because each vendor, whenever he releases a new driver, could have changed something related to OpenCL. That happens almost all the time for AMD drivers and often for NV drivers. Anyway we should update our hashcat-on-server-install wiki page as it's still refering to Ubuntu server 14.04 while it runs pretty good on Ubuntu server 16.04. You can find it here: https://hashcat.net/wiki/doku.php?id=linux_server_howto

You state that we should only install what's needed for the current hardware. But is there any harm to install all the available runtime and let hashcat figure out which one is actually working?

Absolutely. For example if you have an Intel CPU. There's at least 3 OpenCL runtimes supporting this device type, but there's only one that should be used. The Intel one. But the device is supported by pocl and by AMD opencl runtime as well (Yes really, AMD runs Intel CPU). The thing is that they don't handle AVX2 at all, so the performance is only the half compared to the Intel OpenCL runtime. When it comes to high-speed password cracking we typically spend alot of energy to find the ideal solution because no one likes to waste power.

You state that the pocl/MESA runtimes are unstable... but can they at least work even if unreliable? Because I have the feeling that they are not even considered which obviously does not help those projects to mature.

MESA is completely useless. You absolutely need to drop it. pocl is "ok", even if the performance is only half of what's possible with the correct runtime. However even pocl fails to compile on some of the kernels. Just run "hashcat -b" and sooner or later you will hit a kernel that wont compile. Do it again with Intel OpenCL runtime and it will work with full speed and without kernel compiler errors. Even the unit tests will run 100% through.

atom

atom

2016-10-15 16:13

reporter   ~0006061

Note that the beignet opencl runtime is not the Intel opencl runtime I'm talking about. There's multiple different opencl runtime from Intel for their different devices types.

morgan2

morgan2

2016-10-19 13:32

reporter   ~0006062

Tried @atom and @thefox's suggestions on a fresh Kali 2 ISO build on a new VMware installation, intending to get the OpenCL CPU (not GPU) functionality going on an underlying host Intel CPU. Thought I'd present this back in case it's a useful summary to anyone else.

Initial packages:

  • hashcat v3.10
  • ocl-icd-libopencl1
  • mesa-opencl-icd (installed by default as a dependency, not required)

This setup did not work with the beignet package (and beignet must be removed before installing the Intel package).

As suggested by @atom, and as per @thefox's instructions above, I installed the Intel Open CL drivers from: https://software.intel.com/en-us/articles/opencl-drivers.

The specific package was: "OpenCL™ Runtime 16.1.1 for Intel® Core™ and Intel® Xeon® Processors for Ubuntu* (64-bit)". Download the package, extract it and run the install.sh script it contains (skip the warnings about unsupported os and missing lsb-core).

Once this was done, hashcat appears to work correctly (although it is still presenting an error about the mesa package not having compatible devices, and will continue to until it's removed as a dependency, or it is manually removed).

Running hashcat --benchmark returns the following:

hashcat (v3.10) starting in benchmark-mode...

OpenCL Platform 0000001: Mesa, skipped! No OpenCL compatible devices found

OpenCL Platform #2: Intel(R) Corporation

  • Device 0000001: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz, 496/1987 MB allocatable, 1MCU

Hashtype: MD4

Speed.Dev.0000001.: 125.0 MH/s (8.32ms)

etc.

g0tmi1k

g0tmi1k

2018-01-29 12:53

administrator   ~0008249

Due to the age of the OS (Kali Moto [v1], Kali Safi [v2], Kali Rolling 2016.x), these legacy versions are no longer supported.
We will be closing this ticket due to inactivity.

Please could you see if you are able to replicate this issue with the latest version of Kali Linux - https://www.kali.org/downloads/)?

If you are still facing the same problem, feel free to re-open the ticket. If you choose to do this, could you provide more information to the issue you are facing,and also give information about your setup?
For more information, please read: https://kali.training/topic/filing-a-good-bug-report/

Issue History

Date Modified Username Field Change
2016-07-20 07:55 fantomaster New Issue
2016-07-20 08:52 rhertzog Note Added: 0005557
2016-07-20 09:01 fantomaster Note Added: 0005558
2016-07-20 09:10 rhertzog Note Added: 0005559
2016-07-20 20:13 dookie Note Added: 0005563
2016-07-20 21:46 dookie Note Added: 0005564
2016-07-21 07:03 dookie Note Added: 0005567
2016-07-21 11:58 rhertzog Note Added: 0005569
2016-07-21 18:52 rhertzog Assigned To => rhertzog
2016-07-21 18:52 rhertzog Status new => assigned
2016-09-11 21:05 thefox Note Added: 0005826
2016-10-07 08:08 atom Note Added: 0006036
2016-10-11 08:39 rhertzog Note Added: 0006045
2016-10-11 08:40 rhertzog Note Edited: 0006045
2016-10-11 08:41 rhertzog Note Edited: 0006045
2016-10-11 08:44 rhertzog Note Edited: 0006045
2016-10-11 08:48 rhertzog Note Added: 0006046
2016-10-11 08:51 rhertzog Note Edited: 0006045
2016-10-11 08:51 rhertzog Note Edited: 0006045
2016-10-15 16:10 atom Note Added: 0006060
2016-10-15 16:13 atom Note Added: 0006061
2016-10-19 13:32 morgan2 Note Added: 0006062
2018-01-29 12:53 g0tmi1k Status assigned => closed
2018-01-29 12:53 g0tmi1k Resolution open => suspended
2018-01-29 12:53 g0tmi1k Note Added: 0008249