2

I'm just trying to get dotnet core running on an NVidia Jetson Nano.

I've created a simple "hello world" app in dotnet core and packaged it as a stand-alone app targeting linux-arm. When I put it on my Synology NAS, I can navigate to the publish directly and type ./HelloDotNetCore and the app runs, albeit with a few errors.

/HelloDotNetCore/HelloDotNetCore/bin/Release/netcoreapp3.1/linux-arm$ ./HelloDotNetCore
./HelloDotNetCore: /lib/libstdc++.so.6: no version information available (required by ./HelloDotNetCore)
./HelloDotNetCore: /lib/libstdc++.so.6: no version information available (required by ./HelloDotNetCore)
./HelloDotNetCore: /lib/libstdc++.so.6: no version information available (required by ./HelloDotNetCore)
./HelloDotNetCore: /lib/libstdc++.so.6: no version information available (required by ./HelloDotNetCore)
./HelloDotNetCore: /lib/libstdc++.so.6: no version information available (required by ./HelloDotNetCore)
Hello World!

I can run it on my Raspberry Pi, as sudo

/HelloDotNetCore/HelloDotNetCore/bin/Release/netcoreapp3.1/linux-arm $ sudo ./HelloDotNetCore
Hello World!

I've "installed" dotnet core by following the tutorial here: https://blog.headforcloud.com/2019/04/03/jetson-nano-a-quick-start-with-.net-core-3/ (it's not actually an install, just exposing the binary to bash)

/code/HelloDotNetCore/HelloDotNetCore$ dotnet run
Hello World!

However, attempting to run this as a stand-alone app on my NVidia Jetson results in "No such file or directory". I've tried the old obvious chmod +x and chmod 777 tricks along with running as sudo, but there's no other clue as to what it's looking for that isn't there.

/code/HelloDotNetCore/HelloDotNetCore/bin/Release/netcoreapp3.1/linux-arm$ ./HelloDotNetCore
-bash: ./HelloDotNetCore: No such file or directory

So it seems that something that should be packaged with this stand-alone app isn't there, but I'm lost as for how to figure out what it needs. Any ideas?

Banjo Batman
  • 159
  • 11
  • In linux there is a kernel that blow the operating system and is different for each device. So you may need to update the kernel. – jdweng Nov 03 '20 at 18:29
  • Can you run a `uname -a` on your Jetson and post the output? Same for `file ./HelloDotNetCore` (the same one that complains about "No such file or directory"). – omajid Nov 03 '20 at 19:34
  • ``` 1 SMP PREEMPT Fri Oct 16 12:32:46 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux ``` – Banjo Batman Nov 03 '20 at 19:37

1 Answers1

1

I found the culprit. The runtime for the NVidia Jetson needs to be explicitly set to linux-arm64, and not linux-arm. If you run the application from a Jetson using the dotnet command

dotnet run

it will compile the application into the associated debug or release folder and then you can run it from that folder using

./HelloDotNetCore

However, in order to "publish" the app from visual studio, I had to update my Microsoft.NETCore.Platforms package via NuGet from here https://www.nuget.org/packages/Microsoft.NETCore.Platforms/ This automatically updated my .csproj file to

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NETCore.Platforms" Version="3.1.3" />
  </ItemGroup>

</Project>

Then manually alter the RuntimeIdentifier element of the .pubxml file to reflect the linux-arm64 architecture.

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>True</PublishSingleFile>
    <PublishTrimmed>False</PublishTrimmed>
  </PropertyGroup>
</Project>

I was then able to publish the app using the publish command in Visual Studio, which built a stand-alone application inside a folder called 'publish'

Now, I get the expected result.

Jetson:/code/publish$ ./HelloDotNetCore
Hello World!
Banjo Batman
  • 159
  • 11