Jetson Nano - A quick start with .NET Core 3
By Shahid Iqbal on 03 April 2019
I’ve recently purchased a Nvidia Jetson Nano devkit and I’m excited by the possibilities this device opens up. The Jetson Nano is a small computer from Nvidia focussed on AI scenarios and it’s priced at a very reasonable $99 (~£95). With a form factor similar to a Raspberry Pi (RPi) and with similar support for many peripherals and add-ons I can this being very popular with home enthusiasts and makers, much like the RPi is.
The AI capabilities of the Jetson are powerful and I’ll explore those in another post, in the meantime you can checkout Nvidia’s material if you can’t wait.
Initially I wanted to flex my existing skills and see if I can get some .NET Core code up and running, we won’t be doing anything that uses the AI power of the Jetson in this post but you can imagine combining .NET Core with something like ML.NET and or Azure IoT Edge to create some very cool things!
And obviously you can use the device with the vast Python based examples/projects that is the usual route for AI/ML scenarios.
Ultimate the Jetson Nano is an ARM64 computer running Linux so the instructions for installing and running .NET Core are not that different to any other ARM64 device. This guide is intended to help those who may not be very comfortable with Ubuntu.
What you’ll need
- A Jetson Nano dev kit (buying details)
- A microSD card (ideally 32gig+)
- A micro USB power supply (5v 2amp) - an official RPi one should work
- A USB keyboard & mouse
- Monitor (HDMI/Display port)
- A wired network, as there is no built-in WiFi :(
Once the device is setup you can access it remotely so wouldn’t need the peripherals or monitor after the initial setup.
Setting up the Jetson Nano
The instructions for setting up the Jetson are reasonably straightforward so rather than repeat those here I’ll link to the Nvidia documentation.
At the end of these instructions you should have the Jetson setup and have an Ubuntu desktop available.
Install .NET Core on the Jetson Nano
The Jetson is an ARM64 device running Linux and therefore we need to use .NET Core. Although I believe support for ARM64 was included from .NET Core 2.1 in this example I’ll use the latest .NET Core 3 preview bits.
Download the latest .NET Core 3 bits into a folder. Ensure you download the ARM64 SDK binaries (should be a tar.gz file).
Open a terminal window by right-clicking the desktop and selecting Open Terminal
Navigate to the folder where you downloaded the SDK (remember Linux is case sensitive)
Create a dotnet folder in your home folder and untar the binaries
mkdir -p $HOME/dotnet && tar zxf <downloadedFile> -C $HOME/dotnet
We now need to add some paths to the terminal profile (so they are available every time we open the terminal).
Edit the bash profile using Vim (if you’re unfamiliar with Vim you’ll need to know some basic commands to avoid needing to restart your computer to exit it ;)
Scroll to the bottom of the bash profile and add the following lines
Save the profile and exit
Test that dotnet core is installed by closing the terminal window and re-opening a new terminal and typing
which should display something like this:
Congratulations you’ve got .NET Core running on the Jetson Nano
Creating a hello world application
This is now the same process as you would use to create an application using the .NET CLI on any platform
Create a new folder and move into it
Create a new .NET Core console application
dotnet new console -n hello-jetson-nano
If all is working you should get a new project created for you
Move to the newly created project folder and run dotnet run
And there we are our first .NET Core application on the Jetson Nano!
It’s worth remembering that dotnet run will compile the code everytime you run it so it may appear to be a little slow to execute. If you want to simply execute the generated binary you need to run
And you should see this executes almost immediately.
This quick guide was designed to help you get started with .NET Core on the Jetson (or any other ARM64 device).
In subsequent posts we’ll dive a little deeper into AI/ML scenarios and start to see how we can utilise the power of the Jetson.