Giter VIP home page Giter VIP logo

Comments (12)

fo40225 avatar fo40225 commented on August 15, 2024

follow https://www.tensorflow.org/install/install_sources_windows to prepare the environment.

git clone https://github.com/tensorflow/tensorflow.git -b v1.11.0-rc1
cd tensorflow
python ./configure.py
...
bazel build --config=opt --config=cuda //tensorflow:libtensorflow_cc.so

You will get the libtensorflow_cc.so in tensorflow\bazel-out\x64_windows-opt\bin\tensorflow.

libtensorflow_cc.so is a dll, gen the .lib from it and link it and look if it works or not.

from tensorflow-windows-wheel.

dshawul avatar dshawul commented on August 15, 2024

Thank you for your quick response. Note that I have already built the library that way. My problem is that the .lib file it produces is much smaller than your produced by cmake. And I can not properly link a simple program with this smaller lib while I have no problems with yours. The dll (so) files are about the same size though. Did you do something in your cmake build to have a single tensorflow.lib (not tensorflow.dll) that you would need to link against any program

from tensorflow-windows-wheel.

dshawul avatar dshawul commented on August 15, 2024

I think in your cmake you have CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS which is probably why it is much larger than mine and also good for linking. If I do a
dumpbin /exports libtensorflow_cc.so
on the bazel created so, I get much less exported symbols than
dumpbin /exports tensorflow.dll
on your dll.

from tensorflow-windows-wheel.

fo40225 avatar fo40225 commented on August 15, 2024

Maybe use --config=monolithic and https://github.com/tensorflow/tensorflow/blob/v1.10.0/tensorflow/contrib/cmake/tools/create_def_file.py to gen shared lib from static lib is a way to work.

from tensorflow-windows-wheel.

ttdd11 avatar ttdd11 commented on August 15, 2024

@fo40225 With this process can you assign a specific GPU on windows using tensorflow_cc.dll?

from tensorflow-windows-wheel.

fo40225 avatar fo40225 commented on August 15, 2024

@ttdd11
tensorflow/tensorflow@0c8deb2
The instruction in commit message may work, I haven't try it.

from tensorflow-windows-wheel.

ttdd11 avatar ttdd11 commented on August 15, 2024

@fo40225 These look they they are for tensorflow.dll not tensorflow_cc.dll. The issue I'm having is that I can't assign a graph to a specific gpu. Have you been able to achieve this?

from tensorflow-windows-wheel.

ttdd11 avatar ttdd11 commented on August 15, 2024

@fo40225 But generally to make the tensorflow_cc.dll and .lib you are using the bazel build instructions. How are you exporting the correct symbols?

from tensorflow-windows-wheel.

fo40225 avatar fo40225 commented on August 15, 2024

@ttdd11 Using the bazel build instructions above only generate the .dll with no .lib file and .dll contains only C symbol not C++.

The commit not only fix the libtensorflow.so (C lib) but also fix the libtensorflow_cc.so (C++ lib).

Just try to checkout the commit and bazel build --config=opt //tensorflow:tensorflow_cc.

good luck

from tensorflow-windows-wheel.

ttdd11 avatar ttdd11 commented on August 15, 2024

@fo40225 Have you been able to set device in the c_api? I think this have been broken for about a year.

from tensorflow-windows-wheel.

fo40225 avatar fo40225 commented on August 15, 2024

@ttdd11 try to use the file in https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.10.0/cpp to see if it helps or not

or just wait google totally fix building cpp lib of tensorflow on windows tensorflow/tensorflow#26152

from tensorflow-windows-wheel.

ttdd11 avatar ttdd11 commented on August 15, 2024

@fo40225 I need to build with CUDA 10 for rtx support. How do I test the branch in the second link? doesn't look like its in yet.

from tensorflow-windows-wheel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.