Skip to content

docs(go): document tested Linux runtime setup - #32568

Open
Dex Hünter (dexhunter) wants to merge 2 commits into
microsoft:mainfrom
dexhunter:docs/go-linux-runtime-setup
Open

Dex Hünter (dexhunter) wants to merge 2 commits into
microsoft:mainfrom
dexhunter:docs/go-linux-runtime-setup

Conversation

@dexhunter

Copy link
Copy Markdown

Summary

Issue #32535 needs consumer guidance for using the Go binding with a released Linux runtime. This documentation-only change adds go/README.md with a pinned source commit, the verified ONNX Runtime 1.29.0 Linux x86-64 CPU archive and digest, the Go 1.26.0/CGO/GCC prerequisites, native library loading, and a small CPU example.

The binding source commit is currently untagged, so the instructions use a detached source pin and a local module replacement. The README documents the tested pairing and does not claim a minimum runtime, a new module tag, broader platform support, or a performance improvement.

Refs #32535

Validation

  • Existing Go package suite against the pinned source and ONNX Runtime 1.29.0: 194 passed, 0 failed, 3 skipped; the package reported runtime 1.29.0 and negotiated API 27.
  • Standalone consumer workflow with the documented module setup and native library path exited 0 and printed ONNX Runtime: 1.29.0 and output C: [11 22 33 44 55 66].
  • Go formatting and the final diff checks passed.
  • No native source, API, CI, or benchmark changes are included.

Weco evidence: https://dashboard.weco.ai/share/pfzVS_crCPUez-8eezwoD5hwTgTOI_fm

Copilot AI balanced review requested due to automatic review settings September 12, 2026 17:30
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified.

Pull request overview

Documents a reproducible Linux x86-64 setup for the Go binding with ONNX Runtime 1.29.0.

Changes:

  • Pins the Go source commit and runtime archive digest.
  • Documents prerequisites, native library loading, and module replacement.
  • Adds a minimal CPU inference example.
File summaries
File Description
go/README.md Documents the tested Linux Go binding setup and example.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dannyota

Copy link
Copy Markdown
Contributor

Thanks for writing this up. I'm the author of #29615 and would like to help finish it. A few suggestions:

  • Runtime: pair the guide with the 1.31.0 release. go/ at v1.31.0 matches main, and the suite passes against the 1.31.0 Linux x64 archive.
  • Install: until a go/v1.31.0 tag exists ([Feature Request] [Go] Tag the module and document native runtime setup #32535), show a commit-pinned go get github.com/microsoft/onnxruntime/go/onnxruntime@<commit> in a standalone module instead of a local replace.
  • Prerequisites: list the import path, Go 1.26, and cgo with a C compiler.
  • Example: keep the CPU example and the checksum step, and Close every resource it creates.

#33282 changes how the binding picks the runtime's API version. Once it merges, the guide can state the oldest supported runtime.

I can push follow-up commits here if that works for you.

Replace the local module override with a standalone go get installation pinned to the v1.31.0 source commit. Update the runtime archive checksum and list the import path and toolchain prerequisites.

Return example errors through a helper so deferred resource cleanup runs before process exit.

Refs microsoft#32535
@dexhunter

Copy link
Copy Markdown
Author

Updated in 9be1d0cd23: the guide now pairs the v1.31.0 source commit with the 1.31.0 Linux x64 archive, uses commit-pinned go get in a standalone module, and lists the import path, Go 1.26, cgo, and GCC. The checksum and CPU example remain. Errors now return through a helper so deferred resource cleanup runs before exit.

go test -json -race -count=1 -p=1 ./onnxruntime passed against runtime 1.31.0 for both the pinned module and the PR tree: 194 passing tests and subtests, 3 skipped in each. The standalone example printed ONNX Runtime: 1.31.0 and output C: [11 22 33 44 55 66]; go vet and formatting checks passed.

Follow-up commits here are welcome. The guide keeps its tested-pairing scope without claiming a minimum runtime; #33282 is still open.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants