Choosing specific Metal GPU to use OSX
#1
I have an intel mac with both AMD 5700XT and 6900XT. When trying to run hashcat with Metal drivers I cant specify which GPU to use. It will use all available no matter what I do.

Code:
hashcat -I
hashcat (v6.2.6-54-g13f427ff5+) starting in backend information mode

Metal Info:
===========

Metal.Version.: 263.8

Backend Device ID #1
  Type...........: GPU
  Vendor.ID......: 2
  Vendor.........: Apple
  Name...........: AMD Radeon RX 5700 XT
  Processor(s)...: 1
  Clock..........: N/A
  Memory.Total...: 8176 MB (limited to 3584 MB allocatable in one block)
  Memory.Free....: 8064 MB
  Local.Memory...: 32 KB
  Phys.Location..: connected via an external interface (port 2)
  Feature.Set....: macOS GPU Family 2 v1
  Registry.ID....: 21743
  Max.TX.Rate....: 40000000 MB/sec
  GPU.Properties.: headless 0, low-power 0, removable 1

Backend Device ID #2
  Type...........: GPU
  Vendor.ID......: 2
  Vendor.........: Apple
  Name...........: AMD Radeon RX 6900 XT
  Processor(s)...: 1
  Clock..........: N/A
  Memory.Total...: 16368 MB (limited to 3584 MB allocatable in one block)
  Memory.Free....: 16256 MB
  Local.Memory...: 32 KB
  Phys.Location..: built-in
  Feature.Set....: macOS GPU Family 2 v1
  Registry.ID....: 1733
  Max.TX.Rate....: N/A
  GPU.Properties.: headless 0, low-power 0, removable 0

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

OpenCL Platform ID #1
  Vendor..: Apple
  Name....: Apple
  Version.: OpenCL 1.2 (Aug  8 2022 21:29:33)

  Backend Device ID #3
    Type...........: CPU
    Vendor.ID......: 8
    Vendor.........: Intel
    Name...........: Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz
    Version........: OpenCL 1.2
    Processor(s)...: 20
    Clock..........: 3600
    Memory.Total...: 131072 MB (limited to 16384 MB allocatable in one block)
    Memory.Free....: 65504 MB
    Local.Memory...: 32 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 1.1

  Backend Device ID #4
    Type...........: GPU
    Vendor.ID......: 1
    Vendor.........: AMD
    Name...........: AMD Radeon RX 5700 XT Compute Engine
    Version........: OpenCL 1.2
    Processor(s)...: 40
    Clock..........: 2100
    Memory.Total...: 8176 MB (limited to 2044 MB allocatable in one block)
    Memory.Free....: 8064 MB
    Local.Memory...: 32 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 1.2 (Aug 22 2022 20:25:14)

  Backend Device ID #5
    Type...........: GPU
    Vendor.ID......: 1
    Vendor.........: AMD
    Name...........: AMD Radeon RX 6900 XT Compute Engine
    Version........: OpenCL 1.2
    Processor(s)...: 80
    Clock..........: 2660
    Memory.Total...: 16368 MB (limited to 4092 MB allocatable in one block)
    Memory.Free....: 16256 MB
    Local.Memory...: 32 KB
    OpenCL.Version.: OpenCL C 1.2
    Driver.Version.: 1.2 (Aug 22 2022 20:25:14)


Running this command you can see how the device selection of -D 2 (GPU Selection) -d 2 (6900XT) still lists devices 1 & 2 as being used.

Code:
hashcat -m 22000 /hashfile.22000 -a 3 "?d?d?d?d?d?d?d?d?d?d" -D 2 -d 2 -w 4 -O --status 
hashcat (v6.2.6-54-g13f427ff5+) starting

METAL API (Metal 263.8)
=======================
* Device #1: AMD Radeon RX 5700 XT, 8064/8176 MB, 1MCU
* Device #2: AMD Radeon RX 6900 XT, 16256/16368 MB, 1MCU

OpenCL API (OpenCL 1.2 (Aug  8 2022 21:29:33)) - Platform #1 [Apple]
====================================================================
* Device #3: Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz, skipped
* Device #4: AMD Radeon RX 5700 XT Compute Engine, skipped
* Device #5: AMD Radeon RX 6900 XT Compute Engine, skipped

Kernel /Users/brad/hashcat/OpenCL/m22000-optimized.cl:
Optimized kernel requested, but not available or not required
Falling back to pure kernel

Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63

Hashes: 3 digests; 2 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates

Optimizers applied:
* Zero-Byte
* Single-Salt
* Brute-Force
* Slow-Hash-SIMD-LOOP

Watchdog: Temperature abort trigger set to 100c

Host memory required for this attack: 70 MB


I can run it in OpenCL mode and things work properly but Id prefer Metal.
Code:
hashcat -m 22000 hashfile.22000 -a 3 "?d?d?d?d?d?d?d?d?d?d" -D 2 -d 2 -w 4 -O --backend-ignore-metal --status
hashcat (v6.2.6-54-g13f427ff5+) starting

* Device #2: Apple's OpenCL drivers (GPU) are known to be unreliable.
            You have been warned.

OpenCL API (OpenCL 1.2 (Aug  8 2022 21:29:33)) - Platform #1 [Apple]
====================================================================
* Device #1: Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz, skipped
* Device #2: AMD Radeon RX 5700 XT Compute Engine, 8064/8176 MB (2044 MB allocatable), 40MCU
* Device #3: AMD Radeon RX 6900 XT Compute Engine, skipped

Kernel /Users/brad/hashcat/OpenCL/m22000-optimized.cl:
Optimized kernel requested, but not available or not required
Falling back to pure kernel

Minimum password length supported by kernel: 8
Maximum password length supported by kernel: 63

Hashes: 3 digests; 2 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates

Optimizers applied:
* Zero-Byte
* Single-Salt
* Brute-Force
* Slow-Hash-SIMD-LOOP

Watchdog: Temperature abort trigger set to 100c

Host memory required for this attack: 1470 MB


Any thoughts or suggestions appreciated. Thx
Reply