Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Unable to load DLL 'Microsoft.Quantum.Simulator.Runtime' when running Q# test project #1145

Open
rhpreston opened this issue May 17, 2023 · 0 comments
Labels
bug Something isn't working needs triage An initial review by a maintainer is needed

Comments

@rhpreston
Copy link

rhpreston commented May 17, 2023

Describe the bug

The following error message is produced when running a Q# test project on build 0.28.263081:

System.DllNotFoundException : Unable to load DLL 'Microsoft.Simulator.Runtime' or one of its dependencies: A dynamic link library (DLL) initialization routine failed. (0x8007045A)

To Reproduce

Create new default test project:

<Project Sdk="Microsoft.Quantum.Sdk/0.28.263081">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Quantum.Xunit" Version="0.28.263081" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
    <PackageReference Include="xunit" Version="2.4.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
    <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
  </ItemGroup>

</Project>

Run dotnet test from the command line or run the test from the VS test explorer.

Expected behavior

Test should run successfully.

Actual behavior

Project builds fine but throws runtime error above.

System information

  • OS: Windows 22H2 19045.2965, x64-based processor

  • .NET Core Version: 6.0.408

Additional context
I suspect that the problem is related to libomp140.x86_64.dll as in #897. Any help with a workaround would be greatly appreciated.

Note that my ~\.nuget\packages\microsoft.quantum.simulators\0.28.263081\runtimes\win-x64\native contains Microsoft.Quantum.Simulator.Runtime.dll and libomp140.x86_64.dll.

Edit: Confirmed same behavior on Ubuntu 18.04. Also with the default console application.

Edit 2: Latest SDK version that does not give this error on the Windows VM is 0.21.2112180703; this needs the .NET 3.1 runtime installed to build though.

@rhpreston rhpreston added bug Something isn't working needs triage An initial review by a maintainer is needed labels May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs triage An initial review by a maintainer is needed
Projects
None yet
Development

No branches or pull requests

1 participant