1

I'm currently trying to use some pretrained models that are provided as docker image to use for some NLP stuff. The problem however is, that whenever I try to run the docker image I get the following error message:

tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use FMA instructions, but these aren't available on your machine.

I already checked my CPU flags using /proc/cpuinfo/ and can confirm that it does not support fma. I assume there must be some way to recompile the TensorFlow library on my machine so I can run the image, but several google searches yielded no results, so I hope someone could give me some pointers on how to proceed.

K. Meyer
  • 13
  • 2
  • Does this answer your question? [Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2](https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u) – TomTom Mar 14 '20 at 16:27
  • Duplicate of https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this-tensorflow-binary-was-not-compiled-to-u – TomTom Mar 14 '20 at 16:27
  • Either find a docker image that works with your CPU or build one from the sources. – TomTom Mar 14 '20 at 16:27
  • @TomTom No, that question is the exact opposite of my problem. In that question the CPU supports instructions the binary was not build for, so it still works. In my case, the CPU does not support the instructions the binary was build for. – K. Meyer Mar 14 '20 at 16:30
  • Yeah, so the same advice supplies: BUILD YOUR OWN BINARY. A not FMA supporting CPU is quite low end these days - so it is either not something you want to run TF on anyway, OR it is old (and you do not want to run TF on it anyway): Build a binary yourself and WAIT - because thre IS a reason it is built into the binary. Like most people will not even want to try to run on a CPU without it. – TomTom Mar 14 '20 at 17:15

1 Answers1

1

I ran into the same problem while starting the official tensorflow docker in my VM via VirtualBox. And I found maybe it's because of VirtualBox not supporting FMA instructions. In my situation, my laptop does support FMA:

$ cat /proc/cpuinfo
...
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pni dtes64 monitor ds_cpl vmx est tm2 ssse3 **fma** cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt aes xsave osxsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt
...

While in VM, FMA is no longer supported:

$ cat /proc/cpuinfo
...
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase avx2 invpcid rdseed clflushopt
...

So you can try to run it straight on your machine if you are in the same situation as mine.

cheng
  • 11
  • 1