FS#65075 - [python-tensorflow-opt-cuda] package doesn't mark tensorflow-gpu as installed

Attached to Project: Community Packages
Opened by RuRo (ruro) - Tuesday, 07 January 2020, 18:40 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Thursday, 16 January 2020, 12:07 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The `python-tensorflow-opt-cuda` and `python-tensorflow-cuda` packages install (according to pip) a package named `tensorflow`, however, the other official packages expect the name of the package (with gpu capabilities) to be called `tensorflow-gpu`. For example, after installing `python-tensorflow-opt-cuda` and `python-tensorflow-serving-api`, you will find out that `pip check` complains that "tensorflow-serving-api-gpu 2.0.0 requires tensorflow-gpu, which is not installed".

Additionally attempting to `pip install --user` any package, which lists tensorflow-gpu as a requirement will attempt to install `tensorflow-gpu` from PyPI, even though it's already installed system-wide.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Thursday, 16 January 2020, 12:07 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 11 January 2020, 01:02 GMT
That's weird. Could you look into it and suggest a patch? I don't really see what's wrong in the package.
Comment by RuRo (ruro) - Saturday, 11 January 2020, 01:38 GMT
Judging from this line in tensorflows own CI builds, you need to set the project name using the "--project_name" option. Also they set the "--gpu" flag, when building for GPUs, although I am not sure, if that is required with the NEED_CUDA environment variables set.

https://github.com/tensorflow/tensorflow/blob/a396eb4a3a7dc08b859df42919fcc7bdf8236a01/tensorflow/tools/ci_build/builds/pip_new.sh#L631

So I would propose adding "--gpu --project_name tensorflow_gpu" to lines 121 and 136 of the PKGBUILD. (I didn't have time to check, if this works yet, but this seems right given that it's how they build it themselves.)
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 11 January 2020, 14:07 GMT
Very good find! I'll try adding that. Because of https://github.com/tensorflow/tensorflow/blob/a396eb4a3a7dc08b859df42919fcc7bdf8236a01/tensorflow/tools/ci_build/builds/pip_new.sh#L626 however I think we're good just adding --gpu.
Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 12 January 2020, 04:18 GMT
Can you test rel -2?
Comment by RuRo (ruro) - Wednesday, 15 January 2020, 12:59 GMT
Sorry, I am still waiting for rel -2 to reach manjaro, this might take a while and I am currently unable to build the PKGBUILD myself.
If I understand correctly, then just adding '--gpu' is not sufficient.
The pip_new.sh script builds the same bazel build_pip_package target as our PKGBUILD, so if they need to set the "--project_name", then we also probably should.
Unless I am missing something, I don't see, how the line you linked to justifies just adding "--gpu".
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 16 January 2020, 05:24 GMT
From what I can see, the project name is automatically changed by the line I linked. Also, Manjaro only copy our packages anyway so you can just get https://www.archlinux.org/packages/community/x86_64/python-tensorflow-opt-cuda/download/
Comment by RuRo (ruro) - Thursday, 16 January 2020, 11:10 GMT
Okay, I've installed the arch version of the package and I think, the problem is gone. Thanks.

Loading...