본문 바로가기
개발 이야기/머신러닝, 딥러닝

[문제해결] NUMA node read from SysFS had negative value -1

by AI 동키 2021. 8. 13.
반응형

환경

  • OS : Ubuntu20.04
  • Graphic : Nvidia RTX3090
  • CUDA : CUDA-11.4, cuDNN8.2.2
  • Tensorflow : tfnightly

문제점

>>> import tensorflow as tf
>>> from tensorflow.python.client import device_lib
>>> tf.test.is_gpu_available()  # 사용 가능한 GPU가 있는지 확인: True

WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.config.list_physical_devices('GPU')` instead.
2021-08-13 09:59:51.226432: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

2021-08-13 09:59:51.277631: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-08-13 09:59:51.283808: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-08-13 09:59:51.284694: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-08-13 09:59:51.543833: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-08-13 09:59:51.544531: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-08-13 09:59:51.545183: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:939] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2021-08-13 09:59:51.545830: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1505] Created device /device:GPU:0 with 21984 MB memory:  -> device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:01:00.0, compute capability: 8.6
True

 

tf-nighly GPU를 활용하기 위해 환경설정 하는 중 위와 같은 메시지가 뜨는 현상이 발생했다.

알아보니,

NUMA node 정보가 올바르지 않지만, 너 적어도 한 개의 NUMA node 있다.
그러니 일단 되게끔 해 보겠다.

라는 메시지로 요약된다.


 

NUMA (Non-Uniformed Memory Access) 란 무엇인가

불균일 기억 장치 접근(Non-Uniform Memory Access, NUMA)는 멀티프로세서 시스템에서 사용되고 있는 컴퓨터 메모리 설계 방법중의 하나로, 메모리에 접근하는 시간이 메모리와 프로세서간의 상대적인 위치에 따라 달라진다. NUMA구조에서 프로세서는 자기의 로컬 메모리에 접근할 때가 원격 메모리에 접근할 때보다 더 빠르다. 원격 메모리는 다른 프로세서에 연결되어 있는 메모리를 말하고 로컬 메모리는 자기 프로세서에 연결되어 있는 메모리를 말한다.

즉, 하나의 메인보드에서 여러 프로세서를 사용하면서 메모리 접근 효율을 높이기 위한 기술로 특정 프로세서가 메모리를 다 잡게되면 버스를 자기 혼자 독점하고있으니 다른 프로세서는 놀아야하는 상황이 발생하기 때문에 각 프로세서마다 메모리 구역을 나눠주고 ‘여기만 접근해’ 라고 지정하고 그걸 NUMA 노드라고 함.


해결 방법

1. 노드 확인

$lspci | grep -i nvidia

01:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3090] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA102 High Definition Audio Controller (rev a1)

첫번째 줄 VGA 호환 장치, NVIDIA Geforce 의 주소가 01:00.0 으로 나온다. 이는 각자 다를 것이므로 이 부분을 잘 변경해 주자.

 

2. NUMA 설정 값 확인 및 변경

sys/bus/pci/devicecs/ 에 가보면 다음과 같은 목록을 확인할 수 있다. 

위에서 확인한 01:00.0 이 보인다. 다만 앞에 0000:이 붙어있다.

연결되어있는지 다시 확인해 본다.

$ cat /sys/bus/pci/devices/0000\:01\:00.0/numa_node

-1

-1은 연결이 안되있다는 의미, 0이 잘 되어있다는 의미다. 즉, 안되어있다.

아래의 명령어로 고쳐 준다.

echo 0 | sudo tee -a /sys/bus/pci/devices/0000\:01\:00.0/numa_node

다시 확인해 본다.

$ cat /sys/bus/pci/devices/0000\:01\:00.0/numa_node

0

 

Thank you.

반응형

댓글