question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IoT Edge Build on Dev Box AMD64 Deploy to ARM64v8

See original GitHub issue

I have an NVIdia Jetson TX2 that ive successful hooked up to IoT Hub. its an ARM64v8 ( arch64 ) device.

but my development environment is AMD64.

when i try to build the solution it fails with standard_init_linux.go:190: exec user process caused “exec format error”

Step 1/12 : FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster-arm64v8 AS build-env —> 0ca5aebeb047 Step 2/12 : WORKDIR /app —> Using cache —> 6c2033b25d95 Step 3/12 : COPY *.csproj ./ —> Using cache —> 0ba74f345874 Step 4/12 : RUN dotnet restore —> Running in 4a648bee3a74 standard_init_linux.go:190: exec user process caused “exec format error”

it works fine when i set my environment to AMD64, it even runs on the Nvidia jetson! but i cant build it from my local machine.

i got here because i started with the following https://github.com/toolboc/IntelligentEdgeHOL then when that didnt work for me i found your article https://devblogs.microsoft.com/iotdev/develop-and-debug-arm64-iot-edge-modules-in-visual-studio-code-preview/

Expected Behavior

Be able to develop modules in my development machine and just press a button and deploy them to the device.

Current Behavior

not able to build and this push my module because my dev machine is a different architecture than the edge device even though both are 64 bit and bott run Ubuntu 18.04

Steps to Reproduce

  1. Preferences Settings.json…
"azure-iot-edge.platforms": {
    "amd64": [],
    "arm32v7": [],
    "windows-amd64": [],
    "arm64v8": [],
},
"azure-iot-edge.version.csharpmodule": "3.0.0-alpha"
  1. Set default platform to arm64v8
  2. create a new edge solution and C# module
  3. try to build and push

Context (Environment)

dev box: ubuntu 18.04 edge device: nvidia jetson tx2

Output of iotedge check

sudo iotedge check [sudo] password for meta: Configuration checks

√ config.yaml is well-formed √ config.yaml has well-formed connection string √ container engine is installed and functional √ config.yaml has correct hostname √ config.yaml has correct URIs for daemon mgmt endpoint ‼ latest security daemon Installed IoT Edge daemon has version 1.0.8~rc1 but version 1.0.8 is available. Please see https://aka.ms/iotedge-update-runtime for update instructions. √ host time is close to real time √ container time is close to host time ‼ DNS server Container engine is not configured with DNS server setting, which may impact connectivity to IoT Hub. Please see https://aka.ms/iotedge-prod-checklist-dns for best practices. You can ignore this warning if you are setting DNS server per module in the Edge deployment. ‼ production readiness: certificates Device is using self-signed, automatically generated certs. Please see https://aka.ms/iotedge-prod-checklist-certs for best practices. √ production readiness: certificates expiry ‼ production readiness: container engine Device is not using a production-supported container engine (moby-engine). Please see https://aka.ms/iotedge-prod-checklist-moby for details. ‼ production readiness: logs policy Container engine is not configured to rotate module logs which may cause it run out of disk space. Please see https://aka.ms/iotedge-prod-checklist-logs for best practices. You can ignore this warning if you are setting log policy per module in the Edge deployment.

Connectivity checks

√ host can connect to and perform TLS handshake with IoT Hub AMQP port √ host can connect to and perform TLS handshake with IoT Hub HTTPS port √ host can connect to and perform TLS handshake with IoT Hub MQTT port √ container on the default network can connect to IoT Hub AMQP port √ container on the default network can connect to IoT Hub HTTPS port √ container on the default network can connect to IoT Hub MQTT port √ container on the IoT Edge module network can connect to IoT Hub AMQP port √ container on the IoT Edge module network can connect to IoT Hub HTTPS port √ container on the IoT Edge module network can connect to IoT Hub MQTT port √ Edge Hub can bind to ports on host

One or more checks raised warnings. Re-run with --verbose for more details.

Click here
// Paste here

Device (Host) Operating System

Ubuntu 18.04

Architecture

amd64

Container Operating System

Linux

Runtime Versions

iotedged

Edge Agent

1.0.8

Edge Hub

1.0.8

Docker

<Run `docker version` (`docker -H npipe:////./pipe/iotedge_moby_engine version` for Moby on Windows) and paste here>

dev box : 18.03.1-ce device: 18.09.2

Logs

iotedged logs
<Paste here>
edge-agent logs
<Paste here>
edge-hub logs
<Paste here>

Additional Information

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
philipktlincommented, Aug 12, 2019

If I understand correctly, you want to build a ARM64 docker image running your .net console app on amd64 machine. To do this, you need to have 2 stages in docker file. I drafted a sample docker file for your reference below.

FROM <amd64 docker image> AS builder #don’t run dotnet restore dotnet publish -r linux-arm64 -c Release -f netcoreapp2.1

FROM <arm64 docker image with .net core correct version> COPY --from=builder <exe file path in builder> <destination path> CMD <destination path>

Read more comments on GitHub >

github_iconTop Results From Across the Web

IoT Edge C Module Fails to Initialize with ARM64v8 #1589
Hi, I am trying to get an ARM64v8 build on my nvidia platform and run my simple program to test communications. I have...
Read more >
A Workaround to Run Azure IoT Edge on ARM64 Devices
Compile both Azure IoT Edge security daemon and hsmlib for ARM64 from source code, or use the pre-built binaries from the community (for...
Read more >
Generally available: Azure IoT Edge tools for Visual Studio ...
Download and install the Azure IoT Edge tools for Visual Studio extension that includes latest features and .NET 6 support in Visual Studio ......
Read more >
Unable to build image for module on ARM64 on azure ...
I am able to successfully build and deploy image for my module on amd64 architecture. However the build fails for arm64 architecture using ......
Read more >
Azure IoT Edge Tools for VS 2022
Azure IoT Edge Tools makes it easy to code, build, deploy, and debug your IoT Edge solutions in Visual Studio 2022, by providing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found