Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM Profile Error: Runtime and instrumentation version mismatch : expected 10, but get 8 #68

Open
ivanrg99 opened this issue Jan 29, 2025 · 3 comments

Comments

@ivanrg99
Copy link

ivanrg99 commented Jan 29, 2025

Hi! Love the project.

I updated my system recently, using the latest llvm package from homebrew and latest rust version. When I now run cargo pgo optimize, I keep getting a LLVM Profile Error: Runtime and instrumentation version mismatch : expected 10, but get 8 error.

My llvm installation is version 19, and running rustc --version --verbose reveals that my rust installation is also using llvm 19:

rustc 1.84.0 (9fc6b4312 2025-01-07)
binary: rustc
commit-hash: 9fc6b43126469e3858e2fe86cafb4f0fd5068869
commit-date: 2025-01-07
host: aarch64-apple-darwin
release: 1.84.0
LLVM version: 19.1.5

Is anyone else facing this issue?

@Kobzol
Copy link
Owner

Kobzol commented Jan 29, 2025

Hi, could you please post the output of cargo pgo info? Thanks!

@ivanrg99
Copy link
Author

[rustc version]: 1.84.0 is recent enough
[llvm-profdata]: found at /Users/ivan/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin/llvm-profdata
[llvm-bolt]: found at /Users/ivan/Downloads/LLVM/build/bin/llvm-bolt
[merge-fdata]: found at /Users/ivan/Downloads/LLVM/build/bin/merge-fdata

I was missing bolt from my llvm install, so I have built it myself from version 19.1.17 of llvm (which is the latest one packaged by brew), but the same error still persists.

@Kobzol
Copy link
Owner

Kobzol commented Jan 30, 2025

BOLT shouldn't be at fault here.

I see that you're on macOS. Sadly, PGO doesn't work well for Rust on macOS. I remember seeing similar errors when we tried to PGO the compiler (rustc) itself on macOS, and these issues haven't been resolved yet. So it's probably this long-standing, yet unresolved issue. Someone has been looking at it recently (https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/How.20to.20distribute.20builds.20across.20multiple.20macbooks.3F).

I think that you're going to get the same result, but you could try doing PGO without cargo-pgo (https://doc.rust-lang.org/rustc/profile-guided-optimization.html) to see if that works. If the same error happens without cargo-pgo, then sadly I can't do much here. You could report the issue in the Rust issue tracker though.

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

No branches or pull requests

2 participants