dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.87k stars 4.88k forks source link

Remote debugger does not work - arm64v8 .NET Core 2.1 C# console app #1337

Closed IvanFarkas closed 6 years ago

IvanFarkas commented 6 years ago

Remote debugger does not work - arm64v8 .NET Core 2.1 C# console app

General

We should be able to run and debug .NET Core 2.1 C# console app on arm64v8 within a Docker container. DragonBoard 820c is a powerful single board computer to be used as an Azure IoT Edge hub. As many other developers, I'd like to use the arm64v8 DragonBoard 820c to develop powerful IoT and IoMT apps. Let's hope that this will be achieved by .NET Core 2.1 RTM!

Run I can only run .NET Core 2.0 in arm64v8 Docker if I use the source below: Microsoft/dotnet:2.0.5-runtime-stretch-arm32v7 I can't run .NET Core 2.1 at all!

Debug ./getvsdbgshbeta -v latest -r linux-arm -l ~/vsdbg? does not work for .NET Core 2.0. It's from https://vsdebugger.azureedge.net/vsdbg-15-1-11120-1/vsdbg-linux-arm.zip. I can't debug .NET Core 2.0 nor .NET Core 2.1 at all!

gregg-miskelly commented 6 years ago

Microsoft/dotnet:2.0.5-runtime-stretch-arm32v7 is an arm32 image. So I don't see why you can't get debugging to work if you switch to a .NET Core 2.1 tag. Try Microsoft/dotnet:2.1-runtime-stretch-slim-arm32v7. See https://github.com/OmniSharp/omnisharp-vscode/issues/1562#issuecomment-348349242 for more info.

IvanFarkas commented 6 years ago

Have you tried it or just guessing? I did. It does NOT work. I am waiting on your blog post about running and debugging .NET Core 2.1 Alpine, Debian, Ubuntu Linux arm64v8 on a DragonBoard 410c or similar SBCs :-)

gregg-miskelly commented 6 years ago

Not that it matters much, but I have no idea what blog post you are talking about. Microsoft employees aren't assimilated into a collective :).

We have tried ARM debugging with the .NET Core 2.1 preview 1 build. My team doesn't have doesn't have the hardware you are using, so I can't claim my team has tried your exact scenario.

If you want to provide more information, we can see if we can help. If you think you will get more help on whatever blog you are referring to, you are welcome to try that way too.

IvanFarkas commented 6 years ago

I think I was VERY descriptive Gregg! If you would like to provide any constructive feedback as a distinguished member of the Microsoft elite, who do not assimilate with commoners like me, here is your list:

  1. Write a simple .NET Core 2.1 console app that counts up and the output is logged into a file and also visible on the console.
  2. Put the app into a Docker container.
  3. Run the app in Docker container on your PC.
  4. Debug the app in Docker container on your PC.
  5. Deploy the app onto an amd64v8 architecture like the DragonBoard 410c (DB410c), DragonBoard 820c (DB820c) or any other amd64v8 SBC (single board computer).
  6. Run the app in Docker container on the amd64v8 SBC.
  7. Remote Debug the app in Docker container on the amd64v8 SBC.

Thank you very much for your constructive help in advance Gregg!

h3smith commented 6 years ago

Ah yes the old condescending approach to asking for help in open source projects. Always works out well.

IvanFarkas commented 6 years ago

No. It's a product.

Petermarcu commented 6 years ago

@IvanFarkas you said:

I can't run .NET Core 2.1 at all!

What error are you getting? Segfault? I'm trying to get my hands on one of these boards to try what you are doing but I don't have one right now. I've only tried it on Raspberry Pi 2 and 3.

IvanFarkas commented 6 years ago

At the .NET Core Runtime & Host Setup Repo GitHub page we find all supported runtimes. Mostly x64 that is more precisely the amd64 architecture. Only the following arm architectures are supported

It seems to me that the only arm64v8 option is Windows IoT.

Microsoft does not have official plans yet to support arm64v8 Linux. That is said since the DragonBoard 820c running the Linaro supported Debian Stretch or Debian Buster would make a killer Azure IoT Edge device!

Petermarcu commented 6 years ago

Arm64v8 chips fully support armv7 instructions and 32bit execution which is what .NET Core requires. https://www.arm.com/files/downloads/ARMv8_Architecture.pdf

The fact that you were able to run .NET Core 2.0 on it shows that it should work. Now, there may be bugs or issues that need to be addressed but it should fundamentally work.

Based on the container you mentioned initially, I'm guessing that you are running on a 32bit OS which would be utilizing the support to run arm32 instructions the same way that Raspberry Pi does.

So in short, based on everything I'm seeing, .NET Core should work there and I'd really like to understand why it doesn't.

Like I said, I'm trying to get my hands on one :)

Petermarcu commented 6 years ago

Are you using a 410c or 820c board? From what I am reading, the 410c is basically the same as a Raspberry Pi 3B as far as chip.

IvanFarkas commented 6 years ago

I was able to run a .NET Core 2.0 console app cross-compiled for arm Linux using the armhf .NET Core 2.0 runtime. The remote debugger does not work.

Microsoft should have an official supported arm64v8 .NET Core 2.1 runtime. Microsoft should provide a Docker image for arm64v8 Linux OSes (Stretch, Buster, Xenial, Bionic) Microsoft also should provide means to remote debug code on the arm64v8 .NET Core 2.1 runtime.

I think it's reasonable given the fact that Microsoft wants Azure IoT Edge to succeed and does not want another Microsoft Bob, or dismal Windows Mobile.

IvanFarkas commented 6 years ago

No! The Raspberry Foundation gets reject chips free from manufacturers. It's armv7. Modern SBCs use arm64v8. I am using 410c and soon 820c.

richlander commented 6 years ago

We are working to make this better ...

We did get remote debugging working on ARM32 in 2.0 (I tested it on my hardware). The instructions are at https://github.com/OmniSharp/omnisharp-vscode/wiki/Remote-Debugging-On-Linux-Arm

I haven't tested it again 2.1, but am happy to, and to improve our docs.

We don't have an official build for ARM64 yet. We want to and @sdmaclea has been doing a great job getting ARM64 closer to test quality so that everyone can try it.

Note that there is no ARM Alpine image on Docker Hub.

Petermarcu commented 6 years ago

I know the intent intent is that debugging fully works for all our supported runtimes.

IvanFarkas commented 6 years ago

@richlander That is great. I can't wait for the arm64v8. Thx for the Alpine Docker info. I removed it from my earlier post.

I will be a speaker at the Orlando CodeCamp this Saturday. Donovan Brown, Principal DevOps Manager on Microsoft's Cloud Developer Advocacy team, will be there too. He is the Key speaker. My topic is Apply Azure IoT Edge to bring disruptive innovation to healthcare

I wanted to have a nice demo of running Azure IoT Edge on the DB410c, but I had to scratch that since remote debugger does not work. It would have been a cool demo to remote debug an Azure IoT Edge module, that is a Docker container, over SSH.

Petermarcu commented 6 years ago

I know you said that you don't like the quality of the Raspberry Pi chips but is it an option for a demo?

IvanFarkas commented 6 years ago

@Petermarcu As a person, I love Raspberry Pi. I have 1 Raspberry Pi 2, 2 Raspberry Pi 3, and several Raspberry Pi Zeros and a Compute Module 3.

As the CEO and Founder of TeleCuris, LLC, a young startup, we have to maintain certain standards of our image. Unfortunately, Raspberry Pi 3 and the Compute Module 3 does not meet those standards and as such we are not able to use them for even a demo.

richlander commented 6 years ago

Similar to what @Petermarcu said ... You have mentioned arm64v8 multiple times but also IoT Edge. I was under the impression that IoT Edge was focused on arm32v7. Our team delivers Docker images to them and I don't believe they have asked us for arm64v8. Can you help us understand where arm64v8 fits in? Is it just that you want it, or is it actually part of the IoT Edge offering?

richlander commented 6 years ago

BTW: I'm happy to setup a call tomorrow if you'd like ... email me at rlander@ms and we can set it up.

IvanFarkas commented 6 years ago

@richlander As I mentioned above it seems that Microsoft does not have an official arm64v8 .NET Core 2.1 runtime and that is tragic! The community needs to push for that. I am currently working on mobilizing the community to ask for correcting this massive oversite.

IvanFarkas commented 6 years ago

@richlander I appreciate the help, Richard. I'll reach out to you to understand each other's needs better and help the community.

IvanFarkas commented 6 years ago

I updated my IvanFarkas/dotnetcore-arm-swig GitHub repo with the help I received from @richlander and @Petermarcu at Microsoft. It works great now using the new arm64 .NET Core 2.1 runtime.