Saltar a contenido

TensorFlow

Para instalar TensorFlow es necesario tener Miniforge3 previamente instalado. Seguidamente se procede a crear un ambiente de conda:

mamba create --name tensorflow --channel conda-forge python=3.11
mamba activate tensorflow
python3 -m pip install tensorflow[and-cuda]

Una vez instalado se procede a hacer una sesión interactiva en un nodo de la cola gpu:

srun -p gpu --gres=gpu:a100:1 --pty bash -l
o bien:
srun -p gpu-mig --gres=gpu:a100_1g.10gb:1 --pty bash -l

Para comprobar la correcta instalación de TensorFlow se procede a ejecutar el siguiente comando:

python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

El final del output debe ser similar a este texto:

I tensorflow/core/util/port.cc:153] oneDNN custom operations are on.  
You may see slightly different numerical results due to floating-point 
round-off errors from different computation orders.
To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

puntosHPC_0.svg