Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No executable found" when integrating Microsoft.ML.OnnxRuntime.DirectML #472

Closed
llfab opened this issue May 6, 2024 · 8 comments
Closed
Labels

Comments

@llfab
Copy link

llfab commented May 6, 2024

Describe the bug

When I have integrated a reference to DirectML using
<PackageReference Include="Microsoft.ML.OnnxRuntime.DirectML" Version="1.17.3" Condition="'$(Configuration)' != 'Debug'" />
the previewer fails with "No executable found".
image

The Log is as follows:
image

When I switch to Debug (where DirectML is deactivated), close the last xaml document and re-open the xaml document, the previewer works with the following output:
image

This may be due to DirectML being Windows only. Potentially, that changes the Runtime Identifier or TargetPlatformIdentifier under the hood causing the previewer execution detection to fail.

To Reproduce

As above integrate DirectML, rebuild and re-open xaml file

AvaloniaVS plugin version

11.5

Avalonia version

11.0.10

Visual Studio version

17.9.6

Relevant log output

08:30:11.667 [Information]  Stopping previewer process
08:30:13.381 [Error]  No executable found
08:30:17.100 [Information] 0 Stopping previewer process
08:30:17.186 [Error]  No executable found
08:30:19.955 [Information] 0 Stopping previewer process
08:30:20.032 [Error]  No executable found

Additional context

No response

@llfab llfab added the bug label May 6, 2024
@llfab
Copy link
Author

llfab commented May 6, 2024

Debugging the VS extension shows that when DirectML is referenced the project is not detected as valid executable project:
image

because the .IsExecutable is false:
image

This is not the case if DirectML is not referenced.

@llfab
Copy link
Author

llfab commented May 6, 2024

Double checking the same project with the Rider extension works both in Debug and Release, hence, with DirectML referenced and not referenced.

@llfab
Copy link
Author

llfab commented May 6, 2024

This works.
image

Not sure if you really need to check if the project IsExecutable()...

@llfab
Copy link
Author

llfab commented May 6, 2024

Added a sample app here: https://github.com/llfab/Samples/tree/main/FailedPreviewer

Works in Debug because DirectML nuget package is only referenced in Release.

  • Close last xaml file
  • Switch to Release
  • Open xaml file => No executable found

@llfab
Copy link
Author

llfab commented May 6, 2024

The root cause problem is that the Properties list is empty for the exe project:
image

Therefore, the project is not detected as the executable project

@llfab
Copy link
Author

llfab commented May 7, 2024

Filed an issue here: microsoft/onnxruntime#20574

@kekekeks
Copy link
Member

<ItemGroup>
    <PackageReference Include="microsoft.ai.directml" Version="1.15.2" Condition="'$(Configuration)' != 'Debug'" GeneratePathProperty="True" />
      <PropertyPageSchema Remove="$(PkgMicrosoft_AI_DirectML)/**/*.*" />
</ItemGroup>

Will fix the previewer, note thatGeneratePathProperty is important.

Since it's a VS bug, I'm closing the issue

@llfab
Copy link
Author

llfab commented Sep 18, 2024

<ItemGroup>
    <PackageReference Include="microsoft.ai.directml" Version="1.15.2" Condition="'$(Configuration)' != 'Debug'" GeneratePathProperty="True" />
      <PropertyPageSchema Remove="$(PkgMicrosoft_AI_DirectML)/**/*.*" />
</ItemGroup>

Will fix the previewer, note thatGeneratePathProperty is important.

Since it's a VS bug, I'm closing the issue

Nice, we will try out...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants