I am guessing it is failing the same way without venv also.
From searches it shows references to issues with DISPLAY.
$ python -c ‘import tensorflow as tf ; print("\nTensorflow version: ",tf.version, "\nTensorflow file: ",tf.file)’
Tensorflow version: 2.8.0
Tensorflow file: /usr/lib/python3/dist-packages/tensorflow/init.py
I have not been able to repeat this.
I have seen a similar issue once with two processes running on the same machine with Tensorboard. As it was using a invalid port (one reserved for X11)
TensorBoard on the default port of 6006 * (6000 - 6007 are reserved for X11)
If this is a Tensorboard in the job you can change Tensorboard to use port 9000.
It would get stuck trying to start orted (part of MPI).