davidenunes / tensorflow-wheels

Tensorflow Wheels
135 stars 9 forks source link

Need TF 2.x CPU-only with SSE4.x/AVX2 for Ubuntu 20.04 #15

Closed hugolafaye closed 3 years ago

hugolafaye commented 3 years ago

Hi,

I don't manage to compile the tensorflow wheel version I need for my computer. Perhaps you could help !

I would like: Tensorflow 2.1 or newer (newer is better !) Python 3.7 or newer (newer is better !) Ubuntu 20.04 CPU-only (no need for CUDA/cuDNN) All supports SSE4.x, AVX, AVX2, FMA, XLA

Do you think you could do that for me ? Thanks.

davidenunes commented 3 years ago

Perhaps I can, what's your CPU microarchitecture ?

hugolafaye commented 3 years ago

Great ! My CPU is an Intel Core i7-10610U (more information on its Intel webpage).

davidenunes commented 3 years ago

Try this wheel: https://github.com/davidenunes/tensorflow-wheels/releases/tag/r2.4.rc2.cp38

since you have Ubuntu 20.04 and your CPU has the same instruction set as my skylake, there should not be any issues

hugolafaye commented 3 years ago

Thank you!

Unfortunately there is an issue during the import of tensorflow... It says: "ImportError: .../libc.so.6: version 'GLIBC_2.32' not found (required by .../_pywrap_tensorflow_internal.so)".

I guess you built the wheel on a system having a newer glibc version than mine. Here are my glibcxx and glibc versions (using command line: strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC): GLIBCXX_3.4, GLIBCXX_3.4.1, GLIBCXX_3.4.2, GLIBCXX_3.4.3, GLIBCXX_3.4.4, GLIBCXX_3.4.5, GLIBCXX_3.4.6, GLIBCXX_3.4.7, GLIBCXX_3.4.8, GLIBCXX_3.4.9, GLIBCXX_3.4.10, GLIBCXX_3.4.11, GLIBCXX_3.4.12, GLIBCXX_3.4.13, GLIBCXX_3.4.14, GLIBCXX_3.4.15, GLIBCXX_3.4.16, GLIBCXX_3.4.17, GLIBCXX_3.4.18, GLIBCXX_3.4.19, GLIBCXX_3.4.20, GLIBCXX_3.4.21, GLIBCXX_3.4.22, GLIBCXX_3.4.23, GLIBCXX_3.4.24, GLIBCXX_3.4.25, GLIBCXX_3.4.26, GLIBCXX_3.4.27, GLIBCXX_3.4.28, GLIBC_2.2.5, GLIBC_2.3, GLIBC_2.14, GLIBC_2.6, GLIBC_2.4, GLIBC_2.18, GLIBC_2.16, GLIBC_2.3.4, GLIBC_2.17, GLIBC_2.3.2

I have read that it is not a good idea to try installing a newer glibc version because of the high risk of crashing dependencies on my system. So unless you can use a different glibc version during your build (highly unlikely I guess), you will probably not be able to build TF for my system...

Do you have other ideas? Perhaps you could tell me how you do your builds in details? So that I can repeat it on my system. Indeed I tried many builds, many configurations, following many solutions from the internet but without any success...

Again, many thanks for your time!

davidenunes commented 3 years ago

I really didn't want to downgrade glibc 1 minor versions just for a build, but if I find the time I guess I can give it a try. I'm on a rolling distro so it's not that big of an issue, just a pain to build it again.

I was checking the repos, it seems that Ubuntu 20.10 comes with 2.32 but 20.04 2.31 is that it ?

hugolafaye commented 3 years ago

Yes exactly, Ubuntu 20.04 comes with glibc 2.31.

If you find the energy to do it someday, I will be glad ! Until then, I will stick with the warning message and execute my deep learning work without the use of the SSE/AVX/FMA instruction set, since although more slowly it works anyway.

davidenunes commented 3 years ago

Downgrading is a pain in the ass, but I'll see if I have time to get a docker image with your requirements, it's the fastest way to do it without changing my system I think, if you do get the time to get me an image with python, bazel etc, ready to build TF let me know I can speed-up the build.

If you're just having difficulties getting the building process going and it's not a matter of resources, perhaps I can write a short post about it ? I'm not sure if what I might have to say is any different from what is the Tensorflow "build from sources" section, but ...

you tell me what works for you

sorry for the late reply, my time limited

davidenunes commented 3 years ago

I'm closing this for now since I don't have the time to build that image right now, but since you made some progress I guess you're ok for now. Feel free to open this issue again if you still need assistance.