Nengo-FPGA Connection Error

Hi,

I am using Nengo-FPGA with DE1 board and trying to run some examples from Nengo. However, I received a connection error with the basic example as well as GUI examples.
The details is as followed:

RuntimeError: Received the following error on the remote side <10.162.177.236>:
Traceback (most recent call last):
  File "/opt/nengo-de1/nengo_de1/single_pes_net.py", line 206, in <module>
    run()  # Run the __name__ == __main__ case by default (wrapper function)
  File "/opt/nengo-de1/nengo_de1/single_pes_net.py", line 202, in run
    arg_data_file=args.arg_data_file,
  File "/opt/nengo-de1/nengo_de1/single_pes_net.py", line 43, in main
    nengo_data = NengoData(arg_data_file)
  File "/opt/nengo-de1/nengo_de1/nengo_data.py", line 15, in __init__
    self.sim = arg_data["sim_args"].item()
  File "/usr/lib/python2.7/site-packages/numpy/lib/npyio.py", line 235, in __getitem__
    pickle_kwargs=self.pickle_kwargs)
  File "/usr/lib/python2.7/site-packages/numpy/lib/format.py", line 650, in read_array
    array = pickle.load(fp, **pickle_kwargs)
ValueError: unsupported pickle protocol: 3
    self.udp_socket.recv_into(self.recv_buffer)
OSError: [WinError 10038] An operation was attempted on something that is not a socket
INFO:<10.162.177.236> SSH connection closed

Can anyone help me to see what’s wrong with the python code/my connection?
Thanks in advance.

Kind regards,
Murat Isik

Hi @muratisik, and welcome to the Nengo forums! :smiley:

If you are running just the built in NengoFPGA examples, then they should work. From what I can tell of your output, it looks like the error is on the DE1 board itself. That being the case, can you ensure that you are using the latest NengoFPGA SD image for the DE1? Also, if you can tell me what kind of setup you have (what OS is your host computer, what python version you are running on your host computer, etc.), I can attempt to replicate your setup locally and see if I run into the same issue.

Hi @xchoo,

Thank you for your response. I’m indeed using the latest NengoFPGA SD image. I even reuploaded the SD image for the DE1 just to be sure. However, the problem still persists.
I’m running the setup on a Windows 10 PC with Anaconda, Python version 3.8.8, Nengo version 3.2.0, NengoFPGA version 0.2.3.dev0.

Thanks for the updated information. I do have a Windows10 setup I can use, and will try and replicate the issue locally. I’ll keep you updated with my findings. :smiley:

Hi @muratisik,

I have identified the issue, and it’s going to take a while to implement a proper fix, but I have figured out a temporary solution (just to get it working). Here’s how:

  1. Create a new conda environment
  2. Install numpy < 1.17: conda install "numpy<1.17"
  3. Navigate to the NengoFPGA code repository, and install it (this is as per the online docs): pip install -e .
  4. (This is the important step): Install matplotlib < 3.5: pip install matplotlib<3.5
  5. Now you can install everything else. e.g., pip install nengo nengo-gui jupyter

The thing that was causing the issue is the version of NumPy installed in your environment. NengoFPGA currently has an upper bound of v1.17 for NumPy, and the latest version of matplotlib overwrites this version (installing the latest), which causes this issue. I am working on a more permanent fix that removes the NumPy version dependency, but that will take a while to code and test.

Note that any Python package that enforces a version restriction on NumPy will cause this issue, so you will need to identify and downgrade any of those Python packages. I’ve only identified matplotlib so far since that is really the only package in the installation instructions above that cause this.

@muratisik, I’ve updated the NengoFPGA codebase to remove the NumPy version limit, so the installation instructions in the NengoFPGA documentation should work in all cases now. :smiley:

Basically:

  1. Create a new Conda environment
  2. Clone (or pull from) the NengoFPGA repository
  3. Navigate to the NengoFPGA code repository and do pip install -e .
  4. Install all of the other packages you want (nengo, nengo-gui, jupyter, matplotlib, etc.)

Hi @xchoo,

This indeed fixed the problem that we have. Thank you very much for the quick update.

Kind regards,

1 Like