Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TensorFlow: How to verify that it is running on GPU

I am looking for a simple way of verifying that my TF graphs are actually running on the GPU.

PS. It would also be nice to verify that the cuDNN library is used.

like image 696
Toke Faurby Avatar asked Mar 01 '17 09:03

Toke Faurby


1 Answers

There are several ways to view op placement.

  1. Add RunOptions and RunMetadata to the session call and view the placement of ops and computations in Tensorboard. See code here: https://www.tensorflow.org/get_started/graph_viz

  2. Specify the log_device_placement option in a session ConfigProto. This logs to console which device the operations are placed on. https://www.tensorflow.org/api_docs/python/tf/ConfigProto

  3. View GPU usage in the terminal using nvidia-smi.

like image 69
pfredriksen Avatar answered Dec 22 '22 01:12

pfredriksen