Error Running - Optimizing a Spiking Neural Network Example

Hmm. That’s really strange, because if you look at the output 2 posts ago, it could load that dll fine.
So… Let’s modify the instructions a bit.

Using the instructions in my previous post, to install the various GPU libraries, do this:

conda install cudatoolkit
conda install -c conda-forge cudnn pyopencl

instead of this:

conda install -c conda-forge cudnn cudatoolkit pyopencl

And then install the rest of the package as per my previous instructions.
Let’s see if this will work for you. :smiley:

Well, I thought I finally had it working with your help of course, but now I’m stuck on the pyopencl package. When I attempt to “import the pyopencl as cl” it can’t find the package, even though it appears to be installed. So close!


When I check the installed packages pyopencl version 2021.1.6 is installed in my nengo-ocl environment, which is a new one that I built from scratch.

I’m going to apologize in advance for having to ask once again, now with the pyopencl, where you think I’m going wrong? I’m also including a pdf of the installed packages within my environment.
env_py37_ocl-nengo.pdf (56.2 KB)

When I get this nengo-ocl environment finally running I’m also planning to work with the CIFAR-10 classifier with a spiking CNN example in the Nengo Extras section which also uses nengo-ocl. And as I look through the NengoOCL webpage, I now see that getting a working installation of OpenCL is a bit tricky.

Thank you.

Oh! I think your GPU might not support OCL 2.1. In which case, a slightly different installation instruction is needed. You will need to go here and download the wheel file for pyopencl‑2021.2.1+cl12‑cp37‑cp37m‑win_amd64.whl.

Next, create a new environment, then when you install the GPU libraries do:

conda install cudatoolkit
conda install -c conda-forge cudnn
pip install pyopencl‑2021.2.1+cl12‑cp37‑cp37m‑win_amd64.whl

You will need to run that pip install command from where you downloaded the wheel file to.

After this, test to make sure that python can detect pyopencl (by printing the cl.get_platforms()[0].get_devices())). If this test is successful, you can then proceed to install the other packages.

xchoo,

Looks like I’ve finally reached a point where my NengoOCL environment is setup correctly. The only change I made from your last set of instructions in the previous post is that I used the 2021.1.5 version of pyopencl you Sent Dr. H. instead of the 2021.2.1 version in the forum instructions: pyopencl‑2021.1.5+cl12‑cp37‑cp37m‑win_amd64.whl instead of pyopencl‑2021.2.1+cl12‑cp37‑cp37m‑win_amd64.whl

I think this might finally close out this thread since the environment now appears to be running correctly.

Thanks again for all your help.

-toddswri

One remaining issue I’m encountering is regarding getting my environment setup correctly for Nengo Loihi. I had asked about this issue earlier in this thread on April 21st. It has to do with getting the correct versions of nengo, nengo-gui, nengo-ocl, and numpy working together.

You had told me in another thread: Cannot convert a symbolic Tensor to a numpy array I should be using Numpy 1.19.2 or 1.19.5 with NengoDL. So I downgraded my numpy from 1.20.1 to 1.19.5.

The primary Nengo example I’m trying to get working is the CIFAR-10 convolutional network. I have added everything I think I need to my basic cpu environment and am attaching a file for my installed packages.
py37_envirList_24-May-21.pdf (58.8 KB)
It appears I’m back to my circular problem of getting the correct versions of nengo, nengo-ocl, and nengo-gui. After I downgrade my numpy to 1.19.5, I end up getting out of sync with my other packages.

So I’m still trying to figure out if I have installed the proper combination of versions for the following packages:
Nengo 3.0.0
NengoDL 3.4.0
Nengo-Loihi 1.0.0
Nento-OCL 2.0.0
Numpy 1.19.5

As always, thank you for your support.

I spoke to the Nengo devs and we figured out a solution to the package conflicts. The main problem lies with NengoGUI being slightly outdated. We do have a release incoming, but for now, this will address the issues you are having:

pip install nengo nengo-ocl nengo-dl nengo-loihi
pip install git+https://github.com/nengo/nengo_gui.git@spike_raster_fix --no-deps

Note that this requires that you have git installed on your computer, or in your environment. If you do not have git installed, you can do it with: conda install git before you install the NengoGUI package.

Thank you. We will give it a go and report back.

Very exciting, everything seems to be working properly. I’m getting a couple warnings that seem to pretty much match up with the example posted on the Nengo website, but everything else is working smoothly.

I really appreciate the time and effort you all have provided helping me getting this up and running.

Have a great Memorial Day weekend!

-ToddSwRI

That’s great! :smiley:

1 Like