LTW.YoloDotNet.DirectML.Execution.Provider 1.0.1-aotfix.1

This is a prerelease version of LTW.YoloDotNet.DirectML.Execution.Provider.
dotnet add package LTW.YoloDotNet.DirectML.Execution.Provider --version 1.0.1-aotfix.1
                    
NuGet\Install-Package LTW.YoloDotNet.DirectML.Execution.Provider -Version 1.0.1-aotfix.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LTW.YoloDotNet.DirectML.Execution.Provider" Version="1.0.1-aotfix.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LTW.YoloDotNet.DirectML.Execution.Provider" Version="1.0.1-aotfix.1" />
                    
Directory.Packages.props
<PackageReference Include="LTW.YoloDotNet.DirectML.Execution.Provider" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LTW.YoloDotNet.DirectML.Execution.Provider --version 1.0.1-aotfix.1
                    
#r "nuget: LTW.YoloDotNet.DirectML.Execution.Provider, 1.0.1-aotfix.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LTW.YoloDotNet.DirectML.Execution.Provider@1.0.1-aotfix.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LTW.YoloDotNet.DirectML.Execution.Provider&version=1.0.1-aotfix.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LTW.YoloDotNet.DirectML.Execution.Provider&version=1.0.1-aotfix.1&prerelease
                    
Install as a Cake Tool

信息

YoloDotNet 使用模块化执行器在不同硬件后端上运行推理。 每个执行器都针对特定平台或加速器,并且可能需要额外的系统级依赖, 例如运行时、驱动程序或操作系统支持。

仅安装 NuGet 包并不总是足够——正确配置取决于所选执行器与目标系统。
本文档介绍 DirectML 执行器 的安装与使用。

核心库要求

所有执行器都依赖核心 YoloDotNet 包。

NuGet 包

dotnet add package YoloDotNet

执行器 -- DirectML

DirectML 执行器通过 ONNX Runtime 使用 Microsoft DirectML, 在 Windows 上启用 GPU 加速推理。

DirectML 基于 DirectX 12 提供与硬件厂商无关的 GPU 后端, 可在多种 GPU 上运行推理,而无需厂商专属 SDK。

该执行器尤其适合:

  • Windows 桌面应用
  • 没有 CUDA 或 OpenVINO 的系统
  • 希望使用统一 GPU API 的环境

⚠️ 注意
此执行器依赖 Windows 通过 DirectX 12 提供的 DirectML 支持
除受支持的 Windows 版本和 GPU 驱动外,无需额外 SDK。

环境要求

  • Windows 10 或更高版本(x64)
  • 支持 DirectX 12 的 GPU(NVIDIA、AMD 或 Intel)
  • 最新 GPU 驱动
  • 与 DirectML 执行兼容的 ONNX 模型

安装

NuGet 包

dotnet add package YoloDotNet.ExecutionProvider.DirectML

YoloDotNet.ExecutionProvider.DirectML v1.0 需要 YoloDotNet 4.1 版本。

无需单独安装 DirectML 或 DirectX SDK。DirectML 已包含在 Windows 与 ONNX Runtime 中。

使用示例

using YoloDotNet;
using YoloDotNet.ExecutionProvider.DirectML;

using var yolo = new Yolo(new YoloOptions
{
    ExecutionProvider = new DirectMLExecutionProvider(
        model: "path/to/model.onnx",
        gpuId: 0
    ),

    // ...其他选项
});

性能与兼容性说明

  • DirectML 性能高度依赖 GPU 驱动质量和模型结构。
  • 在 NVIDIA 硬件上,如果追求最高吞吐,CUDA 执行器可能有更高性能。

DirectML 相比厂商专属优化,更强调 广泛兼容性与部署简便性

故障排查

如果推理初始化失败:

  • 确认 GPU 支持 DirectX 12。
  • 确保 GPU 驱动为最新版本。
  • 确认仅引用了 一个执行器 包。
  • 验证 ONNX 模型受 ONNX Runtime DirectML 支持。
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1-aotfix.1 41 5/6/2026