1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-07 15:18:15 +00:00
hashcat/tunings
Jens Steube c87a87f992 Improvements to SCRYPT autotuning strategy
General:

The logic for calculating the SCRYPT workload has been moved
from module_extra_buffer_size() to module_extra_tuningdb_block().
Previously, this function just returned values from a static
tuning file. Now, it actually computes tuning values on the fly
based on the device's resources and SCRYPT parameters. This
was always possible, it just wasn't used that way until now.

After running the calculation, the calculated kernel_accel value
is injected into the tuning database as if it had come from a
file. The tmto value is stored internally.

Users can still override kernel-threads, kernel-accel, and
scrypt-tmto via the command line or via tuningdb file.

module_extra_tuningdb_block():

This is now where kernel_accel and tmto are automatically
calculated.

The logic for accel and tmto is now separated and more
flexible. Whether the user is using defaults, tuningdb entries, or
manual command line overrides, the code logic will try to make
smart choices based on what's actually available on the device.

First, it tries to find a kernel_accel value that fits into
available memory. It starts with a base value and simulates
tmto=1 or 2 (which is typical good on GPU).

It also leaves room for other buffers (like pws[], tmps[], etc.).
If the result is close to the actual processor count,
it gets clamped.

This value is then added to the tuning database, so hashcat can pick
it up during startup.

Once that's set, it derives tmto using available memory, thread
count, and the actual SCRYPT parameters.

module_extra_buffer_size():

This function now just returns the size of the SCRYPT B[] buffer,
based on the tmto that was already calculated.

kernel_threads:

Defaults are now set to 32 threads in most cases. On AMD GPUs,
64 threads might give a slight performance bump, but 32 is more
consistent and reliable.

For very memory-heavy algorithms (like Ethereum Wallet), it
scales down the thread count.

Here's a rough reference for other SCRYPT-based modes:

- 64 MiB: 16 threads
- 256 MiB: 4 threads

Tuning files:

All built-in tuningdb entries have been removed, because they
shouldn’t be needed anymore. But you can still add custom entries
if needed. There’s even a commented-out example in the tuningdb
file for mode 22700.

Free memory handling:

Getting the actual amount of free GPU memory is critical for
this to work right. Unfortunately, none of the common GPGPU APIs
give reliable numbers. We now query low-level interfaces like
SYSFS (AMD) and NVML (NVIDIA). Support for those APIs is in
place already, except for ADL, which still needs to be added.

Because of this, hwmon support (which handles those low-level
queries) can no longer be disabled.
2025-06-09 11:02:34 +02:00
..
Alias.hctune typo fix 2023-11-20 10:06:12 +02:00
Device_GeForce_GTX_TITAN.hctune Added tunings/ folder in order to replace hashcat.hctune. Configuration files with *.hctune suffix are automatically load on startup 2022-08-08 11:09:04 +00:00
Module_08900.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_09300.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_15700.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_22700.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_24000.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_27700.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_28200.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Module_29800.hctune Improvements to SCRYPT autotuning strategy 2025-06-09 11:02:34 +02:00
Modules_bcrypt.hctune Add missing hash-modes 9000 and 18600 to tunings/Modules_bcrypt.hctune 2023-03-17 20:18:56 +00:00
Modules_default.hctune Add -m 99999 to Modules_default.hctune 2023-08-14 02:12:02 +01:00
README.md Add several missing GPUs to ALIAS.hctune 2023-04-06 13:30:00 -05:00

The files in this folder are used to override autotune settings

You can override configuration settings for Vector-Width, Kernel-Accel and/or Kernel-Loops values You can filter by Device-Name, Device-Name alias, Attack-Mode and/or Hash-Type

Each file in this folder with the filename suffix .hctune will be automatically loaded by hashcat on startup with random order

  • A valid line consists of the following fields (in that order):
    • Device-Name
    • Attack-Mode
    • Hash-Type
    • Vector-Width
    • Kernel-Accel
    • Kernel-Loops
  • The first three columns define the filter, the other three is what is assigned when that filter matches
  • If no filter matches, autotune is used
  • Columns are separated with one or many spaces or tabs
  • A line can not start with a space or a tab
  • Comment lines are allowed, use a # as first character
  • Invalid lines are ignored
  • The Device-Name is the OpenCL Device-Name. It's shown on hashcat startup.
    • If the device contains spaces, replace all spaces with _ character.
    • Device Names prefixed with 'NVIDIA' will be matched with or without 'NVIDIA' present in the alias. e.g. 'NVIDIA_Tesla_T4' vs 'Tesla_T4'
  • The Device-Name can be assigned an alias. This is useful if many devices share the same chip
    • If you assign an alias, make sure to not use the devices name directly
  • There's also a hard-wired Device-Name which matches all device types called:
    • DEVICE_TYPE_CPU
    • DEVICE_TYPE_GPU
    • DEVICE_TYPE_ACCELERATOR
  • The use of wildcards is allowed, some rules:
    • Wildcards can only replace an entire Device-Name, not parts just of it. eg: not Geforce_*
    • The policy is local > global, means the closer you configure something, the more likely it is selected
    • The policy testing order is from left to right
  • Attack modes can be:
    • 0 = Dictionary-Attack
    • 1 = Combinator-Attack, will also be used for attack-mode 6 and 7 since they share the same kernel
    • 3 = Mask-Attack
  • The Kernel-Accel is a multiplier to OpenCL's concept of a workitem, not the workitem count
  • The Kernel-Loops has a functionality depending on the hash-type:
    • Slow Hash: Number of iterations calculated per workitem
    • Fast Hash: Number of mutations calculated per workitem
  • None of both should be confused with the OpenCL concept of a "thread", this one is maintained automatically
  • The Vector-Width can have only the values 1, 2, 4, 8 or 'N', where 'N' stands for native, which is an OpenCl-queried data value
  • The Kernel-Accel is limited to 1024
  • The Kernel-Loops is limited to 1024
  • The Kernel-Accel can have 'A', where 'A' stands for autotune
  • The Kernel-Accel can have 'M', where 'M' stands for maximum possible
  • The Kernel-Loops can have 'A', where 'A' stands for autotune
  • The Kernel-Loops can have 'M', where 'M' stands for maximum possible