My Custom Nvidia Jeson Nano AI project
Categories:
List of dependencies i need for creatiing my project.
Material i used
- Jetson Nano Developer Kit 4GB
- Wall power supply
- Samsung Class 10 MicroSD 32GB
- 120GB SSD
- Sata to USB 3 cable
- Noctua NF-A4x20-PWM
- Xbox Kinect v1
Before Begin
nano: Save and close Nano withCtrl+Xand thenYthenEnter
Download jetson nano
- Download the Jetson Nano Developer Kit SD Card Image, and note where it was saved on the computer.
- Write the image to your microSD card with Etcher.
Install Ubuntu
- Select
I accept the terms of the licensesand continue - Select a language
- Select keyboard layout
- Select time zone
- Choose
computer name,username,create passwordand then keep theRequire my password to login - Select the max size of the usb as the MicroSD is temporary use
- Select the
MAXN - (Default)and click continue to start install - After install login with new created account as steps above
- After first login it will pop a annoying
Keyboard Shortcutswindow…. Close this - And close the other welcome window…
Updating Your Nvidia Jetson Nano
Keep your Nvidia Jetson Nano up-to-date by following these simple steps.
Update Package Lists
- Open a terminal window.
- Run the following command to update the package lists:
sudo apt update
Upgrade Packages
- Continue in the terminal.
- Upgrade the installed packages to their latest versions:
sudo apt upgrade -y - After the upgrade is complete, reboot your device:
sudo reboot now
Clean Up
- Once your device is back online and you’ve logged in, open the terminal again.
- Clean up unnecessary packages and free up space:
sudo apt autoremove -y && sudo apt clean
Extra: Passwordless Sudo
For added convenience, you can configure your user account to use sudo without entering a password.
- Install the
nanotext editor if not already installed:sudo apt install nano - Open the sudoers file using the
visudocommand:sudo visudo - Add the following line, replacing
your_usernamewith your actual username:your_username ALL=(ALL) NOPASSWD:ALL - Save and exit
nanoby pressingCtrl+X, confirming withY, and then pressingEnter.
Wipe SSD and Moving MicroSD to SSD
Mount the SSD in your Jetson Nano
Open
DisksSelect the SSD Disk and Press
Ctrl+FErase:Don't overwrite existing data (Quick)orOverwrite existing data with zeroes (slow)Partitioning:Compatitble with modern systems and hard disks > 2TB (GPT)
Click
Format...Again click on
Formatand wait….. Depends on what u selected (Quick) or (Slow)Now Click on the
+Create PatrtitionI have set the Partition size to 110GB for SWAP (We will use this later this page)
Click Next
Volume Name: Create oneType:Internal disk for use with Linux systems only (Ext4)
Click on
CreateFinnaly mount the SSD
After the SSD is mounted open
Terminalagain as we neednanofor later use.sudo apt install nanoNow we download the repository
bootFromUSBfrom JetsonHacksgit clone https://github.com/jetsonhacks/bootFromUSBEnter the bootFromUSB folder
cd bootFromUSBWe need to have the SSD UUID so
./partUUID.shThis will output ssomething like this
PARTUUID of Partition: /dev/sda1 a40b6c71-ca35-79d3-8an0-d6v66749e060 Sample snippet for /boot/extlinux/extlinux.conf entry: APPEND ${cbootargs} root=PARTUUID=a40b6c71-ca35-79d3-8an0-d6v66749e060 rootwait rootfstype=ext4We only need to remember this part
root=PARTUUID=a40b6c71-ca35-79d3-8an0-d6v66749e060Now let’s move the files from MicroSD to SSD
./copyRootToUSB.sh -p /dev/sda1Now we need to change one part in our SSD
cd /mediaWhen we use the command
lswill see a our current user for me is itsysloginelssyslogineSo we enter the folder
cd syslogineagain when we do the
lscommand we can see our new created SSD for me it ismyprojectlsmyprojectSo we enter the folder
cd myprojectAfter were in the right SSD folder go to
cd boot/extlinuxedit
extlinux.confsudo nano extlinux.confReplace
root=/dev/mmcblk0p1with your SSD one, the one we early noted some where or still have that terminal open
root=PARTUUID=a40b6c71-ca35-79d3-8an0-d6v66749e060Finnaly… Lets shutdown Jetson Nano
sudo poweroffAfter your Jetson Nano is powered off remove the MicroSD card and power on the device again now it should be powering up with the SSD instead of the MicroSD
you can also just watch this video from JetonHacks
Install Jetson stats
- Install
pip3because this is not installed by defaultsudo apt-get install python3-pip -y - Now we can install jetson stats with the
pip3sudo -H pip3 install -U jetson-stats - best way is to restart your jetson nano
sudo reboot now - After restart and logged in run jetson stats
jtop
Make fan start at boot
We need to make the fan start at boot because why not…..This will help to cool your jetson nano allot with compiling and installing packages we need.
Now we will edit
rc.localwith nanosudo nano /etc/rc.localThen add this to the
rc.localfile#!/bin/bash sleep 10 sudo /usr/bin/jetson_clocks sudo sh -c 'echo 255 > /sys/devices/pwm-fan/target_pwm' exit 0Note
You can change the 255 to another value (0~255) to change the speed of fan.Then add execute permission to
rc.localfile.sudo chmod u+x /etc/rc.localAgain we reboot our jetson nano to see if this works
sudo reboot nowAfter 10 seconds when jetson nano is start the jetson clocks should start running
Installation of libusb
First install Deps
sudo apt install libudev-devLets create a fodler and enter it before be continue
mkdir project && cd projectGet the latest version of
libusbwget https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2Now we need to extract it..
tar -xvjf libusb-1.0.26.tar.bz2And i love to work with folder with smaller names so rename it
mv libusb-1.0.26 libusbNow we enter the folder we renamed
cd libusbLet’s create the package or something.
./configure --prefix=/usr --disable-static && makeThats the install
sudo make installafter
make installwas succesful we can remove the .tar.bz2cd .. && rm libusb-1.0.26.tar.bz2