Skip to content

Instantly share code, notes, and snippets.

@GermanAizek
Last active February 29, 2024 13:55
Show Gist options
  • Save GermanAizek/58dbc6674824a49d1aba3cd452fe66f6 to your computer and use it in GitHub Desktop.
Save GermanAizek/58dbc6674824a49d1aba3cd452fe66f6 to your computer and use it in GitHub Desktop.
NUMA checker C/C++ on Windows (Example: Server motherboard with 2/4/6 CPU sockets)
#include <iostream>
#include <windows.h>

bool IsNUMA() noexcept
{
    ULONG HighestNodeNumber;
    return !(!GetNumaHighestNodeNumber(&HighestNodeNumber) || HighestNodeNumber == 0);
}

int main()
{
    std::cout << "Motherboard supported NUMA?: " << (IsNUMA() ? "YES" : "NO") << '\n';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment