cjweeks / tensorflow-cmake

Integrate TensorFlow with CMake projects effortlessly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build with CUDA GPU support?

opened this issue · comments

Thanks, this works great for CPU. What should be added to build with GPU support? Using Bazel it is quite easy, just by adding "-c opt --config=cuda". Is there a similar switch for cmake?

If you add the cuda flag when you build the shared library you will get GPU support. So the command in Step 1 should be: bazel build -c opt --config=cuda tensorflow:libtensorflow_all.so.

When I first tried this command, I got an error message about a missing crosstool, similar to tensorflow/tensorflow#4105. I deleted the bazel cache folder (.cache/bazel/) and re-ran the ./configure script as recommended and then the above build command completed successfully