Using Java with Nvidia GPUs (CUDA)

First of all, you should be aware of the fact that CUDA will not automagically make computations faster. On the one hand, because GPU programming is an art, and it can be very, very challenging to get it right. On the other hand, because GPUs are well-suited only for certain kinds of computations. This may … Read more

How to get current available GPUs in tensorflow?

There is an undocumented method called device_lib.list_local_devices() that enables you to list the devices available in the local process. (N.B. As an undocumented method, this is subject to backwards incompatible changes.) The function returns a list of DeviceAttributes protocol buffer objects. You can extract a list of string device names for the GPU devices as … Read more

How to tell if tensorflow is using gpu acceleration from inside python shell?

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 … Read more