Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU support for Java in windows #16660

Closed
jedakiah13 opened this issue Feb 1, 2018 · 36 comments
Closed

GPU support for Java in windows #16660

jedakiah13 opened this issue Feb 1, 2018 · 36 comments
Assignees

Comments

@jedakiah13
Copy link

I am working with Tensorflow in Java using the Maven dependency.

I would like to use the GPU version in my Java application but I notice there is only a supported Maven repository for Linux.

Will there be support for Tensorflow with Java in windows?
If so then what is the timeline for this?

Otherwise is there another way round it?

Thanks.

@drpngx
Copy link
Contributor

drpngx commented Feb 2, 2018

@mrry @asimshankar can comment. I think it's safer to assume that it won't be there in the next few months.

@drpngx drpngx added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 2, 2018
@asimshankar
Copy link
Contributor

We don't build GPU-enabled binaries for the C or JNI libraries for Windows as part of the release process yet.
However, it should happen within a release or two (probably 1.7).

We just started setting up the nightly build for GPU - https://ci.tensorflow.org/view/Nightly/job/nightly-libtensorflow-windows-gpu/
(which hasn't had a successful build yet :)

@jedakiah13
Copy link
Author

Ok thanks, I'm glad it's in your plans :)

Do you have an idea how long it will be until 1.7?

Thanks,

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Feb 6, 2018
@tensorflowbutler
Copy link
Member

Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@tensorflowbutler
Copy link
Member

Nagging Assignee @asimshankar: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@jedakiah13
Copy link
Author

Hi,
You mentioned that there should be windows gpu java support with 1.7, I see the 1.7 release, is there support for gpu in java with windows coming soon?

@asimshankar
Copy link
Contributor

@jedakiah13 : Unfortunately, I was not able to get this in for 1.7.0-rc0 .

@jedakiah13
Copy link
Author

so are we likely to have to wait until 1.8?

@eric-czech
Copy link

I was curious to know the same, and appreciate the updates on the status of this @asimshankar !

@tlf30
Copy link

tlf30 commented Apr 2, 2018

I too was wondering what the status on this is.

@asimshankar
Copy link
Contributor

Unfortunately, nope, we didn't get this in time for 1.7.
However @case540 has been looking into the build issues, so hopefully we'll be able to make progress in the next release or two.

@tensorflowbutler
Copy link
Member

Nagging Assignee @case540: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@tensorflowbutler
Copy link
Member

Nagging Assignee @case540: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@hadim
Copy link

hadim commented May 28, 2018

Any news here? ETA?

@tlf30
Copy link

tlf30 commented Jun 8, 2018

Still waiting for an update... We would love to have this up and running.

@case540
Copy link
Contributor

case540 commented Jun 8, 2018

Windows libtensorflow GPU build is broken and requires a fix from the protobuf team. Not entirely sure on eta but it is something we are working on.

@dbousamra
Copy link

@case540 What exactly needs to be done?

@tensorflowbutler
Copy link
Member

Nagging Assignee @case540: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@tensorflowbutler
Copy link
Member

Nagging Assignee @case540: It has been 32 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@donaldlee2008
Copy link

Still waiting for an update....

@tlf30
Copy link

tlf30 commented Aug 7, 2018

Same here... @case540 are you working on this?

@av8ramit av8ramit assigned av8ramit and unassigned case540 Aug 8, 2018
@av8ramit
Copy link

av8ramit commented Aug 8, 2018

I'm working on this. It should be available soon.

@asimshankar
Copy link
Contributor

@jedakiah13 @tlf30 - could you try with 1.10.0?

@mstritt
Copy link

mstritt commented Aug 14, 2018

@av8ramit thanks a lot for your work!
I can see the windows-x86_64\tensorflow_jni.dll in libtensorflow_jni-1.10.0-rc1.jar but not in libtensorflow_jni_gpu-1.10.0-rc1.jar.
Should the lib jni_gpu include a native win lib as well?
Currently gpu for win does not work for me referencing both libs via Maven.

@asimshankar
Copy link
Contributor

@mstritt - Please try version 1.10.0, not 1.10.0-rc1 :)

@mstritt
Copy link

mstritt commented Aug 14, 2018

@asimshankar , thanks for the hint, indeet it's included there.
Unfortunately I get a dependency missing error now (see log).
msvcp140.dll is available, but I have cudbb64_6.dll. Do I have to upgrade to cudnn 7 ?

org.tensorflow.NativeLibrary: tryLoadLibraryFailed: no tensorflow_jni in java.library.path
org.tensorflow.NativeLibrary: jniResourceName: org/tensorflow/native/windows-x86_64/tensorflow_jni.dll
org.tensorflow.NativeLibrary: frameworkResourceName: org/tensorflow/native/windows-x86_64/tensorflow_framework.dll
org.tensorflow.NativeLibrary: org/tensorflow/native/windows-x86_64/tensorflow_framework.dll not found. This is fine assuming org/tensorflow/native/windows-x86_64/tensorflow_jni.dll is not built to depend on it.
org.tensorflow.NativeLibrary: extracting native library to: C:\Users\[...]\AppData\Local\Temp\tensorflow_native_libraries-1534235673406-0\tensorflow_jni.dll
org.tensorflow.NativeLibrary: copied 158330368 bytes to C:\Users\[...]\AppData\Local\Temp\tensorflow_native_libraries-1534235673406-0\tensorflow_jni.dll
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\[...]\AppData\Local\Temp\tensorflow_native_libraries-1534235673406-0\tensorflow_jni.dll: Can't find dependent libraries

@asimshankar
Copy link
Contributor

I think so, see https://www.tensorflow.org/install/install_windows#requirements_to_run_tensorflow_with_gpu_support

@mstritt
Copy link

mstritt commented Aug 14, 2018

ok, works like a charm with cuda9+cudnn7. Thanks a lot for this!

@av8ramit
Copy link

No problem @mstritt !

@tlf30
Copy link

tlf30 commented Aug 14, 2018

@asimshankar my team and I will check it out, thank you.

@carlosuc3m
Copy link

@mstritt Could you please tell the version of tensorflow too?

@mstritt
Copy link

mstritt commented Feb 4, 2020

@carlosuc3m : it is working since TF 1.10

@carlosuc3m
Copy link

@mstritt it is not working for me in tf 1.12, with cuda 9 and cudnn 7.
It says that java.lang.UnsatisfiedLinkError: tensorflow_jni.dll: Can't find dependent libraries.
Thanks for your answer

@carlosuc3m
Copy link

I have also tried with TF 1.15 and it loads well but it seems that is still using the CPU, how can I check this? Or should I call any different method? Regards

@carlosuc3m
Copy link

Just in case someone finds it useful, the problem that was causing this error was that I was not using the correct CUDA version. I tried for tf 1.12 and tf 1.15. For tf 1.12 I needed CUDA 9.0 and for tf 1.15 I needed CUDA 10.0

@lbonansbrux
Copy link

lbonansbrux commented Mar 22, 2020

Hi all.
My config is Win 10 + CUDA 10.1 + cuDNN 7.6 + (may this have an interest, Python 3.7.7 + tensorflow 2.1 installed with pip in a Python virtual env; TF works well in Python).
In Java, which I hope having no dependency with TF in Python, I use without problem TF 1.4 and TF 1.14 for cpu with ant. I simply put tensorflow_jni.dll in the project subdirectory myjni and mention -Djava.library.path=myjni and it runs smoothly.
When with ant, I use the same java sample program with TF 1.14 for gpu, with the same -Djava.library.path=myjni and tensorflow_jni.dll (gpu version, bigger) in the myjni directory, I receive the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\<me>\AppData\Local\Temp\tensorflow_native_libraries-1584890522116-0\tensorflow_jni.dll: Can't find dependent libraries
What is strange is that each run generates a new directory C:\Users\<me>\AppData\Local\Temp\tensorflow_native_libraries-<NUMBER>\ where <NUMBER> is each time different. The directory is removed automatically after about 2 sec (for the rare case it run fine, the directory is not removed). I would like to understand why.
Hence, tensorflow_jni.dll in myjni directory is ignored.
So many days spent here. Any clue?
NB: I also have:

  • (8!) Microsoft Visual C++ 20nn Redistribuable (x64,x86) with nn in [05, 12, 13, 15-19]. I don't know if I should remove some of them...
  • Microsoft Visual Studio Community 2015 with Updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests