Tuning for CPU - The-GNTL-Project/Documentation GitHub Wiki
Description
This guide will help you tune your CPU for mining.
System Optimizations
Linux (Ubuntu, Debian)
Huge Pages
Since XMRig version 5.2.0, if you run the miner with root privileges no manual system configuration is required.
For manual configuration, you must know how many huge pages you need, general recommendations are 1280 pages per NUMA node for RandomX algorithms and 128 per system for other algorithms. Please note 1280 pages means 2560 MB of memory will be reserved for huge pages and become unavailable for other usage, in automatic mode the miner reserves the precise count of huge pages.
Here you have 2 options for manual configuration:
- Temporary (until next reboot) reserve huge pages:
sudo sysctl -w vm.nr_hugepages=1280
. - Permanent huge pages reservation
sudo bash -c "echo vm.nr_hugepages=1280 >> /etc/sysctl.conf"
.
1GB Huge Pages
For RandomX dataset since XMRig version 5.2.0, the miner supports 1GB huge pages (regular huge pages size is 2MB), this feature is only available on Linux. It increases the hashrate by 1-3% (depending on CPU) and it increases memory requirements to 3GB (3 pages) per NUMA node.
By default this feature disabled, so to enable it, use the option "1gb-pages": true,
in the "randomx"
section of the config.json.
If use run XMRig with root privileges, additional system configuration not required.
If not, as an alternative you can go to miner source directory and run sudo ./scripts/enable_1gb_pages.sh
.
Windows
Enable the Lock Pages in Memory Option (aka Huge Pages)
XMRig being run as Administrator, will automatically configure the below settings for you.
Manual configuration:
- From the Start Menu, search for,
Local Security Policy
, and clickRun as Administrator
. - Expand
Local Policies
>User Rights Assignment
. - In the right-hand pane double-click on,
Lock pages in memory
. - Select,
Add User or Group
. - Type in
Administrator
, provide a single space, then type in the name of your regular Windows User and selectCheck Names
. Verify it looks correct, selectOK
twice and exit the Policy editor.
Change Windows Power Plan to High Performance
- From the Start Menu, search for,
Choose a power plan
, and clickOpen
. - Select the
High Performance
plan (you may have to expandShow additional plans
). - Close the
Power Options
window.