Skip to content

Latest commit

 

History

History
88 lines (77 loc) · 4.05 KB

README.md

File metadata and controls

88 lines (77 loc) · 4.05 KB

GPU库整合说明

onnxruntime-gpu(下载)

  1. 下载地址
  • 仅支持Linux和Windows,仅支持x64
  • Windows包名: onnxruntime-win-x64-gpu-版本号.zip
  • Linux包名: onnxruntime-linux-x64-gpu-版本号.tgz
  • Windows平台:把压缩包内的lib文件夹解压到windows-x64文件夹里
  • Linux平台:把压缩包内的lib文件夹解压到linux文件夹里
  • 创建include/onnxruntime/core/session,把压缩包内的所有.h文件解压到session文件夹里
  • 目录结构如下
onnxruntime-gpu
├── linux
│   ├── include
│   │   └── onnxruntime
│   │       └── core
│   │           └── session
│   │               ├── cpu_provider_factory.h
│   │               ├── onnxruntime_c_api.h
│   │               ├── onnxruntime_cxx_api.h
│   │               ├── onnxruntime_cxx_inline.h
│   │               ├── onnxruntime_run_options_config_keys.h
│   │               ├── onnxruntime_session_options_config_keys.h
│   │               ├── provider_options.h
│   │               └── tensorrt_provider_factory.h
│   ├── lib
│   │   ├── libonnxruntime_providers_cuda.so
│   │   ├── libonnxruntime_providers_shared.so
│   │   ├── libonnxruntime_providers_tensorrt.so
│   │   ├── libonnxruntime.so -> libonnxruntime.so.1.12.1
│   │   └── libonnxruntime.so.1.12.1
│   └── OnnxRuntimeConfig.cmake
└── windows-x64
    ├── include
    │   └── onnxruntime
    │       └── core
    │           └── session
    │               ├── cpu_provider_factory.h
    │               ├── onnxruntime_c_api.h
    │               ├── onnxruntime_cxx_api.h
    │               ├── onnxruntime_cxx_inline.h
    │               ├── onnxruntime_run_options_config_keys.h
    │               ├── onnxruntime_session_options_config_keys.h
    │               ├── provider_options.h
    │               └── tensorrt_provider_factory.h
    ├── lib
    │   ├── onnxruntime.dll
    │   ├── onnxruntime.lib
    │   ├── onnxruntime.pdb
    │   ├── onnxruntime_providers_cuda.dll
    │   ├── onnxruntime_providers_cuda.lib
    │   ├── onnxruntime_providers_cuda.pdb
    │   ├── onnxruntime_providers_shared.dll
    │   ├── onnxruntime_providers_shared.lib
    │   ├── onnxruntime_providers_shared.pdb
    │   ├── onnxruntime_providers_tensorrt.dll
    │   ├── onnxruntime_providers_tensorrt.lib
    │   └── onnxruntime_providers_tensorrt.pdb
    └── OnnxRuntimeConfig.cmake

cuDNN安装指南

cuDNN下载

  • cuDNN下载地址
  • windows只需要把dll解压,跟编译好的exe放在一起即可
  • Linux需要把cudnn解压缩到一个文件夹(例如/opt/cudnn),然后把路径加到LD_LIBRARY_PATH
  • 安装的cuda也必须把路径(例如/usr/local/cuda-11.4/lib64)加到LD_LIBRARY_PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cudnn:/usr/local/cuda-11.4/lib64
  • 或者添加上面的路径到/etc/ld.so.conf,并以root权限运行ldconfig

CUDA下载