Huge Pages, also known as Large Pages (on Windows) and Super Pages (on BSD or macOS) is very important thing for almost all supported CPU mineable algorithms, typical hashrate increase is 20-30% when huge pages used, for RandomX it can increase performance up to 50%. XMRig refers to this feature as huge pages regardless of platform.
If XMRig use huge pages you will see lines with text like bellow in miner log.
On Windows you need special privilege called as SeLockMemoryPrivilege to use huge pages.
First check miner output if you see line below you already have this privilege and no additional actions required.
* HUGE PAGES permission granted
If not, you have 2 options to obtain it, both are require admin rights.
- Easiest way: run the miner as Administrator once and reboot.
- Manual configuration
On Windows 10 once you obtain the privilege, admin rights no longer required to use huge pages, but on Windows 7 admin rights always required. Please note on Windows no way to reserve huge pages for future use and the miner still can fail to allocate all required huge pages, because other applications use memory, if you got less than 100% of huge pages best option is reboot. If you heavy use algorithm switching and like to prevent loose huge pages you can use option "memory-pool": true,
in "cpu"
object.
Since version 5.2.0 if you run the miner with root privileges no manual system configuration required.
For manual configuration you must know how many huge pages you need, general recommendations is 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 not available for other usage, in automatic mode the miner reserve precise count of huge pages.
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"
For RandomX dataset since version 5.2.0 the miner support 1GB huge pages (regular huge pages size is 2MB), this feature available only on Linux. It increases the hashrate by 1-3% (depends of CPU) and increases memory requirements to 3GB (3 pages) per NUMA node.
By default this feature disabled, to enable use option "1gb-pages": true,
in "randomx"
object.
If use XMRig with root privileges, additional system configuration not required.
As an alternative you can go to miner source directory and run sudo ./scripts/enable_1gb_pages.sh
script source .