-
Notifications
You must be signed in to change notification settings - Fork 169
qsharp compiler crashes with SIGILL 4 on MacOS #1362
Comments
@qudarr Could you please confirm if you are hitting this issue also without using the debugger? I.e. what is the failure if for the |
@qudarr Which versions of the .NET SDK do you have installed? For reference, the list of supported .NET versions for arm-based Macs can be found here: https://docs.microsoft.com/en-us/dotnet/core/install/macos#arm-based-macs. For now, we do not officially support Apple Silicon systems. However, it would be good to understand what versions and setup is causing it to fail this way. You mentioned that you followed the instructions in the setup page from https://docs.microsoft.com/en-us/azure/quantum/quickstart-microsoft-qc?pivots=platform-ionq. Did you use the manual .NET installation and use the dotnet cli, or did you use a conda/anaconda standalone setup environment? |
Hi swernli, I use .NET version 3.1.413 and QDK version 0.22.187631 from within VS code. Executing code has worked until ~2 weeks ago fine on my arm Mac. The .net installation came automatically with selecting QDK in vs code. Since then I also installed anaconda, but this didn't fix the issue. |
Thanks for the extra info! Since we don't support Apple Silicon, we don't have additional steps for you to take. We'll improve our documentation to make this support statement more explicit, and I'll put a link here and close the issue once that doc update is available. |
I can confirm that I can see the same on my M1 Mac. I saw this immediately after the net6.0 release but didn't have time to look closer at the time, and reverted to .NET Core 3.1 variant (0.21.2112180703) for the time being. Previously QDK was broken with arm64 dotnet SDK (see #1273) but there was a workaround described in that issue where you could use the Rosetta emulate x64 dotnet SDK instead. Since the move of QDK to .net6.0 it has been broken even under the emulated x64. What I see is the following error (which is effectively the same as the issue author's):
This only affects the default full state simulator. Running the same program using e.g. SparseSimulator, ResourcesEstimator or ToffoliSimulator is fine. When the full state simulator is used, something very wrong happens, because it even fails for the most simple program that does not use any quantum state , for example for this:
Given the popularity of arm64 Macs, and the fact you pretty much cannot buy x64 Macs anymore, it would be great to address this. edit: I tried with |
One more thing that I would like to add. Given that illegal hardware instructions are extremely rare for the dotnet runtime, my best guess is that this is not dotnet 6.0 related at all, but simply a native change to the default simulator (such as microsoft/qsharp-runtime#895 or microsoft/qsharp-runtime#897) that is the real root cause, coincided with the move to dotnet 6.0. Rosetta 2 translation is documented to not support AVX instructions so it could be that. |
I can confirm that copying Obviously this is a horrible workaround, but better than nothing! |
Confirm, I tried using the x64 for emulation, but I get no output on |
Unfortunately the workaround I described above is the best I found - copy the simulators runtime from Very fragile and not sustainable though, plus you are stuck on an old simulator so something else will stop working sooner or later. |
@filipw Does your workaround still work? I do not see
|
yes it still works for me, but you need to explicitly install x64 dotnet as well, it will then create the |
@filipw thanks, I didn't realize it required a separate installation. Here are the steps for anyone else trying:
|
Does this solution still work? I tried this on QDK 0.27.244707 and received the following error. |
@TheRyanVaughan Make sure you have .NET 6 installed (both the osx64 and arm64 versions), you might have to uninstall .NET 7 fully before installing them. That fixed it for me! hope this helps! |
When executing the "hello world" code, dotnet crashes with SIGILL 4.
The debugger says: The program '[26917] ExploreInterference.dll' has exited with code 0 (0x0).
It never reaches the breakpoint (see attachment).
Steps to reproduce the behavior:
Any Q# code exits with this behaviour, no matter where I set the break point.
Expected behavior
Terminal output: "Hello quantum world!"
System information
MacOS / VS Code / QDK installation as described in the official documentation: [(https://docs.microsoft.com/en-us/azure/quantum/quickstart-microsoft-qc?pivots=platform-ionq)]
CPUs | Apple M1 (8 x 24)
GPU Status | 2d_canvas: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled webgl: enabled webgl2: enabled
Load (avg) | 1, 2, 3
Memory (System) | 8.00GB (0.11GB free)
Process Argv | --crash-reporter-id 603876e9-96af-49ca-b4fe-d8aa3ee2049e
Screen Reader | no
VM | 0%
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392cf:30425750
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstartedc:30433508
vsclayoutctrc:30437038
vsrem710:30416614
pythonvsnew555cf:30436485
vsbas813:30436447
vscscmwlcmt:30436993
helixcf:30438276
cppdebug:30437093
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/ExploreInterference.dll'. Symbols loaded.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over non-user code 'QsEntryPoint.QsEntryPoint.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Threading.Tasks.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Step into: Stepping over non-user code 'QsEntryPoint.QsEntryPoint.Main'
Step into: Stepping over non-user code 'QsEntryPoint.QsEntryPoint.d__0..ctor'
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Quantum.Runtime.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/netstandard.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Quantum.EntryPointDriver.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/System.CommandLine.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Runtime.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.IO.FileSystem.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Azure.Quantum.Client.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Private.Uri.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.ComponentModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Memory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Buffers.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Diagnostics.Process.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.ComponentModel.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Diagnostics.Debug.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Quantum.Simulators.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Quantum.Simulation.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Quantum.Targets.Interfaces.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Runtime.InteropServices.RuntimeInformation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/Users/user/qsharp/ExploreInterference/bin/Debug/netcoreapp3.1/Microsoft.Quantum.QSharp.Foundation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/3.1.19/System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[24747] ExploreInterference.dll' has exited with code 0 (0x0).
The text was updated successfully, but these errors were encountered: