tensorflow: Warning persists after upgrading to Mac OS 12- Could not identify NUMA node of platform GPU ID 0

This warning was supposed to be resolved in MacOs 12 . How to fix this?

from tensorflow.keras.datasets import mnist
from tensorflow.keras.utils import to_categorical

from tensorflow.keras import layers
from tensorflow.keras import models
model = models.Sequential()
model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))
model.add(layers.Flatten())
model.add(layers.Dense(64, activation='relu'))
model.add(layers.Dense(10, activation='softmax'))
model.summary()

Metal device set to: Apple M1
2021-10-26 01:42:59.638063: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:305] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2021-10-26 01:42:59.638241: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:271] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 44 (5 by maintainers)

Most upvoted comments

This fixed this issue for me (M1 MacBook Pro, macOS Monterey 12.0.1):

  1. Removing my previous kernel jupyter kernelspec remove tensorflow

  2. Installing the TensorFlow Metal plugin (Skip the Miniforge installation if you already have it installed, I also have it installed globally) conda install -c apple tensorflow-deps python -m pip uninstall tensorflow-macos python -m pip uninstall tensorflow-metal conda install -c apple tensorflow-deps --force-reinstall conda install -c apple tensorflow-deps==2.6.0 python -m pip install tensorflow-macos python -m pip install tensorflow-metal

  3. Creating a new kernel python -m ipykernel install --user --name tensorflow --display-name "Python 3.9 (tensorflow)"

@gadagashwini If i remember correctly, i saw in another thread, that your GPU is Radeon, which means you are not using M1. This ugly BUG only occurs on M1 chips! It happened to me too today. I have spent whole day trying to solve this issue, but it is impossible to solve it on M1. I am on latest version of macos operating system on Macbook max 16. I get NUMA 0 error just like everyone else and model.fit gets STUCK, it doesn’t even start. I left it for 30 mins, just in case it’s that slow, but of course this was not the issue. IF i switch to CPU, then it works properly, but of course, the whole point is to use the GPU so we could speed up the training process. M1 tensorflow does NOT work on GPU. And it seems like noone is taking it seriously, not Apple, not Tensorflow / Keras team. If at least there was a confirmed BUG, i would be happy to wait for a solution. But noone even confirmed there is a bug, yet if u search the internet… it is FLOODED with frustrating people that paid 4000 USD for their Macs to do some machine learning on Tensorflow… and it doesn’t work on GPU at all. I am very frustrated as well. Can someone at least mark this is a BUG, because only then someone will probably look into it in the future. Until it’s properly classified, i have no hope that this will be solved anytime soon. I guess back to PC until then.

Hey I’ve finally solved this problem by completely following this install guidance. Although it’s for M1, it works well on my M1 pro.

There will still be warnings but the code works, and I can see from the GPU monitor that it is actually using my GPU. However I found the training speed is quite slow, it may due to the lack of adaptation, so I decided to disable GPU and use CPU only and it works much better.

To disable GPU you can use: tf.config.experimental.set_visible_devices([], 'GPU') at the beginning of your code. This is how my device works:

A708CB10-B0A2-43EF-B060-429E553E262A

@tilakrayal none of the link you mentioned is related to my Issue . Every link you mentioned has MacOs version of 11 which is Big Sur. TF is not compatible with BIG Sur.Thats why they are facing issue. My problem is that I have upgraded my MacOs to 12 (which is compatible with TF as mentioned on Apple’s official website) and the issue still persists .

I’ve tried TensorFlow 2.6.0 and 2.7.0 on python versions 3.8 and 3.9. Unfortunately none of above solves Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.

@par1hsharma what you listing is from the past. I’ve always been using Intel based Macs. Again, this problem happened on exactly the day (and immediately right after) upgrading to MacOS Monterey. This is not an issue of not being able to install it. I can still install it, it just fails on a keras model fit() call when it never did before.

I can run something like:

import tensorflow as tf
tf.config.list_physical_devices()

And see my CPU and GPU but doing something more substantial will not work.

None of the suggestions written previously prevent the Could not identify NUMA node of platform GPU ID 0, defaulting to 0 message on my MBA M1 (MacOS 12.1). I have tried TensorFlow 2.5.0, 2.6.0 and 2.7.0 with tensorflow-metal plugins 0.1.2, 0.2.0 and 0.3.0 respectively. This was the first thing I tried after doing a complete reinstall of MacOS (which I did for unrelated reasons).

The simplest way for me to encounter the issue is to tf.config.list_logical_devices(). Note that tf.config.list_physical_devices() doesn’t trigger the message.

>>> import tensorflow as tf
Init Plugin
Init Graph Optimizer
Init Kernel
>>> tf.config.list_physical_devices()
[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'), PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
>>> tf.config.list_logical_devices()
Metal device set to: Apple M1

systemMemory: 8.00 GB
maxCacheSize: 2.67 GB

2022-01-09 15:57:38.705551: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:305] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2022-01-09 15:57:38.706074: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:271] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)
[LogicalDevice(name='/device:CPU:0', device_type='CPU'), LogicalDevice(name='/device:GPU:0', device_type='GPU')]

I followed the installing guidance here, it’s for M1 not M1 pro, I thought it would be the same but I failed. And I haven’t tried the Apple developer’s instructions here, don’t know if the document is up to date.

That is up to date install it from apple developer instruction @KejianCui99

yes exactly this issue persists but the TensorFlow team on GitHub is unable to catch this issue and they keep directing us to different threads .They dont even check the MacOs version people are using .