CPU

All CPU related settings contained in cpu and randomx objects in the config file, CPU backend allow specify multiple profiles and allow switching between them without restrictions by pool request or config change. Default auto-configuration creates a reasonable minimum of profiles which cover all supported algorithms. For example if you like to change threads count for RandomX algorithm you should edit profile rx in cpu object of the config file.

  • rx/wow exact match to rx/wow algorithm, defined 4 threads without CPU affinity.
  • cn default failback profile for all cn/* algorithms, defined 2 threads with CPU affinity, another failback profiles is cn-lite, cn-heavy and rx.
  • cn-pico alternative short object format.
  • custom-profile custom user defined profile.
  • * failback profile for all unhandled by other profiles algorithms.
  • cn/r exact match, alias to profile custom-profile.
  • cn/0 exact match, disabled algorithm.
{
    "cpu": {
        "enabled": true,
        "rx/wow": [-1, -1, -1, -1],
        "cn": [
            [1, 0],
            [1, 2]
        ],
        "cn-lite": [
            [2, 0],
            [2, 2]
        ],
        "cn-pico": {
            "intensity": 2,
            "threads": 8,
            "affinity": -1
        },
        "custom-profile": [0, 2],
        "*": [-1],
        "cn/r": "custom-profile",
        "cn/0": false
    }
}

Threads definition


Threads can be defined in 3 formats.

Array format

[
    [1, 0],
    [1, 2],
    [1, -1],
    [2, -1]
]

Each line represents one thread, the first element is intensity, this option was known as low_power_mode, possible value range from 1 to 5, second element is CPU affinity, special value -1 means no affinity.

Short array format

[-1, -1, -1, -1]

Each number represents one thread and means CPU affinity, this is the default format for algorithms with maximum intensity 1, currently it is all RandomX variants and all Argon2 variants.

Short object format

{
    "intensity": 2,
    "threads": 8,
    "affinity": -1
}

Internal format, but can be user defined.

Shared options


Options below contained in cpu object in the config file.

enabled true (boolean)

Enable or disable CPU mining backend.

huge-pages true (boolean, number)

Enable or disable huge pages support.
On Linux this option also accepts huge page size in kB to use custom huge page sizes if it is supported by hardware. For example "huge-pages": 32768 for 32 MB huge page size. #2076

huge-pages-jit false (boolean)

Enable or disable huge pages support for RandomX JIT code. It gives a very small boost on Ryzen CPUs, but hashrate is unstable between launches. Use with caution. #1876

hw-aes null (boolean, null)

Force enable or disable hardware AES support. Default value null means miner autodetect this feature. Usually you don't need to change this option, this option is useful for some rare cases when XMRig can't detect hardware AES, but it is available. If you force enable this option, but your hardware does not support it, the miner will crash.

priority null (number, null)

Mining threads priority, value from 1 (lowest priority) to 5 (highest possible priority). Default value null means XMRig doesn't change threads priority at all. Setting priority higher than 2 can make your PC unresponsive.

memory-pool false (boolean, number)

Use continuous, persistent memory block for mining threads, useful for preserving huge pages allocation while algorithm switching. Possible values false (feature disabled, by default) or true or specific count of 2 MB huge pages. It helps to avoid loosing huge pages for scratchpads when RandomX dataset is updated and mining threads restart after 2-3 days of mining.

yield true (boolean)

Prefer system better system response/stability true (default value) or maximum hashrate false.

max-threads-hint 100 (number)

This option (was known as max-cpu-usage) is the most confusing option in the miner with many myths and legends. This option is just a hint for automatic configuration and can't precisely define CPU usage.

  • This option has no effect if the miner already generated CPU configuration, to prevent config generation use "autosave":false.
  • Only threads count can be changed, for 1 core CPU this option has no effect, for 2 core CPU only 2 values possible 50% and 100%, for 4 cores: 25%, 50%, 75%, 100%. etc.
  • Your CPU may be limited by other factors, e.g. cache.
asm true (boolean, string)

Enable/configure or disable assembly optimizations. Possible values: true, false, "intel", "ryzen", "bulldozer".

argon2-impl null (string, null)

Allow override automatically detected Argon2 implementation, this option added mostly for debug purposes, default value null means autodetect. This is used in RandomX dataset initialization and also in some other mining algorithms. Other possible values: "x86_64", "SSE2", "SSSE3", "XOP", "AVX2", "AVX-512F". Manual selection has no safeguards - if your CPU doesn't support required instructions, the miner will crash.

Generated profiles


Options below contained in cpu object in the config file.
All these options are generated for current CPU(s) and not portable for systems with different CPU(s). To prevent write generated profiles to config use global option "autosave": false.

argon2 (array)

Generated profile for Argon2 algorithms.

cn (array)

Generated profile for all CryptoNight algorithms with 2 MB scratchpad size.

cn-heavy (array)

Generated profile for all CryptoNight-Heavy algorithms with 4 MB scratchpad size.

cn-lite (array)

Generated profile for all CryptoNight-Lite algorithms with 1 MB scratchpad size.

cn-pico (array)

Generated profile for all CryptoNight-Pico algorithms with 256 KB scratchpad size.

rx (array)

Generated profile for all RandomX algorithms with 2 MB scratchpad size.

rx/wow (array)

Generated profile for RandomWOW algorithm and also used for other RandomX algorithms with less than 2 MB scratchpad size.

cn/0 false (boolean)

Original CryptoNight algorithm disabled by default.

cn-lite/0 false (boolean)

Original CryptoNight-Lite algorithm disabled by default.

rx/arq "rx/wow" (string)

RandomARQ usually uses alias to rx/wow profile.

rx/keva "rx/wow" (string)

RandomKEVA usually uses alias to rx/wow profile.

RandomX options


Options below contained in randomx object in the config file.

init -1 (number)

Thread count to initialize RandomX dataset. Auto-detect (-1) or number of threads.

init-avx2 -1 (number)

Use AVX2 for dataset initialization. Faster on some CPUs. Auto-detect (-1), disabled (0), always enabled on CPUs that support AVX2 (1).

mode "auto" (string)

RandomX mining mode: "auto", "fast" (2 GB memory), "light" (256 MB memory).

1gb-pages false (boolean)

Use 1GB hugepages for RandomX dataset (Linux only). It gives 1-3% speedup.

rdmsr true (boolean)

Restore MSR register values to their original values on exit. Used together with wrmsr.

wrmsr true (boolean, number, array)

Enable or disable MSR mod. It gives up to 15% speedup depending on your system. For advanced values follow MSR documentation.

cache_qos false (boolean)

Enable or disable Cache QoS. It's useful when you can't or don't want to mine on all CPU cores to make mining hashrate more stable. #1774

numa true (boolean)

Enable or disable NUMA support (better hashrate on multi-CPU servers and Ryzen Threadripper).

scratchpad_prefetch_mode 1 (number)

Which instruction to use in RandomX loop to prefetch data from scratchpad. 1 is default and fastest in most cases. Can be off (0), prefetcht0 instruction (1), prefetchnta instruction (2, a bit faster on Coffee Lake and a few other CPUs), mov instruction (3). #1823