yaroslavvb / tensorflow-community-wheels

Place to upload links to TensorFlow wheels
452 stars 35 forks source link

TensorFlow 1.13.1, GPU (CC 3.0) (CUDA 10.0, cuDNN 7.4), Without AVX, Python 3.6, Ubuntu 18.04 #107

Open edaustin opened 5 years ago

edaustin commented 5 years ago

Edited: I managed finally to build (Link below).

edaustin commented 5 years ago

I believe this will require:

Selecting CC 3.0 in config

deleting line in tensorflow/tensorflow.bzl (enables SSE instructions) (I think...) Ref: https://github.com/tensorflow/tensorflow/blob/c4b09b5df79625a70853fd66b5caa7dd92fb4d1f/tensorflow/tensorflow.bzl#L130

and editing: tensorflow/core/platform/cpu_feature_guard.cc Disabling the checking!

edaustin commented 5 years ago

OK, I have built the wheel on my Xeon, took six hours, but works!

Tensorflow 1.13 No SSE4/AVX instructions Computing Capability 3.0 CUDA 10.0 cuDNN 7.4.2

This should run on any machine... even the oldest... with an older GPU card.

Will upload tomorrow!

Edited: Tested and works great with a GTX 760 4GB (2013) and a Dell T5400 Xeon E5430 Workstation (2008) - runs everything fine on the GPU, and this build will not bug you with AVX/SSE/CC warnings...

edaustin commented 5 years ago

https://drive.google.com/open?id=1PPXdJTRnnLobgjwFnFe4BtVhLKHv1ILJ

Just made public access - please send me a message if you have any issues!

rahulkmr1 commented 5 years ago

Works for me on my laptop with NVIDIA GT750M 4GB VRAM, i7, 8 GB RAM, ubuntu 18.04, nvidia-drivers-418, CUDA 10.

I created an anaconda environment with python 3.7 and tried installing it but didn't work. Then I used python 3.6 instead and it worked.

Could you please somehow also build this for python 2.7 with cc 3.0?

edaustin commented 5 years ago

Hi there

I am away this weekend but will try for you early next week unless somebody beats me to it. I am not an expert in bazel and so not sure how successful the build will be, but will try!

Ed

iridiumblue commented 5 years ago

Well done! I think you just saved me three days work.

edaustin commented 5 years ago

Great!

rahulkmr1 , Ah, sorry work got in the way, do you still need the new version? I'll build later today!

iridiumblue commented 5 years ago

Getting "The TensorFlow library was compiled to use SSE4.1 instructions, but these aren't available on your machine" on my machine.

Using an ancient Intel Core 2 Duo, nvidia-418, python 3.6, cuda 10.0 and cudnn 7.4 .

Weird. I'm going to try the build tweaks you suggest and attempt to build from source ...

edaustin commented 5 years ago

I compiled assuming my Xeon (2007 E5420) didn't have SSE4, but it does I just checked (SSE4.1 / Streaming SIMD Extensions 4.1)... sorry must have slipped up! It does *NOT have AVX definitely.

If you have trouble rebuilding I can have another go at that as well. I have amended the title!

iridiumblue commented 5 years ago

Thanks! So far, been building for 4 hours - the counter is at 7900 (how high does that thing go?) I made the changes you suggest, + commenting the other SSE4.X checks in cpu_feature_guard.

Hopefully the build will succeed, and I'll be happy to share the wheel here - and you can put the title back !

edaustin commented 5 years ago

It may well take around 10 hours or so on your machine to build, it took six to eight hours on my old Xeon. Also, I think that it automatically compiles for the machine it is built on, that is it should work on your machine after build even if you did not make changes, could be wrong though!

iridiumblue commented 5 years ago

You nailed it, 10 hours to the minute! (Counter thingie goes up to 10,800).

I am not too familiar with the Python Wheel sharing thing - I've got the wheel - is it of use to others? Do want it, or is there some other place I should put it? Be nice to spare others the long build.

The specs (CUDA 10.0, etc) are the same as yours, except my graphics card is at CC 6.1 (don't know if that matters.)

edaustin commented 5 years ago

CC 6.1 is newer, probably a GTX 9XX series or 10X0 series (I assume) - the higher the better in terms of features on the card. You can follow the instructions on this site upload the wheel and others can install and use to gain the same features! All they need is the wheel.

Since building this I upgraded my card to a GTX 980, and the build still works OK, I think the CC in the build is just the minimum the build will support, a CC 3.0 card dates from around 2012 with a GTX 6XX series, still usable today.

iridiumblue commented 5 years ago

Yea - it's a GTX 1060 6GB - a kind gift from NVidia. The host machine is ancient - but all it has to do is feed power and data to the GPU, a think a lot of ppl in deep learning (or crypto mining) are using bare-bones hardware for the host machine.

Since you've already got eyeballs on this page, should I just share it here? The credit really goes to you for the tweak to tensorflow.bzl and the cpu_capabilities file.

Otherwise I'm happy to just post it up the canonical way ...

edaustin commented 5 years ago

Sure just posit it on a separate thread... after all, it is your work! Glad you survived the build... bazel is so flakey personally I was expecting it to crash half-way through... but amazingly it completed ))

cryptSky commented 5 years ago

Hi guys! Really appreciate your work!

I have AMD Phenom II X4 CPU and it gets SSE4.1 error on @edaustin build and just "Illegal instruction (core dumped)" with no other message on new @iridiumblue build. Could you share some info on how to build this wheel? Will try to do it myself. Thanks in advance!

iridiumblue commented 5 years ago

Hi guys! Really appreciate your work!

I have AMD Phenom II X4 CPU and it gets SSE4.1 error on @edaustin build and just "Illegal instruction (core dumped)" with no other message on new @iridiumblue build. Could you share some info on how to build this wheel? Will try to do it myself. Thanks in advance!

You probably don't need to do a full rebuild - I would first make super-sure all the requisites are lined up.

Does nvidia-smi report CUDA 10.0 ? Do you have nvidia-418 drivers installed?

cryptSky commented 5 years ago

Hi guys! Really appreciate your work! I have AMD Phenom II X4 CPU and it gets SSE4.1 error on @edaustin build and just "Illegal instruction (core dumped)" with no other message on new @iridiumblue build. Could you share some info on how to build this wheel? Will try to do it myself. Thanks in advance!

You probably don't need to do a full rebuild - I would first make super-sure all the requisites are lined up.

Does nvidia-smi report CUDA 10.0 ? Do you have nvidia-418 drivers installed?

nvidia-smi reports CUDA 10.1, but nvcc -V tells "Cuda compilation tools, release 10.0, V10.0.130". CuDNN is 7.4.2. Driver version is 418.67

I have followed this tutorial to set up everything https://askubuntu.com/questions/1077061/how-do-i-install-nvidia-and-cuda-drivers-into-ubuntu

Not sure what could be wrong here.

iridiumblue commented 5 years ago

Does cat /usr/local/cuda/version.txt

give CUDA Version 10.0.130 ?

cryptSky commented 5 years ago

Hi @iridiumblue, yes, it gives that version.

In fact, I have already build my version locally and now I can import tensorflow. It took 5 hours. The benefit of this approach is that I do not need to search in the code where I need to change so no AVX, SSE, etc. will be used, as it will build on my CPU so it can benefit from all the features it has. For example, AMD Phenom II x4 actually supports SSE and SSE2 so it would be silly not to use those as it will speed up the computation. Build process was simple, far simpler than searching why your version doesn't work on my PC.

For anyone that is interested in the build process, just follow this tutorial https://www.tensorflow.org/install/source Just clone tensorflow, checkout branch 1.13, use Bazel 0.19.2 and start the build.

That's basically it.

sieumap43 commented 3 years ago

Hi. Is the command pip install tensorflow-1.13.1-cp36-cp36m-linux_x86_64.whl the correct command? I'm still facing with the error "The TensorFlow library was compiled to use SSE4.1 instructions, but these aren't available on your machine". I cannot build from source because I am not allowed to install bazel on the server machine at my university.

Specs of the server: Ubuntu 18.04 CUDA 10.0.130 GPU Titan X CPU Quad-Core AMD Opteron(tm) Processor 2376 Python 3.6.9