No, I don’t think “open CUDA library” is enough to tell, because different nodes of the graph may be on different devices.
When using tensorflow2:
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
For tensorflow1, to find out which device is used, you can enable log device placement like this:
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
Check your console for this type of output.

Related Posts:
- How to find which version of TensorFlow is installed in my system?
- Import error when trying to import tensorflow with gpu
- Install pip for python 3.5
- ImportError: No module named tensorflow
- ImportError: No module named ‘tensorflow.python’
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- How to install python3 version of package via pip on Ubuntu?
- Could not find a version that satisfies the requirement tensorflow
- Could not find a version that satisfies the requirement tensorflow
- Convert a tensor to numpy array in Tensorflow?
- Convert a tensor to numpy array in Tensorflow?
- Convert a tensor to numpy array in Tensorflow?
- Tensorflow: why ‘pip uninstall tensorflow’ cannot find tensorflow
- Installing tensorflow with anaconda in windows
- Cannot uninstall Tensorflow
- error: Failed to load the native TensorFlow runtime
- Can I run Keras model on gpu?
- What is the difference between sparse_categorical_crossentropy and categorical_crossentropy?
- using pip3: module “importlib._bootstrap” has no attribute “SourceFileLoader”
- pip3: command not found
- ImportError: libcuda.so.1: cannot open shared object file
- LSTM Keras input shape confusion
- What is the difference between np.mean and tf.reduce_mean?
- Failed to load the native TensorFlow runtime – TensorFlow 2.1
- No Module Named ‘_pywrap_tensorflow_internal’
- TensorFlow: Blas GEMM launch failed
- What’s the difference between scikit-learn and tensorflow? Is it possible to use them together?
- Does Numpy automatically detect and use GPU?
- Error: OOM when allocating tensor with shape
- tar: Unrecognized archive format error when trying to unpack flower_photos.tgz, TF tutorials on OSX
- pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/
- can’t open tensorboard 0.0.0.0:6006 or localhost:6006
- How to fix “AttributeError: module ‘tensorflow’ has no attribute ‘get_default_graph'”?
- ImportError: No module named ‘xlrd’
- No module named ‘openpyxl’ – Python 3.4 – Ubuntu
- How to Install pip for python 3.7 on Ubuntu 18?
- Tensorflow 2.0 – AttributeError: module ‘tensorflow’ has no attribute ‘Session’
- No module named ‘tqdm’
- No module named django but it is installed
- What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow?
- How to completely uninstall python 2.7.13 on Ubuntu 16.04
- RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
- How to change python version in Anaconda?
- AttributeError: ‘module’ object has no attribute ‘main’ for tf.app.run()
- How to downgrade tensorflow, multiple versions possible?
- Purpose of “%matplotlib inline”
- How do I update Anaconda?
- TypeError: ‘str’ object is not callable (Python)
- Dijkstra’s algorithm in python
- How to create a GUID/UUID in Python
- Tensorflow import error: No module named ‘tensorflow’
- Replace ‘ with \’ in a string
- Arrays used as indices must be of integer (or boolean) type
- Are static class variables possible in Python?
- Why am I getting “LinAlgError: Singular matrix” from grangercausalitytests?
- ‘method’ object is not subscriptable. Don’t know what’s wrong
- How do I copy a file in Python?
- EOFError: Ran out of input
- Get Color Palettes from ColorHunt.co in Python
- How to determine a Python variable’s type?
- Could not find a version that satisfies the requirement
- Removing Conda environment
- Cannot convert list to array: ValueError: only one element tensors can be converted to Python scalars
- How do I plot only a table in Matplotlib?
- Change column type in pandas
- Split by comma and strip whitespace in Python
- Add a new item to a dictionary in Python
- reducing number of plot ticks
- How can I add new keys to a dictionary?
- Convert pandas data frame to series
- Decorators with parameters?
- How do I get a python program to do nothing?
- inserting characters at the start and end of a string
- Append a tuple to a list – what’s the difference between two ways?
- No module named Image
- How to fix “TypeError: len() of unsized object”
- ValueError: Unknown projection ‘3d’ (once again)
- Difference between len() and .__len__()?
- Python: AttributeError: ‘_io.TextIOWrapper’ object has no attribute ‘split’
- How to detect key presses?
- TypeError: ‘numpy.float64’ object does not support item assignment
- TypeError: unsupported format string passed to list.__format__
- Getting “socket.error: [Errno 61] Connection refused” python paramiko
- python setup.py uninstall
- ImportError: No module named cv2
- How to open every file in a folder
- Python iteration over non-sequence
- How do I convert a string to a double in Python?
- _csv.Error: field larger than field limit (131072)
- How do I rotate an image around its center using Pygame?
- How can I copy a Python string?
- Issue with virtualenv – cannot activate
- Can I set max_retries for requests.request?
- TypeError: coercing to Unicode: need string or buffer, int found
- Package libffi was not found in the pkg-config search path REDHAT6.5
- Line is too long. Django PEP8
- TypeError: zip argument #2 must support iteration
- CS231n: How to calculate gradient for Softmax loss function?
- How to create a new database using SQLAlchemy?