0

Is it possible to determine which installed version of cuda installed tensoflow is using?

i.e. in pytorch I can do: torch._C._cuda_getDriverVersion()

Note: I'm not looking for compatibility combinations like Which TensorFlow and CUDA version combinations are compatible?

talonmies
  • 70,661
  • 34
  • 192
  • 269
mrgloom
  • 20,061
  • 36
  • 171
  • 301

1 Answers1

1

There doesn't seem to be an API to check the CUDA version. But there is a hacky way, which is to print the shared library dependencies of tensorflow internal library.

python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib() + "/python/_pywrap_tensorflow_internal.so")' | xargs ldd |grep cuda

libcublas.so.10.0 => /usr/local/cuda/lib64/libcublas.so.10.0 (0x00007f398a94e000)
libcusolver.so.10.0 => /usr/local/cuda/lib64/libcusolver.so.10.0 (0x00007f3982267000)
libcudart.so.10.0 => /usr/local/cuda/lib64/libcudart.so.10.0 (0x00007f3981fed000)

https://github.com/tensorflow/tensorflow/issues/10827

Manoj Mohan
  • 5,654
  • 1
  • 17
  • 21