Illegal instruction error on Centos7 setup

I’ve been trying to setup my rasa chatbot on my Centos 7 server but I keep getting “Illegal instruction” whenever I try to train my model.

This is the rasa version I’m using:

Rasa Version : 2.8.12 Minimum Compatible Version: 2.8.9 Rasa SDK Version : 2.8.2 Rasa X Version : None Python Version : 3.7.12 Operating System : Linux-3.10.0-1160.53.1.el7.x86_64-x86_64-with-centos-7.9.2009-Core Python Path : /usr/local/bin/python3.7

did you update the OS?

I’m using VirtualBox and yes I’ve updated it.

@umaroa can you use the Ubuntu server or are you only allowed to use Centos 7 ? What is your system (VM) configuration?

@umaroa can you update the TensorFlow version? or can you share the TensorFlow version please using pip list?

@umaroa Did you created the environment for the project using Conda ?

@umaroa can you share the full traceback of the error when you train the model?

Do you see this error if you run python -c "import tensorflow" in your virtual environment? Do you have a 32-bit or 64-bit architecture?

Run more /proc/cpuinfo | grep flags | grep avx. If you don’t see a result, it means your CPU does not support machine learning, no matter what VM you use.

Furthermore, it is recommended to use Ubuntu as mentioned in the docs.

@ChrisRahme

I see this error when training the initial model after rasa init. I have a 64-bit architecture.

I tried running more /proc/cpuinfo | grep flags | grep avx but got no result.

I will try installing on Ubuntu.

I am only supposedly allowed to use Centos 7 but if all else fails, I will try using Ubuntu.

I am using TensorFlow version 2.6.0

I did not create the environment using Conda.

Here is the full traceback:

[rasabot]$ rasa init
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
/usr/local/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144 from C header, got 152 from PyObject
  return f(*args, **kwds)
Welcome to Rasa! 🤖

To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.
Now let's start! 👇🏽

? Please enter a path where the project will be created [default: current directory]
? Directory '/var/www/rasabot' is not empty. Continue? Yes
Created project directory at '/var/www/rasabot'.
Finished creating project structure.
? Do you want to train an initial model? 💪🏽 Yes
Training an initial model...
Illegal instruction

@umaroa can you create the environment and then try to install it?

It means your hardware cannot support Rasa, or machine learning in general.

@ChrisRahme I got this error:

kernel: traps: rasa[27708] trap invalid opcode ip:7f69c0a210a0 sp:7ffc99ef9e38 error:0 in _pywrap_tensorflow_internal.so[7f69b03dc000+2b32f000]

These are the specs of my server:

Memory: 16GB
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 37
Model name: Intel(R) Xeon(R) CPU E7-4820 v4 @ 2.00GHz
Stepping: 1
CPU MHz: 1995.192
BogoMIPS: 3990.38
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 25600K
NUMA node0 CPU(s): 0,1
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes hypervisor lahf_lm tsc_adjust arat```

Another proof that your OS is incompatible with Tensorflow.

This is probably because you are using Rasa on CentOS not Ubuntu, but the first error should still remain in both cases.

@ChrisRahme I have a workmate who tried it on a different CentOS setup and it worked. Why is that? These are his specs:

@umaroa Did you created the conda environment and tried to install it? Thanks and good luck with your project.

@nik202 Hi! Yes, I am still trying. Unfortunately, my internet connection is pretty bad right now. I’ll get back to you once I’ve done it. Thanks!

As you can see, their hardware supports AVX.

They will get a result when running more /proc/cpuinfo | grep flags | grep avx.

@nik202

Hi! I created the conda environment on Centos7 and installed Rasa there but I still got the Illegal instruction response when training the initial model. I’ll try with Ubuntu next.

@ChrisRahme I see. May I ask what its purpose is? I’m confused because the Centos 7 server processor also supports AVX. Is there something else that I need to get it to work? Should it be AVX or AVX2?

Yes, CentOS supports AVX but your hardware does not even have it.

It does not matter if it’s AVX or AVX2.

There is a way to use Tensorflow without AVX by building it from source, but it is outside the scope of Rasa and my knowledge. You can check out this Stack Overflow post.

Thank you for your help. We’ve updated the CentOS server to support AVX and it is now working.

1 Like

Glad to know :slight_smile: