Your CPU Supports Instructions That This Tensorflow Binary Was Not Compiled To Use: AVX2

Intel proposed the Advanced Vector Extensions (AVX, or Sandy Bridge New Extensions) in March 2008 for use in future generations of Intel and Advanced Micro Devices (AMD) microprocessors.

These extensions were first implemented in Intel’s Sandy Bridge processor, which began shipping in the first quarter of 2011. And in AMD’s Bulldozer processor, which began shipping in the third quarter of 2011.

Your CPU Supports Instructions That This Tensorflow Binary Was Not Compiled To Use: AVX2

A new set of features, instructions, and encoding scheme are all made available by AVX. TensorFlow’s shared library generates this cautionary message. The error message is telling you that the shared library does not include any code that your CPU can understand.

What Does the AVX Mean?

You need to understand what AVX is in order to fix the “Your CPU Supports Instructions That This Tensorflow Binary Was Not Compiled To Use: AVX2” problem.

AVX is an abbreviation for “Advanced Vector Extensions,” which are additions to the x86 instruction set architecture for microprocessors made by Intel and AMD.

A fresh set of features, procedures, and even encoding method are all provided. By releasing additional instructions, AVX2, also called Haswell New Instructions, has increased the size of most integer commands to 256 bits.

Intel’s Haswell CPUs are the first to include this functionality. The FMA was created by the AVX to speed up many processes by using the single-step floating-point multiply-add technique. In addition, AVX makes it easy to utilise and speeds up the algebra computation.

Newer processors with AVX and FMA capability may be quicker than their predecessors. However, this notice may appear if your CPU isn’t AVX-capable.

What Causes this Warning?

Older CPUs may no longer be able to run the binaries after upgrading to TensorFlow 1.6 since they make use of the AVX instruction set.

Therefore, the AVX will not work on older CPUs, and the user of a newer CPU will need to compile tensorflow from source for their CPU.

How to Fix the “Your CPU Support Instructions That This TensorFlow” Error

Is there a way to resolve the error message “Your CPU Supports Instructions That This Tensorflow Binary Was Not Compiled To Use: AVX2“? The caution notice was actually delivered so you’d know you were using a source-built version of TensorFlow.

Ignore these AVX support warnings if your machine has a GPU installed. Well, you may prevent this error notice from appearing again by including the following code. The OS module must be imported into the main application code, and the mapping object must be set.

import os

os.environ[‘TF_CPP_MIN_LOG_LEVEL’] = ‘2’

The following export command in the Unix bash shell is useful.

export TF_CPP_MIN_LOG_LEVEL=2

Build TensorFlow from source with AVX, AVX2, and FMA enabled to maximise CPU usage if you don’t have a graphics processing unit (GPU).

Conclusion

Proposed by Intel in March 2008, Advanced Vector Extensions (AVX) are extensions to the x86 instruction set architecture for microprocessors from Intel and AMD.

AVX was first supported by Intel with the Sandy Bridge processor shipping in Q1 2011, and by AMD with the Bulldozer processor shipping in Q3 2011. A new set of features, instructions, and encoding scheme are all made available by AVX.