Hi there!
Trying to install tensorflow (again, second try) - to use on my laptop with Nvidia GPU RTX 3050.
Ubuntu under WSL2.
followed instructions listed here: Instale o TensorFlow com pip
But on the step where I am checking the registered GPUs - I have bad outcome:
import tensorflow as tf
print(f"TensorFlow version: {tf.__version__}")
# List physical GPUs
gpus = tf.config.list_physical_devices('GPU')
if gpus:
print(f"GPUs available: {gpus}")
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
else:
print("No GPU available")
gives:
TensorFlow version: 2.16.1
No GPU available
(.venv) fire@note-4:~/py_projects/ATARI_YW_elim_p311$ python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
2024-07-11 14:47:12.877129: I tensorflow/core/util/port.cc:113] 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`.
2024-07-11 14:47:12.918243: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-07-11 14:47:13.412965: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
2024-07-11 14:47:14.017634: I external/local_xla/xla/stream_executor/cuda/cuda_executor.cc:984] could not open file to read NUMA node: /sys/bus/pci/devices/0000:01:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-07-11 14:47:14.054469: W tensorflow/core/common_runtime/gpu/gpu_device.cc:2251] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
so tensorflows can’t see any GPU.
It seems that something is wrong with environment variables… How can I check/set required variables? Note - I am not using conda, just manually creating a virtual environment …
What am I doing wrong, or how can I make GPU work to speed up calculations?
When running nvidia-smi I got:
(.venv) fire@note-4:~/py_projects/ATARI_YW_elim_p311$ nvidia-smi
Thu Jul 11 15:08:38 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.104.07 Driver Version: 537.34 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 3050 ... On | 00000000:01:00.0 Off | N/A |
| N/A 59C P8 4W / 40W | 0MiB / 4096MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
But when running lspci:
(.venv) fire@note-4:~/py_projects/ATARI_YW_elim_p311$ lspci
05d5:00:00.0 System peripheral: Red Hat, Inc. Virtio file system (rev 01)
4715:00:00.0 SCSI storage controller: Red Hat, Inc. Virtio 1.0 console (rev 01)
53c1:00:00.0 3D controller: Microsoft Corporation Basic Render Driver
e04a:00:00.0 3D controller: Microsoft Corporation Basic Render Driver
Please, kindly, guide me through the idea on how I can make tensorflow with GPU working.
Python 3.11
CUDA installed:
(.venv) fire@note-4:~$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Apr_17_19:19:55_PDT_2024
Cuda compilation tools, release 12.5, V12.5.40
Build cuda_12.5.r12.5/compiler.34177558_0