CL_DEVICE_NOT_AVAILABLE on GCP Xeon CPU
#1
Linux newbie here - could you kindly guide me to make hashcat works on GCP e2 instance (2 vCPU, no GPU, OS Debian) - which package should I install ? (i know it will be slow without GPU).
OpenCL seems to be already installed.
Considering error "clCreateContext(): CL_DEVICE_NOT_AVAILABLE"

Code:
:~/hashcat-6.2.5$ ./hashcat.bin -I
hashcat (v6.2.5) starting in backend information mode

clCreateContext(): CL_DEVICE_NOT_AVAILABLE

OpenCL Info:
============
OpenCL Platform ID #1
  Vendor..: Intel(R) Corporation
  Name....: Intel(R) CPU Runtime for OpenCL(TM) Applications
  Version.: OpenCL 2.1 LINUX

  Backend Device ID #1
    Type...........: CPU
    Vendor.ID......: 8
    Vendor.........: Intel(R) Corporation
    Name...........: Intel(R) Xeon(R) CPU @ 2.20GHz
    Version........: OpenCL 2.1 (Build 0)
    Processor(s)...: 2
    Clock..........: 2200
    Memory.Total...: 975 MB (limited to 121 MB allocatable in one block)
    Memory.Free....: 0 MB
    OpenCL.Version.: OpenCL C 2.0
    Driver.Version.: 18.1.0.0920

Code:
:~/hashcat-6.2.5$ ./hashcat.bin -b -m 0
hashcat (v6.2.5) starting in benchmark mode

clCreateContext(): CL_DEVICE_NOT_AVAILABLE

OpenCL API (OpenCL 2.1 LINUX) - Platform #1 [Intel(R) Corporation]
=========================================================
* Device #1: Intel(R) Xeon(R) CPU @ 2.20GHz, skipped

Benchmark relevant options:
===========================
* --optimized-kernel-enable

-------------------
* Hash-Mode 0 (MD5)
-------------------

Started: Wed Jun 15 13:47:52 2022
Stopped: Wed Jun 15 13:48:16 2022

Thanks a lot.
Reply
#2
* Device #1: Intel(R) Xeon(R) CPU @ 2.20GHz, skipped

hahscat is skipping CPU by default

you will need to add option 
Code:
-D1 -d1
to tell hashcat to use CPU
Reply
#3
Thanks, but it gives the same result - skipped :

Code:
$ ./hashcat.bin -D1 -d1 -b -m0
hashcat (v6.2.5) starting in benchmark mode

clCreateContext(): CL_DEVICE_NOT_AVAILABLE

OpenCL API (OpenCL 2.1 LINUX) - Platform #1 [Intel(R) Corporation]
==================================================================
* Device #1: Intel(R) Xeon(R) CPU @ 2.20GHz, skipped

Benchmark relevant options:
===========================
* --backend-devices=1
* --opencl-device-types=1
* --optimized-kernel-enable

-------------------
* Hash-Mode 0 (MD5)
-------------------

Started: Sat Jun 25 11:24:15 2022
Stopped: Sat Jun 25 11:24:18 2022
Reply
#4
Only -D1 not -D1 -d1 Smile
Reply
#5
Same result :

Code:
$ ./hashcat.bin -D 1  -b -m0
hashcat (v6.2.5) starting in benchmark mode

clCreateContext(): CL_DEVICE_NOT_AVAILABLE

OpenCL API (OpenCL 2.1 LINUX) - Platform #1 [Intel(R) Corporation]
==================================================================
* Device #1: Intel(R) Xeon(R) CPU @ 2.20GHz, skipped
Reply
#6
See that you have

Memory.Total...: 975 MB (limited to 121 MB allocatable in one block)
Memory.Free....: 0 MB

your instance has no memory to run...
Reply
#7
Good point.
Code:
$ grep Mem /proc/meminfo
MemTotal:         998768 kB
MemFree:          520656 kB
MemAvailable:     616156 kB

Any hints why hashcat finds MemFree = 0 Mb whereas real MemFree is around 520 Mb ?
Reply
#8
(06-26-2022, 02:03 PM)albert4 Wrote: Good point.
Code:
$ grep Mem /proc/meminfo
MemTotal:        998768 kB
MemFree:          520656 kB
MemAvailable:    616156 kB

Any hints why hashcat finds MemFree = 0 Mb whereas real MemFree is around 520 Mb ?

You can't run everything on 1GB it's not those times Smile You have too little memory as I already wrote...
Reply
#9
didnt spot the memory = 0

i guess this is a small (free) vps?, these virtual machines are not made for loving you baby, i mean hashcat, if you dont have the option to get more ram for free, try using hashcat on your pc at home

@ Marc1n, -D1 -d1 is also right in this context, depending on the settings and driverconfiguration the cpu could be shown more than once, i have a workstation with 2* xeon working, when just using option -D1 (CPU -only)

Code:
hashcat -m0 -b -D1
Speed.#1.........:  905.1 MH/s (51.60ms) @ Accel:1024 Loops:1024 Thr:1 Vec:8
Speed.#2.........:  980.8 MH/s (50.03ms) @ Accel:1024 Loops:1024 Thr:1 Vec:8
Speed.#*.........:  1885.9 MH/s

Code:
hashcat -m0 -b -D1 -d1
Speed.#1.........:  1844.6 MH/s (13.28ms) @ Accel:1024 Loops:512 Thr:1 Vec:8

as you can see, -D1 -d1 sticks to one possibiliy how the CPU is utilized, but same overall speed (i think this is better thna using 2 different ways how hahscat talks to the CPU
Reply