Kali Linux 2025-2
Raspberry Pi 2 (v1.2), 3, 4, 400, 5 and 500 (64-bit)
(https://kali.download/arm-images/kali-2025.2/kali-linux-2025.2-raspberry-pi-arm64.img.xz)
What have you tried:
sudo bash -c “echo vm.nr_hugepages=1280 >> /etc/sysctl.conf”
Adding: Example: To /boot/firmware/config.txt
default_hugepagesz=2MB hugepagesz=1G hugepages=2 hugepagesz=2M hugepages=20
What is the error:
When xmrig has been built from source and cd ~/xmrig the issue sudo ./xmrig with “huge-pages”: true, in the xmrig config.json.
xmrig spits out in the terminal hugepages: Unavailable.
What device is this on:
RPI5 16GB
default_hugepagesz=2MB hugepagesz=1G hugepages=2 hugepagesz=2M hugepages=20
I’ve been fighting this for days.
Also.
Note:
xmrig in Bookworm Raspian OS through Pi-Apps
If I install pi-apps and xmrig through pi-apps, and run terminal
sudo ./xmrig -t 4 --cpu -a randomx -o americas.mining-dutch.nl:3340 --tls -u username-here.worker1 -p pw-here
xmrig spits out back Huge Pages Supported.
Ignore 1gb pages. That is supported by the cpu/cpu’s. RPI5 does not have 1gb huge pages.
Example on linux mint with two xeon’s.
This is just an example on how pi-apps/xrim returns on raspian bullseye rpi4-8gb and Bookworm rpi5-16GB and am sure if I install pi-apps/xmrig on Kali-ARM results be huge pages supported.
Supported different OS and device “PC”
Unavailable RPI5 from source build.
If I build xmrig from source
Return is as above explained. Huge Pages Un available.
So would I have to create a folder and file for this to work? Because under mm, the folder and the file does not exist.
/hugepages/hugepages-1048576kB/nr_hugepages
(admin㉿pi5)-[~]
└─$ echo 3 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
[sudo] password for admin:
tee: /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages: No such file or directory
3
┌──(admin㉿pi5)-[~]
└─$ echo 3 | sudo tee /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
tee: /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages: No such file or directory
3
┌──(admin㉿pi5)-[~]
└─$ enabled | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
tee: /sys/kernel/mm/transparent_hugepage/enabled: No such file or directory
enabled: command not found
┌──(admin㉿pi5)-[~]
└─$ madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
tee: /sys/kernel/mm/transparent_hugepage/enabled: No such file or directory
Command 'madvise' not found, did you mean:
command 'fadvise' from deb util-linux-extra
Try: sudo apt install <deb name>
┌──(admin㉿pi5)-[~]
└─$ cat /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages
cat: /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages: No such file or directory
Also when I try
sudo mkdir /sys/kernel/mm/hugepages
sudo mkdir /sys/kernel/mm/hugepages/
mkdir: cannot create directory ‘/sys/kernel/mm/hugepages’: Operation not permitted
mkdir: cannot create directory ‘/sys/kernel/mm/hugepages/’: Operation not permitted
sudo su
root@pi5 mkdir /sys/kernel/mm/hugepages
mkdir: cannot create directory '/sys/kernel/mm/hugepages': Operation not permitted
root@pi5 mkdir /sys/kernel/mm/hugepages
mkdir: cannot create directory '/sys/kernel/mm/hugepages/': Operation not permitted
So I remove the line from systemctl.conf and lef the boot/firmware/config.txt as is
default_hugepagesz=1G hugepagesz=1G hugepages=xx
(admin㉿pi5)-[~]
└─$ sudo cp ~/Desktop/config.json ~/xmrig/build
[sudo] password for admin:
┌──(admin㉿pi5)-[~]
└─$ cd ~/xmrig/build
┌──(admin㉿pi5)-[~/xmrig/build]
└─$ sudo su
┌──(root㉿pi5)-[/home/admin/xmrig/build]
└─# ./xmrig
* ABOUT XMRig/6.24.0 gcc/14.2.0 (built for Linux ARMv8, 64 bit)
* LIBS libuv/1.50.0 OpenSSL/3.5.0 hwloc/2.12.0
* HUGE PAGES unavailable
* 1GB PAGES unavailable
* CPU ARM Cortex-A76 (1) 64-bit AES
L2:2.0 MB L3:2.0 MB 4C/4T NUMA:8
* MEMORY 1.0/15.8 GB (6%)
* DONATE 1%
* POOL #1 stratum+tcp://americas.mining-dutch.nl:3340 coin Monero
* COMMANDS hashrate, pause, resume, results, connection
[2025-07-23 00:17:01.440] config configuration saved to: "/home/admin/xmrig/build/config.json"
* OPENCL disabled
* CUDA disabled
[2025-07-23 00:17:01.909] net use pool americas.mining-dutch.nl:3340 TLSv1.3 15.235.43.55
[2025-07-23 00:17:01.909] net fingerprint (SHA-256): "1928e7771455dd74be17457d9c41ce16b314909fb96e5477c7caab1e04393e5c"
[2025-07-23 00:17:01.909] net new job from americas.mining-dutch.nl:3340 diff 25000 algo rx/0 height 3461451 (2 tx)
[2025-07-23 00:17:01.909] cpu use argon2 implementation default
[2025-07-23 00:17:01.909] randomx init datasets algo rx/0 (4 threads) seed b8b1c5be5126ef6a...
[2025-07-23 00:17:01.911] randomx failed to allocate RandomX dataset using 1GB pages
No. I was referring to replies made by app’s author and the flag FLAG_PDPE1GB
..
“The /sys
directory in Linux is a virtual filesystem (sysfs) that provides an interface between the kernel and user space, exposing information about devices, drivers, and kernel parameters. It’s not a traditional directory with physical files; instead, it’s dynamically generated by the kernel in memory. This allows user-space programs to access and interact with the system’s hardware and kernel components.”
I will show what I have here on x64 laptop with Kali Live 2025.2:
I did not enable them. They were just here. A fresh boot.
If in your case, these directories are not there, something is wrong with the OS or hardware..
I see on the Internet people ask about RP5 and hugepages too.
Search net for “raspberry pi 5 hugepages” and you will see their threads..
They are talking about modifying some config file in /boot folder ..
I don’t have RP5 to check it for you..
On the web, they talked about modifying the “/boot/config-6.6.20+rpt-rpi-2712” file.
In your case it may (and probably will) be a different one but with a similar pattern.
It seems to me that after each modification you need to do a full boot, not a quick one.
And besides, you need to check if this directory “/sys/kernel/mm/hugepages/” appears.
If the directory is not there after boot, the application will also fail.
On Kali Live x64 on my laptop, I have a file in the /boot folder called /boot/config-6.12.25-amd64
cat /boot/config-6.12.25-amd64 | grep HUGEPAGE
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
// CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
// CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
(there are some more if you use just grep PAGE)
Maybe find someone on the web or RP5 forums who has it working and compare configurations?
The author of Xmrig is available on GitHub. Ask him. He answered the questions in the first link I provided yesterday.
But before you do that check out his advice from that thread.. You need to recompile the source code of this application according to that advice.
Kali is based on Debian so it would be helpful to read the Hugepages manual on the Debian website:
From the manual, I get how to check Hugepages:
cat /proc/meminfo | grep -i huge
Worth reading. Although not everything applies as-is.
Edit (again): what does this command show on your system?
grep HUGETLB /boot/config-$(uname -r)