Compiling Error Concrete-Numpy Example

Hi everyone,

I have been trying to run an example form the getting started section of the concrete-numpy documentation for quite some time. Unfortunately, I still haven’t been successful.

import concrete.numpy as cnp

def add(x, y):
return x + y

compiler = cnp.Compiler(add, {“x”: “encrypted”, “y”: “clear”})

inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1)]
circuit = compiler.compile(inputset)

x = 4
y = 4

clear_evaluation = add(x, y)
homomorphic_evaluation = circuit.encrypt_run_decrypt(x, y)

print(x, “+”, y, “=”, clear_evaluation, “=”, homomorphic_evaluation)

I run Ubuntu 20.04 LTS in a virtual machine.
I installed/use:

  • Python 3.8
  • concrete-numpy v0.11.1 (installed via pip install concrete-numpy)
  • concrete-compiler 0.23.4

When running the example, I get the following trace output:

Any ideas, what could be the cause for this issue. If I missed any information required to solve this, please let me know.

Sebastian

Hi Sebastian, and welcome to the community!

Could you also mention the error you got, as I can’t seem to find it in the screenshot you posted, is it an Illegal Instruction, or a Segfault?

It says
Process finished with exit code 132 (interrupted by signal 4: SIGILL)

Okay, so an illegal instruction was reached, which can be caused by two things:

  • You have an old CPU that doesn’t support AES instructions
  • You have a CPU that supports those instructions, but they aren’t being exposed to the virtual machine.

First case is quite complicated, as we currently make use of AES instructions during key generation, and we will have to release a future version that supports CPUs without these instructions. If you have another machine with a CPU that supports them, then you can just try there.

Second case is about enabling these instructions to be accessible to the VM. So you want to search “how to enable aes cpu instructions on …” with the virtualization software you are using.

First of all, thanks for the kind support in this community!

Indeed, the AES instructions have not been exposed to the virtual machine.
I managed to make this work by updating virtualbox.
Now, AES instructions are available, as you can see in the console output.

Unfortunately, the result is still exactly the same. Do you have another idea?

Let’s try to get some other info to figure out what’s happening:

  • To confirm it’s happening during keygen, could you run your script interactively, but instead of encrypt_run_decrypt, just run circuit.keygen()? Your interpreter should fail during this call
  • Also, what is the host machine (the machine you are running virtualbox on)?
  • Could you also give the output of lscpu from the virtual machine? As well as the host machine (or other equivalent command if not Linux)

Sorry for the late reply. I was busy with other stuff.

Finally, I got my hands on a pure linux machine, where everything works fine.

I suppose, the issue is somehow related to having a Win10 Host PC and an Ubuntu Client. As I can work now, I won’t pursue to find a solution any further.

Thanks a lot for your support! This community is very helpful!

2 Likes