Skip to content

Add offload support to the dist-x86_64-linux CI job#159064

Draft
sgasho wants to merge 6 commits into
rust-lang:mainfrom
sgasho:offload-dist
Draft

Add offload support to the dist-x86_64-linux CI job#159064
sgasho wants to merge 6 commits into
rust-lang:mainfrom
sgasho:offload-dist

Conversation

@sgasho

@sgasho sgasho commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

View all comments

Add offload support to the dist-x86_64-linux CI job
This enables users to compile offload code without building rustc from source

  • Package the offload runtime shared libraries
  • Package the AMDGPU and NVPTX device runtime libraries

I checked the tarballs work by compiling & running the sample offload code here:
https://rustc-dev-guide.rust-lang.org/offload/usage.html

Before After
スクリーンショット 2026-07-16 23 46 46 スクリーンショット 2026-07-16 23 49 32
スクリーンショット 2026-07-16 23 48 31 スクリーンショット 2026-07-16 23 50 27

There are two changes affect outside of offload (I left github comments on the relevant sections). So,

r? @Kobzol
r? @jieyouxu
r? @ZuseZ4

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jul 10, 2026
@Kobzol

Kobzol commented Jul 10, 2026

Copy link
Copy Markdown
Member

@bors delegate try

@rust-bors

rust-bors Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

✌️ @sgasho, you can now perform try builds on this pull request!

You can now post @bors try to start a try build.

@sgasho

sgasho commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

rust-bors Bot pushed a commit that referenced this pull request Jul 10, 2026
Build offload in dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: bb4478e (bb4478e7edac7d0a86c29a3ac65f56cfa1d81a72)
Base parent: 3ead112 (3ead112e67f8feb4d6b09e12f1b5d83b87698961)

@sgasho

sgasho commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 12, 2026
Build offload in dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 7b815a7 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 13, 2026
@sgasho

sgasho commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Build offload in dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9872f3c (9872f3c6d16727671e9f43962be4e12c30bdf321)
Base parent: 5503df8 (5503df87342a73d0c29126a7e08dc9c1255c46ad)

@sgasho

sgasho commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 15, 2026
Build offload in dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 64ca999 (64ca999aa0681333d35e35b02d81c33fa85b0e97)
Base parent: df1ae0f (df1ae0f7dd168513de2d89beb2cb7a95d4fdc118)

@sgasho sgasho changed the title Build offload in dist-x86_64-linux CI job Add offload support to the dist-x86_64-linux CI job Jul 16, 2026
@rustbot

rustbot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Kobzol is not on the review rotation at the moment.
They may take a while to respond.

@sgasho
sgasho marked this pull request as ready for review July 16, 2026 16:23
@sgasho
sgasho marked this pull request as draft July 22, 2026 12:54
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 22, 2026
@ZuseZ4

ZuseZ4 commented Jul 23, 2026

Copy link
Copy Markdown
Member

A few notes for the llvm 23 update, that should probably go in the dev guide as well:

The offload-clang-dir option from #150108 is a workaround I only introduced to not increase build times by too much. Usually, LLVM/Offload expects users to build both Clang and Offload, so that Offload can use features recently added to Clang. They are not really willing to guarantee that Offload-23 can be bootstrapped with Clang22. However, as long as the clang used to build and the sources being build are on the same major version they agreed it should likely work, even if minor/patch versions differ. They used to have an assertion that checked for equality in major/minor/patch version, but after reporting it, they downgraded the assertion to a warning in a PR that should be part of 23. They also were quick in addressing the other breakages I reported, so I think it's fine to keep trying this setup in CI.

The other thing is that you mentioned above that you ran our website example with this build, so I guess that includes the clang-linker-wrapper call? Your first comments only mention the distribution of libs, and I'm unsure if the clang-linker-wrapper is built if we don't build clang. (The naming of these components was always a bit unlucky and changes once in a while). I had started working on a PR that teaches rustc how to directly call the LLVM apis which the linker wrapper is also using, but I never finished that one and I think it's also ont part of your gsoc proposal. Imho either solution is fine (even if we ship an incomplete toolchain for a bit), I was just curious how you tested it.

@sgasho

sgasho commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed info around LLVM 23/Clang/Offload.

For clang-linker-wrapper, on the x86 dev-desktop, I cloned r-l/r and built rustc by running ./x build then I used build/x86_64-unknown-linux-gnu/llvm/bin/clang++, which automatically invoked build/x86_64-unknown-linux-gnu/llvm/bin/clang-linker-wrapper

So yes, we are shipping an incomplete toolchain as the first step in this PR.

@sgasho

sgasho commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 23, 2026
Add offload support to the dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@sgasho

sgasho commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

I had started working on a PR that teaches rustc how to directly call the LLVM apis which the linker wrapper is also using

this PR?: #149827
Continuing this work might be something I can look into after GSoC

@rust-bors

rust-bors Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 0dc28a1 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

The GCC mirror now needs TLS 1.3.
@sgasho

sgasho commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 24, 2026
Add offload support to the dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e3aafc7 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@sgasho

sgasho commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 24, 2026
Add offload support to the dist-x86_64-linux CI job


try-job: dist-x86_64-linux
@rust-bors

rust-bors Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3236637 (323663757ee45dbad650ca9e228c4107aca5288b)
Base parent: 29e68fe (29e68fe2295f8fc2feb52b8cb0b61a055842fdcf)

@sgasho

sgasho commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Ah, I almost forgot about this effect of not using llvm.offload=true
I'll create and open dlopen Offload(this approach is the most appropriate?) PR first.

スクリーンショット 2026-07-26 12 53 31 スクリーンショット 2026-07-26 12 53 39

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

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants