Description
Summary
TBB does not correctly recognize NUMA nodes on a system with 2 NUMA nodes. The tbb::info::numa_nodes() API returns a single invalid index -1, while the system clearly supports NUMA with proper NUMA node IDs.
Version
oneTBB version: 2022.0
Environment
- Hardware:
- Architecture: x86_64
- CPU(s): 192 (2 sockets, 48 cores per socket, 2 threads per core)
- NUMA node(s): 2
- NUMA node0 CPU(s): 0-47,96-143
- NUMA node1 CPU(s): 48-95,144-191
- CPU Model Name: Intel(R) Xeon(R) Platinum 8468
- CPU MHz: 3100.186
Output of lscpu | grep "NUMA node":
NUMA node(s): 2
NUMA node0 CPU(s): 0-47,96-143
NUMA node1 CPU(s): 48-95,144-191
-
OS:
- Name: Ubuntu 20.04.6 LTS
- Kernel: 5.8.0-50-generic
-
Compiler:
- nvcc:
pliops@lab3010:~/guyzi/gpu_kv_api$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Tue_Oct_29_23:50:19_PDT_2024 Cuda compilation tools, release 12.6, V12.6.85 Build cuda_12.6.r12.6/compiler.35059454_0
- nvcc:
Observed Behavior
The program outputs the following:
TBB version: 2022.0
NUMA node indexes: -1
This indicates that TBB failed to detect the NUMA nodes correctly.
Expected Behavior
TBB should recognize and return the correct NUMA node indexes (0 and 1) via the tbb::info::numa_nodes() API.
Steps To Reproduce
Ensure NUMA is enabled on the system. Verify with the command lscpu | grep "NUMA node".
Use the following program to reproduce the issue:
#include <tbb/tbb.h>
#include <iostream>
#include <vector>
int main() {
std::cout << "TBB version: " << TBB_VERSION_MAJOR << "." << TBB_VERSION_MINOR << std::endl;
std::vector<tbb::numa_node_id> numa_indexes = tbb::info::numa_nodes();
if (numa_indexes.empty()) {
std::cerr << "No NUMA nodes detected. Ensure the system supports NUMA." << std::endl;
return 1;
}
std::cout << "NUMA node indexes: ";
for (const auto &index : numa_indexes) {
std::cout << index << " ";
}
std::cout << std::endl;
return 0;
}
Compile the program using the following command:
nvcc -ltbb test_program.cpp -o test_program
Run the compiled program:
./test_program
Observe the output. If NUMA detection fails, the program will print:
TBB version: 2022.0
NUMA node indexes: -1