Let us assume, we need
1GiB of 2MiB-sized huge pages . This will require a minimum number of 512 such pages (i.e. 1GiB total) on each node.
To view the number of available pages on each node, execute:
grep HugePages /proc/meminfo
AnonHugePages: 0 kB ShmemHugePages: 0 kB HugePages_Total: 1024 HugePages_Free: 671 HugePages_Rsvd: 0 HugePages_Surp: 0
If the number of available pages is less than 512, then the page count should be reconfigured as required, accounting for any other workloads which may be co-resident on the worker node and which also require them. For example:
echo 512 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
echo vm.nr_hugepages = 512 | sudo tee -a /etc/sysctl.conf