Vast.ai - Using GPU and CPU at same time!
#1
When I am running hashcat on my computer, I can use my GPU and CPU the same time. The CPU looks like to add 10% to 15% more power.

But when I try it in the site vast.ai, using the best GPU, the world ever made, like RTX 3090 or RTX 4090, I can't use the CPU.

I assume the power the CPU can give is really small compared to the GPU. And hashcat make the decision to not use it.. But... If it even add 1% more, the price I will pay in the end will be the same for me (you can say someone will spend more electric energy because it).

Is this a kind of Tragedy of the commons? If it uses the CPU, the electric bill will be bigger and at the end, the rent price will increase for everyone and what I gain will be a small % of the brute force power? Or I just need to install something?

Why I can't use GPU and CPU at same time in this cases?
Reply
#2
Whether it is faster with the CPU depends on the type of hash you are working on. In most cases, the CPU slows down the GPU. To use the CPU you must have OpenCL installed on your instance.
Reply
#3
(05-01-2023, 05:36 PM)marc1n Wrote: Whether it is faster with the CPU depends on the type of hash you are working on. In most cases, the CPU slows down the GPU. To use the CPU you must have OpenCL installed on your instance.

So... How do I install the OpenCL for CPU? I really tried a lot of things and none worked. 

This is just an random machine I rent. The GPU works fine. It was even a small success to hashcat list the Device #3, but don't worked. 

Show the magic command that will make it works! 

Code:
* Device #3: Outdated POCL OpenCL driver detected!

This OpenCL driver may fail kernel compilation or produce false negatives.
We recommend using a version of POCL >= 1.9
You can use --force to override, but do not report related errors.


The device #2 specifically listed was skipped because it is an alias of device #1

CUDA API (CUDA 12.0)
====================
* Device #1: NVIDIA GeForce RTX 3090, 23997/24259 MB, 82MCU

OpenCL API (OpenCL 3.0 CUDA 12.0.133) - Platform #1 [NVIDIA Corporation]
========================================================================
* Device #2: NVIDIA GeForce RTX 3090, skipped

OpenCL API (OpenCL 1.2 pocl 1.1 None+Asserts, LLVM 6.0.0, SPIR, SLEEF, DISTRO, POCL_DEBUG) - Platform #2 [The pocl project]
===========================================================================================================================
* Device #3: pthread-Intel(R) Xeon(R) CPU E5-2698 v3 @ 2.30GHz, skipped

OS - Version
Code:
cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"

uname -a
Code:
Linux 1edf239bd740 5.15.0-60-generic #66~20.04.1-Ubuntu SMP Wed Jan 25 09:41:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Reply
#4
Device #3: Outdated POCL OpenCL driver detected!

This OpenCL driver may fail kernel compilation or produce false negatives.
We recommend using a version of POCL >= 1.9
Reply
#5
(05-11-2023, 08:23 AM)marc1n Wrote: Device #3: Outdated POCL OpenCL driver detected!

This OpenCL driver may fail kernel compilation or produce false negatives.
We recommend using a version of POCL >= 1.9

Hahahaha... Obvious I read it! But I didn't know how to solve it. Is there a tutorial of how install opencl in linux for CPU?
Reply
#6
(05-11-2023, 04:31 AM)rodrigo.Brasil Wrote: Show the magic command that will make it works! 

Tested in WSL2 with 20.04 Focal Fossa.
First, remove previous old POCL 1.4 OCD

Code:
sudo apt remove pocl-opencl-icd

Then, install necessary dependencies and packages. Set LLVM to version 12 (latest available in apt search)

Code:
export LLVM_VERSION=12
sudo apt-get install -y python3-dev libpython3-dev build-essential ocl-icd-libopencl1 \
    cmake git pkg-config libclang-${LLVM_VERSION}-dev clang \
    llvm-${LLVM_VERSION} make ninja-build ocl-icd-libopencl1 ocl-icd-dev \
    ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils \
    libxml2-dev libclang-cpp${LLVM_VERSION}-dev libclang-cpp${LLVM_VERSION} \
    llvm-${LLVM_VERSION}-dev \
    clang-12 git

Clone the POCL from github

Code:
cd ~
git clone https://github.com/pocl/pocl/

Ready to build cmake

Code:
cd ~/pocl
mkdir build && cd build
cmake ..
make
sudo make install

Copy over  ICD to /etc/OpenCL/vendors
Code:
sudo cp /usr/local/etc/OpenCL/vendors/pocl.icd /etc/OpenCL/vendors/pocl.icd

See the result
Code:
clinfo


Example:
Code:
CUDA API (CUDA 12.2)
====================
* Device #1: NVIDIA GeForce GTX 1660 SUPER, 5148/6143 MB, 22MCU

OpenCL API (OpenCL 3.0 PoCL 4.1-pre main-0-ga3e43d58  Linux, Debug+Asserts, RELOC, SPIR, LLVM 12.0.0, SLEEF, POCL_DEBUG) - Platform #1 [The pocl project]
=========================================================================================================================================================
* Device #2: cpu-Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 5046/10156 MB (2048 MB allocatable), 8MCU

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

-------------------------------------------------------------
* Hash-Mode 22000 (WPA-PBKDF2-PMKID+EAPOL) [Iterations: 4095]
-------------------------------------------------------------

Speed.#1.........:  228.4 kH/s (96.15ms) @ Accel:16 Loops:1024 Thr:256 Vec:1
Speed.#2.........:    8050 H/s (76.09ms) @ Accel:1024 Loops:512 Thr:1 Vec:8
Speed.#*.........:  236.5 kH/s

Started: Wed Jun 21 17:27:38 2023
Stopped: Wed Jun 21 17:28:25 2023

Reference:
1. https://github.com/pocl/pocl/
2. https://hashcat.net/forum/thread-9601.ht...tel+opencl
Many thanks to @chuckity . Couldn't have get pocl to work if he didn't pointed out to copy over the ICD file.
Reply