This article is deprecated. Please see: Visual Studio Code for the newer article.
Visual Studio Code is a very popular Integrated Development Environment (IDE) which you can run on the NVIDIA Jetson Nano. Looky here:
Background
One of the first questions most people ask when they start using a new platform is “How should I write programs, and what development environments are available?”. Most people have experience with a few development environments, but have their standard gotos with which they are most familiar.
The Jetson Developer Kits support a wide variety of development environments. Most IDEs which run on a Linux platform either work or can be ported to the Jetson. One of the most popular IDEs is Visual Studio Code by Microsoft. Visual Studio Code is often referred to as VSCode. Fortunately, Microsoft offers an open source version of this mainstay of professional developers.
While you can install VSCode from source, there are community builds available for the Jetson. Here we install a build from headmelted.com. Make sure to go over there and give them some love. They have a version which runs on ARM 64 machines such as the Jetson Nano and Raspberry Pi. This saves a lot of work in gathering up the all the necessary libraries and building VSCode from source. Plus, the headmelted.com builds are automated, which means that they will update on an ongoing basis.
Visual Studio Code supports many different programming languages. In the video we add Python support. This is one of the more frequently asked questions here, “Which IDE should we use for Python on the Jetson?”. Try this one, and see how you like it.
Installation
On the JetsonHacksNano account on Github, there is a repository installVSCode. To clone the repository and install VSCode:
$ git clone https://github.com/JetsonHacksNano/installVSCode.git
$ cd installVSCode
$ ./installVSCode.sh
After installation, to run VSCode:
$ code-oss
Because VSCode is a GUI, it’s easiest to watch the video to get a feel on how to add different support features. In the video, we add Python support.
Because installation is from pre-built code, it only takes a few minutes.
Commentary
Right up front, this is a very simple install. Visual Studio Code is a very rich, professional level environment which supports a wide range of activities. It is beyond the scope of a short article or video on how to exploit much of this power.
However, we’ll note here that you may want to add Python environments, or remote developing capabilities. There are other articles out there that cover topics like doing “Remote development from a Windows host to a Jetson Nano using VSCode”. That particular article is well worth reading to get a better understanding of some of the niggles that you will have to overcome for such an endeavor.
Alternate Install
Paul DeCarlo who is currently working at Microsoft has a Github Repository which is modified to build a .deb file for ARM64 (Jetson Nano). The 1.32.3 release of vscode is on the Releases Page. It is easy to install. Download the file and open a Terminal in the directory of the .deb file:
$ sudo dpkg -i code-oss_1.32.3-arm64.deb
Note that you will not need to add certificates to Ubuntu to get this to work, and may be a better solution if you have issues connecting with the ubuntu servers. Also, the reason that the previous method described was selected is that the headmelted.com version is from an automated build system.
Notes
In the video, we use a NVIDIA Jetson Nano Developer Kit and Raspberry Pi camera to clean up the JetsonHacksNano CSI-Camera repository.
The Incidentals
- Jetson Nano
- L4T 32.2.1 (JetPack 4.2.2)
- Visual Studio Code Code-OSS Version: 1.32.0 (user setup)
- Commit: aeaef41d51201e555735f5e8d2f38a9d0ddb9026
- Date: 2019-02-20T06:32:49.577Z
21 Responses
Is it works for TX2?
I believe so. Thanks for reading!
the alternative has a little problem the ‘code’ after ‘-i’ is to much.
After all thanks for the easy tutorials
Thank you for finding this. Fixed in the article. Thanks for reading!
I found that easier to do this – if it works for the use case – is to use vscode from another machine, and use the vscode remote extension (https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack). This is a great way to connect to a jetson tx2 (or a raspberry pi) for that matter, and likely a xavier and nano (I can’t test them, I don’t have them). And you can enable python support or other extension that happen to work for the ARM platform. You won’t get full UI support (like if you’re using openCV for example and need to display an image… unless you try forwarding X11 which may or not work).
as a disclaimer, I do work for Microsoft 🙂
If you’re into remote development, that sounds like a quite splendid solution. Thanks for sharing!
This is fascinating, I have managed to set up with WSL Ubuntu on the W10 PC.
I have the Jetson Xavier NX with JetPack 4.4.
How do I run the VSCode server on this, or will it only fun on Ubuntu server?
Thanks
Works with JetPack 4.3 and takes less than 2 minutes. Thank you Jim.
Thank you for testing! And thanks for reading!
I have a debugging problem with vscode on my Xavier with Jetpack 4.3.
After I upgraded from 4.2.2 to 4.3 and installed vscode the same way, the python debugging isn’t working anymore (timeout problem: debugpy.adapter.components.missing.. Missing Object at 0xblabla to connect).
Do you have an idea?
Best regards,
Simon
I noticed that also. I do not know of a work around at the present time.
There is a bug in the VSCode extension. Here’s the Issue: https://github.com/microsoft/debugpy/issues/84
There is a work around, and a commit has been added with the fix, which should be available soon.
I just bought a jetson xavier nx, new to Linux also.
Python3
Followed this install but I was getting loads of errors as linter did not recognise the openCV modules.
Had to add “python.linting.pylintArgs”: [“–extension-pkg-whitelist=cv2”] into the settings.json file to get it to work.
Now official Visual Studio Code is available for many platforms https://code.visualstudio.com/#alt-downloads
That makes life simpler! Thanks for sending this along, and thanks for reading!
hello sir i have successfully installed visual studio on jetson nano but when i try to import tesseract (optical character recognition engine) it fails. Tesseract is installed on jetson nano still code cant recognise it plz help I have installed tesseract using pip
I don’t have any experience with the package you mention. It is possible that you do not have the path set correctly to find it.
Thanks Kangalow, you save us tons of time!
Just let you know, to run it
$ code-oss
does not work on my Tx2 from my today’s practice (it works before). But
$code
works.
Dear,
I get an visual studio code update of “code_1.59.0-1628120042_amd64.deb
“, but I’m not able to install it or update it on Jetson Nano. Can you help me.
Here is the link: https://code.visualstudio.com/
Thank you!
You appeared to download the .deb package for a PC, which has an Intel type of processor (amd64). The Jetson Nano is an ARM machine (aarch64).
As instructed at the top of this article, you should go here for updated instructions: https://jetsonhacks.com/2020/11/28/visual-studio-code/