blue-sky
blue-sky

Reputation: 53916

Configuring Tensorflow to use all CPU's

Reading : https://www.tensorflow.org/versions/r0.10/resources/faq.html it states :

Does TensorFlow make use of all the devices (GPUs and CPUs) available on my machine?

TensorFlow supports multiple GPUs and CPUs. See the how-to documentation on using GPUs with TensorFlow for details of how TensorFlow assigns operations to devices, and the CIFAR-10 tutorial for an example model that uses multiple GPUs.

Note that TensorFlow only uses GPU devices with a compute capability greater than 3.5.

Does this mean Tensorflow can automatically make use of all CPU's on given machine or does it ned to be explicitly configured ?

Upvotes: 21

Views: 23693

Answers (1)

Alexandre Passos
Alexandre Passos

Reputation: 5206

CPUs are used via a "device" which is just a threadpool. You can control the number of threads if you feel like you need more:

sess = tf.Session(config=tf.ConfigProto(
  intra_op_parallelism_threads=NUM_THREADS))

Upvotes: 25

Related Questions