-
Notifications
You must be signed in to change notification settings - Fork 169
QDK is broken when ARM64 .NET 6 SDK is installed #1273
Comments
Thanks for the report, @filipw! We're currently working on adding support for .NET6 in the QDK, and we'll consider this issue as part of the work we're doing. |
I believe .net6 support was added a few weeks ago, but I am still getting this same issue:
|
same here, on a M1 Mac mini, with latest Microsoft.Quantum.ProjectTemplates so definitely still not fixed |
@ricardo-espinoza is there any possibility to fix this issue? It seems the x64-simulation workaround that @filipw had described in the OP does not work anymore. EDIT: it still works, but requires extra hoops to jump. |
Currently trying the workaround suggested by @k4rtik but this does still seem to be an issue on my M1 Max MacBook. Additionally, running in a container (such as mcr.microsoft.com/quantum/samples) doesn't work either, presumably because the container is only trying it's best to pretend it's x86 without actually emulating it properly. |
I thought I'd give it a try with the latest version of dotnet and quantum SDK, but it's still broken with .NET 7 and QDK version 0.27.238334. |
Unfortunately yes, it is still broken (yesterday was the 1st birthday of the bug report 🎂😀) - but the workaround with using the old simulator, and the x64 Rosetta emulation still works (although it's far from ideal) |
Still not working on Mac M1 2020 :/ |
A good alternative at this point is to compile to QIR and use a QIR runner instead |
still not working on Mac M1 with Venture 13.1. |
I believe they released a new QDK that works universally: https://github.com/microsoft/qsharp |
Describe the bug
Since .NET 6 introduced the split into how the ARM64 and x64 SDKs are installed, the experience with Q# is broken on ARM (where things used to work OK through emulation). I can only speak about MacOS here, but it could be that other platforms experience the same.
If you have .NET 6 ARM SDK installed, and x64 versions of SDK 5.x.x and 3.1.x, the "dotnet" command from the CLI points to the ARM SDK.
/usr/local/share/dotnet
/usr/local/share/dotnet/x64
This leads to a lot of things breaking in Q# such as, trying to run/compile the program does not work:
The actual problem is ARM incompatibility:
Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/filipw/.nuget/packages/microsoft.quantum.sdk/0.19.2109165653/tools/utils/Microsoft.Quantum.Sdk.BuildConfiguration.dll'. An attempt was made to load a program with an incorrect format.
The current workaround, although not ideal is to export the x64 path as dotnet, which bypasses the native ARM SDK
though doing this globally is of course not really feasible so it's needed per terminal session which is not great.
To Reproduce
Setup NET 6 SDK according to the instructions in dotnet/sdk#22380
Expected behavior
Either everything works out of the box, or I have an option to provide custom path to the "dotnet" executabale, rather than QDK taking it from the path. In the latter case, I could just point it at
/usr/local/share/dotnet/x64
System information
dotnet info:
dotnet x64 info
The text was updated successfully, but these errors were encountered: