Linux + AMD + hashcat
#1
Exclamation 
Hi,
I just wanted to share the steps that made me able to use hashcat in a linux distro with an amd card
hope this will help someone..

Tested on:
Linux: Ubuntu 18.04
AMD: RX580
hashcat: 5.1.0+1394

Steps:
1. sudo apt-get install ocl-icd-libopencl1 opencl-headers clinfo
2. Install: https://rocm.github.io/install.html (OpenCL-only Installation of ROCm)
3. Reboot
4. apt remove rocm-dkms
5. Reboot
6. Install AMDGPU Driver (./amdgpu-install --opencl=legacy,rocm --headless)
7. Reboot
8. apt remove amdgpu-dkms
9. Reboot


in my case i had problems with the updated dkms which results in a freeze once i type clinfo or use hashcat..
faq:
1. why installed dkms in the first place? idk
2. why too many reboots? idk, maybe just to make sure i'm using the right kernel?

there is many confusions while dealing with amd in linux
https://hashcat.net/faq/wrongdriver was helpful but not much, there was no amdgpu mentioned, without it was unable of running hashcat (maybe bcz pci rejects atomics ?, as that what i was keep getting as a message on dmesg)

.....
Reply
#2
The enormous misunderstanding of AMD is that they really think LINUX is UBUNTU, or CentOS or RHEL:
The ROCm 2.0.x platform supports the following operating systems:
Ubuntu 16.04.x and 18.04.x (Version 16.04.3 and newer or kernels 4.13 and newer)
CentOS 7.4, 7.5, and 7.6 (Using devtoolset-7 runtime support)
RHEL 7.4, 7.5, and 7.6 (Using devtoolset-7 runtime support)
https://rocm.github.io/install.html#supp...-available

So, you're absolutely right: There is many confusions while dealing with AMD on LINUX.
Reply
#3
Hi I tried your method, unfortunately it didn't work. You seem to have a handle on this could you take a look at my post I am really at a loss.
Reply
#4
(10-09-2019, 01:49 AM)Rdgeno Wrote: Hi I tried your method, unfortunately it didn't work. You seem to have a handle on this could you take a look at my post I am really at a loss.

Hi, i'm not sure if you fixed your issue or not;
have you tried the above method on a clean os installation?
also, it would help if you can give more info about your issue and your system specs
Reply
#5
I know this is an old thread but just posting my success story: 

Ubuntu Server Ubuntu 18.04.6 LTS
$sudo apt-get install ocl-icd-libopencl1 opencl-headers clinfo
download and install  amdgpu-install
$ amdgpu-install --usecase=rocm --opencl=legacy,rocr -y
reboot
$ sudo apt remove amdgpu-dkms

now make and make install hashcat from the sources directly, do not use the package binaries.
reboot

Code:
root@hashcat:~# hashcat -b
hashcat (v6.2.5-446-g2e8ba6ba2) starting in benchmark mode

Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.

* Device #1: 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.

/sys/bus/pci/devices/0000:07:00.0/gpu_busy_percent: No such file or directory

/sys/bus/pci/devices/0000:06:00.0/gpu_busy_percent: No such file or directory

/sys/bus/pci/devices/0000:05:00.0/gpu_busy_percent: No such file or directory

/sys/bus/pci/devices/0000:04:00.0/gpu_busy_percent: No such file or directory

/sys/bus/pci/devices/0000:03:00.0/gpu_busy_percent: No such file or directory

/sys/bus/pci/devices/0000:01:00.0/gpu_busy_percent: No such file or directory

OpenCL API (OpenCL 1.2 pocl 1.1 None+Asserts, LLVM 6.0.0, SPIR, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
===========================================================================================================================
* Device #1: pthread-Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz, skipped

OpenCL API (OpenCL 2.1 AMD-APP (3380.4)) - Platform #2 [Advanced Micro Devices, Inc.]
=====================================================================================
* Device #2: AMD Radeon (TM) RX 480 Graphics, 8064/8192 MB (6745 MB allocatable), 36MCU
* Device #3: AMD Radeon (TM) RX 480 Graphics, 8064/8192 MB (6745 MB allocatable), 36MCU
* Device #4: Radeon RX 580 Series, 8064/8192 MB (6745 MB allocatable), 36MCU
* Device #5: Radeon RX 580 Series, 8064/8192 MB (6745 MB allocatable), 36MCU
* Device #6: Radeon RX 580 Series, 8064/8192 MB (6745 MB allocatable), 36MCU
* Device #7: AMD Radeon (TM) RX 470 Graphics, 3968/4096 MB (3264 MB allocatable), 32MCU

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

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

Speed.#2.........:  6658.2 MH/s (43.82ms) @ Accel:128 Loops:256 Thr:256 Vec:1
Speed.#3.........: 12304.9 MH/s (95.40ms) @ Accel:256 Loops:1024 Thr:128 Vec:1
Speed.#4.........: 12303.9 MH/s (96.34ms) @ Accel:128 Loops:1024 Thr:256 Vec:1
Speed.#5.........: 12730.3 MH/s (92.66ms) @ Accel:128 Loops:1024 Thr:256 Vec:1
Speed.#6.........: 12315.1 MH/s (96.20ms) @ Accel:128 Loops:1024 Thr:256 Vec:1
Speed.#7.........: 10481.2 MH/s (49.76ms) @ Accel:256 Loops:512 Thr:128 Vec:1
Speed.#*.........: 66793.5 MH/s

----------------------
* Hash-Mode 100 (SHA1)
----------------------

Speed.#2.........:  2126.1 MH/s (34.09ms) @ Accel:128 Loops:64 Thr:256 Vec:1
Speed.#3.........:  3974.8 MH/s (73.64ms) @ Accel:256 Loops:256 Thr:128 Vec:1
Speed.#4.........:  3983.0 MH/s (74.23ms) @ Accel:512 Loops:256 Thr:64 Vec:1
Speed.#5.........:  4116.1 MH/s (71.67ms) @ Accel:512 Loops:256 Thr:64 Vec:1
Speed.#6.........:  4054.6 MH/s (72.91ms) @ Accel:512 Loops:256 Thr:64 Vec:1
Speed.#7.........:  3448.6 MH/s (76.41ms) @ Accel:128 Loops:1024 Thr:64 Vec:1
Speed.#*.........: 21703.1 MH/s

---------------------------
* Hash-Mode 1400 (SHA2-256)
---------------------------

Speed.#2.........:  911.8 MH/s (81.66ms) @ Accel:64 Loops:512 Thr:64 Vec:1
Speed.#3.........:  1674.0 MH/s (89.03ms) @ Accel:32 Loops:512 Thr:256 Vec:1
Speed.#4.........:  1749.9 MH/s (85.20ms) @ Accel:16 Loops:1024 Thr:256 Vec:1
Speed.#5.........:  1718.4 MH/s (86.67ms) @ Accel:16 Loops:1024 Thr:256 Vec:1
Speed.#6.........:  1744.6 MH/s (85.46ms) @ Accel:16 Loops:1024 Thr:256 Vec:1
Speed.#7.........:  1494.8 MH/s (87.55ms) @ Accel:128 Loops:256 Thr:128 Vec:1
Speed.#*.........:  9293.4 MH/s

---------------------------
* Hash-Mode 1700 (SHA2-512)
---------------------------

Speed.#2.........:  249.9 MH/s (74.47ms) @ Accel:4 Loops:512 Thr:256 Vec:1
Speed.#3.........:  433.3 MH/s (85.21ms) @ Accel:128 Loops:128 Thr:64 Vec:1
Speed.#4.........:  434.9 MH/s (85.76ms) @ Accel:8 Loops:512 Thr:256 Vec:1
Speed.#5.........:  429.5 MH/s (86.82ms) @ Accel:8 Loops:512 Thr:256 Vec:1
Speed.#6.........:  439.6 MH/s (84.77ms) @ Accel:8 Loops:512 Thr:256 Vec:1
Speed.#7.........:  366.9 MH/s (90.30ms) @ Accel:64 Loops:256 Thr:64 Vec:1
Speed.#*.........:  2354.1 MH/s
Reply
#6
Wait until you install a second amd card. There will be new amount of errors.
It's just easier to switch to nvidia(maybe that's intentional, who knows). I sold both my rx580s and bought 2x gtx1080.
Reply