onnxruntime

package
v0.1.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultVersion = ""
	RepoURL        = "https://github.com/microsoft/onnxruntime/releases/download"
)
View Source
const ROCmWheelRepoURL = "https://repo.radeon.com/rocm/manylinux"

ROCmWheelRepoURL is the base URL of AMD's manylinux wheel repository, holding pre-built ONNX Runtime wheels with the MIGraphX execution provider enabled, one directory per ROCm release (e.g. .../rocm-rel-7.2.4/).

Variables

This section is empty.

Functions

func FindMigraphxWheelURL added in v0.1.5

func FindMigraphxWheelURL(rocmVersion string) (string, error)

FindMigraphxWheelURL lists the AMD wheel repository for the given ROCm release (e.g. "7.2.4") and returns the URL of the ONNX Runtime MIGraphX wheel to install.

func GetAssetURL

func GetAssetURL(version string, cuda bool, cudaVersion string) (string, error)

GetAssetURL returns the download URL for the given version, platform, and cuda setting.

func GetCUDAFullVersion added in v0.1.2

func GetCUDAFullVersion() string

GetCUDAFullVersion attempts to return the full CUDA version string (e.g. "13.3.29", "12.4", or "12.4.131") found on the system.

func GetDefaultCUDAVersion added in v0.1.2

func GetDefaultCUDAVersion() string

GetDefaultCUDAVersion attempts to guess the CUDA version based on installed libraries found on standard paths, or via nvcc if available. It returns the major version as a string (e.g., "12", "13"). If nothing is found, it defaults to "12".

func GetDefaultROCmVersion added in v0.1.5

func GetDefaultROCmVersion() string

GetDefaultROCmVersion returns the locally installed ROCm version (e.g. "7.2.4"), detected from $ROCM_PATH or /opt/rocm, or "" if ROCm is not installed.

func GetInstallPath

func GetInstallPath() (string, error)

GetInstallPath returns the default directory where the library will be installed.

func GetInstalledVersion added in v0.1.12

func GetInstalledVersion(targetDir string) (string, error)

GetInstalledVersion returns the normalized version string of the ONNX Runtime library currently installed in targetDir (e.g., "1.30.0"). If targetDir is empty, it checks the default install directory. If no library is installed, it returns "" and nil. If the library is present but its version cannot be determined, it returns "" and nil.

func GetLatestVersion

func GetLatestVersion(cuda bool) (string, error)

GetLatestVersion fetches the latest release version of ONNX Runtime from GitHub. If cuda is true and the installed CUDA version is <= 12.4, it returns "1.27.0" to maintain compatibility.

func GetLibFilename

func GetLibFilename() (string, error)

GetLibFilename returns the expected library name for the platform.

func GetMigraphxInstallPath added in v0.1.5

func GetMigraphxInstallPath() (string, error)

GetMigraphxInstallPath returns the dedicated install directory for the AMD ROCm/MIGraphX ONNX Runtime build (e.g. ~/.local/lib/onnxruntime-migraphx on Linux). It is kept separate from the standard install path so that installing it does not clobber the CPU/CUDA library (the AMD build is based on a different ORT version).

func Install

func Install(version string, cuda bool, cudaVersion string, targetDir string, force bool) (string, error)

Install downloads and installs the ONNX Runtime library if not already present. It returns the absolute path to the main shared library file.

func InstallMigraphx added in v0.1.5

func InstallMigraphx(rocmVersion string, targetDir string, force bool) (string, error)

InstallMigraphx downloads and installs a pre-built ONNX Runtime library with the MIGraphX (AMD ROCm) execution provider enabled, extracted from AMD's manylinux wheels. The rocmVersion parameter selects the ROCm release to fetch the matching wheel for (e.g. "7.2.4"); if empty, the locally installed ROCm version is detected. If targetDir is empty, the library is installed under the dedicated MIGraphX directory (see GetMigraphxInstallPath). It returns the absolute path to the main shared library file.

func NormalizeVersion added in v0.1.2

func NormalizeVersion(v string) string

NormalizeVersion cleans up user-provided version strings (e.g., "v1.29.0", "v1.29", "1.29") into standard semver "1.29.0". If a 2-part version is provided (e.g., "1.27" or "v1.27"), it queries GitHub releases to find the latest patch version (e.g., "1.27.1").

func ResolveLatestPatchVersion added in v0.1.2

func ResolveLatestPatchVersion(majorMinor string) string

ResolveLatestPatchVersion queries GitHub releases to find the highest patch version for a given major.minor string (e.g. "1.27" -> "1.27.1").

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL