Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate ZLUDA for AMD CUDA brute #3948

Open
GermanAizek opened this issue Feb 13, 2024 · 20 comments
Open

Integrate ZLUDA for AMD CUDA brute #3948

GermanAizek opened this issue Feb 13, 2024 · 20 comments

Comments

@GermanAizek
Copy link

Describe the feature
@Chick3nman, hi
https://github.com/vosen/ZLUDA
it can give higher speed on amd video cards if cuda code is optimized

@Chick3nman
Copy link
Contributor

I saw this, but it doesn't appear that it will work for us out of box. If we are going to try and use it, I suspect that it will take some work to integrate it as another backend.

@mostwanted002
Copy link
Contributor

So far, HIP is working, but performance isn't consistent b/w platforms (Slower on Windows than OpenCL, opposite in Linux)
I am actively looking into ZLUDA with hashcat at the moment.

@T3chC0wb0y
Copy link

HIP is not working on Windows 11 23H2 running a Radeon 7900 xtx

So far, HIP is working, but performance isn't consistent b/w platforms (Slower on Windows than OpenCL, opposite in Linux) I am actively looking into ZLUDA with hashcat at the moment.

@mostwanted002
Copy link
Contributor

It is working. You need to install HIP SDK 5.7 from the AMD ROCm suite.

The PR for the implementation of HIP RTC detection at runtime is yet to be merged with the main branch.

.\hashcat.exe -I
hashcat (v6.2.6-849-g08f6cf7e0+) starting in backend information mode

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

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

HIP Info:
=========

HIP.Version.: 5.7.32000

Backend Device ID #1 (Alias: #3)
  Name...........: AMD Radeon RX 6900 XT
  Processor(s)...: 40
  Clock..........: 2400
  Memory.Total...: 16368 MB
  Memory.Free....: 16240 MB
  Local.Memory...: 64 KB
  PCI.Addr.BDFe..: 0000:0f:00.0

Backend Device ID #2 (Alias: #4)
  Name...........: AMD Radeon RX 6900 XT
  Processor(s)...: 40
  Clock..........: 2255
  Memory.Total...: 16368 MB
  Memory.Free....: 16240 MB
  Local.Memory...: 64 KB
  PCI.Addr.BDFe..: 0000:12:00.0

OpenCL Info:
============

OpenCL Platform ID #1
  Vendor..: Advanced Micro Devices, Inc.
  Name....: AMD Accelerated Parallel Processing
  Version.: OpenCL 2.1 AMD-APP (3608.0)

  Backend Device ID #3 (Alias: #1)
    Type...........: GPU
    Vendor.ID......: 1
    Vendor.........: Advanced Micro Devices, Inc.
    Name...........: AMD Radeon RX 6900 XT
    Version........: OpenCL 2.0 AMD-APP (3608.0)
    Processor(s)...: 40
    Clock..........: 2400
    Memory.Total...: 16368 MB (limited to 13912 MB allocatable in one block)
    Memory.Free....: 16256 MB
    Local.Memory...: 64 KB
    OpenCL.Version.: OpenCL C 2.0
    Driver.Version.: 3608.0 (PAL,LC)
    PCI.Addr.BDF...: 0f:00.0

  Backend Device ID #4 (Alias: #2)
    Type...........: GPU
    Vendor.ID......: 1
    Vendor.........: Advanced Micro Devices, Inc.
    Name...........: AMD Radeon RX 6900 XT
    Version........: OpenCL 2.0 AMD-APP (3608.0)
    Processor(s)...: 40
    Clock..........: 2255
    Memory.Total...: 16368 MB (limited to 13912 MB allocatable in one block)
    Memory.Free....: 16256 MB
    Local.Memory...: 64 KB
    OpenCL.Version.: OpenCL C 2.0
    Driver.Version.: 3608.0 (PAL,LC)
    PCI.Addr.BDF...: 12:00.0

image

@T3chC0wb0y
Copy link

When will this be merged? Even with the HIP SDK installed, this is what I get.

PS C:\Hashcat\hashcat-6.2.6> ./hashcat.exe -I
hashcat (v6.2.6) starting in backend information mode

hiprtcCompileProgram is missing from HIPRTC shared library.

OpenCL Info:

OpenCL Platform ID #1
Vendor..: Advanced Micro Devices, Inc.
Name....: AMD Accelerated Parallel Processing
Version.: OpenCL 2.1 AMD-APP (3608.0)

Backend Device ID #1
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon RX 7900 XTX
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB (limited to 20876 MB allocatable in one block)
Memory.Free....: 24448 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 03:00.0

Backend Device ID #2
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon(TM) Graphics
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB (limited to 4999 MB allocatable in one block)
Memory.Free....: 6080 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 0e:00.0

@mostwanted002
Copy link
Contributor

that is because you're using release binary, which only supports HIP SDK 5.5 for now

@T3chC0wb0y
Copy link

Screenshot 2024-02-22 000810

Same issue with 5.5

Didn't AMD remove the HIP dependency with the drivers that support the 7900 series? If that is the case, and hashcat still requires them, this GPU still won't be recognized after the update...correct?

@mostwanted002
Copy link
Contributor

No. HIP SDK for Windows is separate now (since 5.5) and usually comes with optional PRO drivers.

And for 7900 XTX, the HIP SDK 5.7.1 works as well using the HIP RTC PR branch.

image

@T3chC0wb0y
Copy link

Great! I see all checks have passed. Any idea when it will be merged to the main?

@mostwanted002
Copy link
Contributor

Some issues related to MSYS2 compilation exist, which are rendering AMD GPUs unsupported at run. Apart from that, it's all good to go.

@T3chC0wb0y
Copy link

I merged your changes into my implementation, and it still does not work with HIP 5.7. You can see from the timestamps that I am using your files.

Screenshot 2024-02-22 005601

@T3chC0wb0y
Copy link

I cloned your repo and compiled as per the instructions in the readme. No joy.

MSYS ~/hashcat
$ ./hashcat.exe -I
hashcat (v6.2.6-848-gc1a10518f) starting in backend information mode

hiprtcCompileProgram is missing from HIPRTC shared library.

:1:20: error: invalid operand for instruction
V_ADD_U32 v0, vcc, 0, 0;
^
:1:2: error: instruction not supported on this GPU
V_ADDC_U32 v0, vcc, 0, 0, vcc;
^
:1:2: error: operands are not valid for this GPU or mode
V_ADD_CO_U32 v0, vcc, 0, 0;
^
:1:2: error: instruction not supported on this GPU
V_ADDC_CO_U32 v0, vcc, 0, 0, vcc;
^
:1:20: error: invalid operand for instruction
V_SUB_U32 v0, vcc, 0, 0;
^
:1:2: error: instruction not supported on this GPU
V_SUBB_U32 v0, vcc, 0, 0, vcc;
^
:1:2: error: operands are not valid for this GPU or mode
V_SUB_CO_U32 v0, vcc, 0, 0;
^
:1:2: error: instruction not supported on this GPU
V_SUBB_CO_U32 v0, vcc, 0, 0, vcc;
^
OpenCL Info:

OpenCL Platform ID #1
Vendor..: Advanced Micro Devices, Inc.
Name....: AMD Accelerated Parallel Processing
Version.: OpenCL 2.1 AMD-APP (3608.0)

Backend Device ID #1
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon RX 7900 XTX
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB (limited to 20876 MB allocatable in one block)
Memory.Free....: 24448 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 03:00.0

Backend Device ID #2
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon(TM) Graphics
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB (limited to 4999 MB allocatable in one block)
Memory.Free....: 6080 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 0e:00.0

@mostwanted002
Copy link
Contributor

That is the issue. MSYS2 compilation is broken.

The one I used was cross compiled using mingw64 on Linux.

@T3chC0wb0y
Copy link

I will try two things tomorrow to confirm.

  1. I will compile the latest main branch via MSYS2 and see if the MSYS2 problem pre-exists.

  2. I will compile in Linux WSL and see if I can replicate your results

@mostwanted002
Copy link
Contributor

I have tried the first, but it doesn't work.

@T3chC0wb0y
Copy link

I was able to compile within the Ubuntu WSL, but it still is not working. HIP is installed!

./hashcat.exe -I
hashcat (v6.2.6-848-gc1a10518f) starting in backend information mode

hiprtcCompileProgram is missing from HIPRTC shared library.

Support for HIPRTC was dropped by AMD Adrenalin Edition 22.7.1 and later.
This is not a hashcat problem.

Please install the AMD HIP SDK

OpenCL Info:

OpenCL Platform ID #1
Vendor..: Advanced Micro Devices, Inc.
Name....: AMD Accelerated Parallel Processing
Version.: OpenCL 2.1 AMD-APP (3608.0)

Backend Device ID #1
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon RX 7900 XTX
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB (limited to 20876 MB allocatable in one block)
Memory.Free....: 24448 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 03:00.0

Backend Device ID #2
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon(TM) Graphics
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB (limited to 4999 MB allocatable in one block)
Memory.Free....: 6080 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 0e:00.0

@T3chC0wb0y
Copy link

Screenshot 2024-02-22 172044

@mostwanted002
Copy link
Contributor

Your hashcat reports v6.2.6-848-gc1a10518f vs. my v6.2.6-849-g08f6cf7e0+

Are you sure you checked out the correct branch for the build??

This is the repo you need to clone and then checkout

git clone https://github.com/mostwanted002/hashcat.git
cd hashcat
git checkout hip_rtc_windows_env_implementation
make win

@T3chC0wb0y
Copy link

Ah. I see where the problem was. I failed to perform the checkout. I also followed the install steps in BUILD_WSL.md which was overkill in this instance. Now that I have recompiled with the checkout, it seems to be working. I will try to run some hashes later tonight to ensure that the GPU is invoked.

PS C:\hashcat> ./hashcat.exe -I
hashcat (v6.2.6-850-g992f1c13b) starting in backend information mode

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

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

HIP Info:

HIP.Version.: 5.7.32000

Backend Device ID #1 (Alias: #3)
Name...........: AMD Radeon RX 7900 XTX
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB
Memory.Free....: 24432 MB
Local.Memory...: 64 KB
PCI.Addr.BDFe..: 0000:03:00.0

Backend Device ID #2 (Alias: #4)
Name...........: AMD Radeon(TM) Graphics
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB
Memory.Free....: 12131 MB
Local.Memory...: 64 KB
PCI.Addr.BDFe..: 0000:0e:00.0

OpenCL Info:

OpenCL Platform ID #1
Vendor..: Advanced Micro Devices, Inc.
Name....: AMD Accelerated Parallel Processing
Version.: OpenCL 2.1 AMD-APP (3608.0)

Backend Device ID #3 (Alias: #1)
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon RX 7900 XTX
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB (limited to 20876 MB allocatable in one block)
Memory.Free....: 24448 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 03:00.0

Backend Device ID #4 (Alias: #2)
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon(TM) Graphics
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB (limited to 4999 MB allocatable in one block)
Memory.Free....: 6080 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 0e:00.0

@T3chC0wb0y
Copy link

One more question. Any idea why I can no longer see the CPU?

PS C:\hashcat> ./hashcat.exe -I
hashcat (v6.2.6-850-g992f1c13b) starting in backend information mode

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

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

HIP Info:

HIP.Version.: 5.7.32000

Backend Device ID #1 (Alias: #3)
Name...........: AMD Radeon RX 7900 XTX
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB
Memory.Free....: 24432 MB
Local.Memory...: 64 KB
PCI.Addr.BDFe..: 0000:03:00.0

Backend Device ID #2 (Alias: #4)
Name...........: AMD Radeon(TM) Graphics
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB
Memory.Free....: 12131 MB
Local.Memory...: 64 KB
PCI.Addr.BDFe..: 0000:0e:00.0

OpenCL Info:

OpenCL Platform ID #1
Vendor..: Advanced Micro Devices, Inc.
Name....: AMD Accelerated Parallel Processing
Version.: OpenCL 2.1 AMD-APP (3608.0)

Backend Device ID #3 (Alias: #1)
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon RX 7900 XTX
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 48
Clock..........: 2304
Memory.Total...: 24560 MB (limited to 20876 MB allocatable in one block)
Memory.Free....: 24448 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 03:00.0

Backend Device ID #4 (Alias: #2)
Type...........: GPU
Vendor.ID......: 1
Vendor.........: Advanced Micro Devices, Inc.
Name...........: AMD Radeon(TM) Graphics
Version........: OpenCL 2.0 AMD-APP (3608.0)
Processor(s)...: 1
Clock..........: 2200
Memory.Total...: 12275 MB (limited to 4999 MB allocatable in one block)
Memory.Free....: 6080 MB
Local.Memory...: 64 KB
OpenCL.Version.: OpenCL C 2.0
Driver.Version.: 3608.0 (PAL,LC)
PCI.Addr.BDF...: 0e:00.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants