How can i use NxSDK

Hello friends
How can I use NxSDK to develop SNN on Loihi Chip?

Hello @samir , welcome to our community!

NxSDK as you know is a proprietary software by Intel and is not publicly viewable. If your end goal is to develop SNNs to run on Loihi Chip, then there are two ways. One is of course to use NxSDK to develop one, instructions/tutorials of which can be found on INRC forum. Second method is to use NengoLoihi; it is a python package which is used to run Nengo models on Loihi and uses NxSDK as its backend. You can find more info about NengoLoihi here.

I am linking few examples below as well which shows how to use NengoLoihi for deploying SNNs on Loihi.
https://www.nengo.ai/nengo-loihi/examples/mnist-convnet.html
https://www.nengo.ai/nengo-loihi/examples/cifar10-convnet.html
You can find more examples here.

Apart from this, I myself have a question on how to extend NengoLoihi with new NxSDK code, and waiting for response. Thought to mention the above sources to you in case you weren’t aware of and if your requirements could be fulfilled by what’s already available. Experts, please feel free to correct me if I am wrong somewhere.

thanks my friend
If I want to use NxSDK, where should I apply or where should I register? Does Intel give me NxSDK access for free? Can I use NengoLoihi to get the power consumption of the Loihi chip?

For NxSDK access, you or your employer/supervisor should enter into an agreement with Intel. You can do so by emailing them at inrc_interest@intel.com. Once registered there, you will be given access to VMs which will (I suppose) allow development and deployment of SNNs using NxSDK API. I haven’t used their NxSDK API yet, but I guess they provide support for running NengoLoihi models as well.

Not sure if NengoLoihi can give you an estimate of power consumption, but KerasSpiking does.

Yes, you can! :smiley:
The NengoLoihi API provides a reference to the nxsdk_board object, which you can use to collect energy data. There are several forum threads discussing these energy probes, and how to use them. For quick reference, the code below demonstrates how to configure the network to probe energy usage for a model called model:

from nxsdk.graph.monitor.probes import PerformanceProbeCondition
from nxsdk.api.n2a import ProbeParameter
run_time = 1  # Run for 1 s

with nengo_loihi.Simulator(model, dt=dt) as sim:
    board = sim.sims["loihi"].nxsdk_board
    probe_cond = PerformanceProbeCondition(
        tStart=1, tEnd=int(run_time / dt), bufferSize=1024 * 5, binSize=4)
    e_probe = board.probe(ProbeParameter.ENERGY, probe_cond)

    sim.run(run_time)

@xchoo, Are you suggesting that NengoLoihi can measure power estimates using the Loihi board simulator itself and a physical Loihi board isn’t necessarily required?

No. The code I posted requires the simulation to be run on the physical board itself to collect the energy numbers. If the board isn’t available, the nxsdk_board object cannot be created (or used).

Got it… thanks for confirming!