Documentation
¶
Index ¶
- Constants
- func FindMigraphxWheelURL(rocmVersion string) (string, error)
- func GetAssetURL(version string, cuda bool, cudaVersion string) (string, error)
- func GetCUDAFullVersion() string
- func GetDefaultCUDAVersion() string
- func GetDefaultROCmVersion() string
- func GetInstallPath() (string, error)
- func GetInstalledVersion(targetDir string) (string, error)
- func GetLatestVersion(cuda bool) (string, error)
- func GetLibFilename() (string, error)
- func GetMigraphxInstallPath() (string, error)
- func Install(version string, cuda bool, cudaVersion string, targetDir string, force bool) (string, error)
- func InstallMigraphx(rocmVersion string, targetDir string, force bool) (string, error)
- func NormalizeVersion(v string) string
- func ResolveLatestPatchVersion(majorMinor string) string
Constants ¶
const ( DefaultVersion = "" RepoURL = "https://github.com/microsoft/onnxruntime/releases/download" )
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
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 ¶
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 ¶
GetInstallPath returns the default directory where the library will be installed.
func GetInstalledVersion ¶ added in v0.1.12
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 ¶
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 ¶
GetLibFilename returns the expected library name for the platform.
func GetMigraphxInstallPath ¶ added in v0.1.5
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
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
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
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.