Skip to content

[ROCm] Keep torch_hip linked into LibTorch C++ programs on Windows - #201445

Closed
0xDELUXA wants to merge 1 commit into
pytorch:mainfrom
0xDELUXA:rocm-windows-torch-hip-include
Closed

0xDELUXA wants to merge 1 commit into
pytorch:mainfrom
0xDELUXA:rocm-windows-torch-hip-include

Conversation

@0xDELUXA

@0xDELUXA 0xDELUXA commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Linked issue or supporting maintainer

Fixes #201444

BC-breaking?

No

Summary (human written only)

On Windows ROCm builds, LibTorch C++ consumers drop the torch_hip.dll import because nothing references a torch_hip symbol, so torch::cuda::is_available() is false. This adds the same -INCLUDE that torch_cuda already gets under MSVC to the torch_hip interface.

Agent details (if applicable)

Prepared with Claude; I reviewed the change and reran the tests myself.

torch_hip.lib exports ?warp_size@cuda@at@@yahxz, the same symbol the CUDA path forces. Tested on Windows with ROCm torch 2.16.0a0+rocm10.2.0a20261018 (gfx1200) using a minimal CMake consumer: without the option the executable has no torch_hip.dll import and is_available() is false; with the option on the torch_hip interface it imports torch_hip.dll and is_available() is true. Found while getting the AMD-Ecosystem LichtFeld-Studio HIP compute tests to run on Windows (AMD-Ecosystem/LichtFeld-Studio#1).

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang

@pytorch-bot pytorch-bot Bot added module: rocm AMD GPU support for Pytorch topic: not user facing topic category labels Oct 19, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201445

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 Cancelled Job

As of commit d1d41e1 with merge base 7f2c7e8 (image):

CANCELLED JOB - The following job was cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@0xDELUXA
0xDELUXA marked this pull request as ready for review October 19, 2026 16:29
@0xDELUXA

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: rocm"

@pytorch-bot pytorch-bot Bot added the release notes: rocm mandatorylabel label Oct 19, 2026
@github-actions github-actions Bot added bot-triaged This is a label only to be used by the auto triage bot missing actionable issue A PR without a linked actionable issue or maintainer sponsor triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Oct 19, 2026
@jeffdaily

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 20, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@0xDELUXA

Copy link
Copy Markdown
Contributor Author

@jeffdaily The merge timed out on trunk / macos-py3-arm64 / test (mps, 1, 1, macos-m2-15), which hung for 11h and was cancelled. It is unrelated to this change. Could you please reissue the merge?

@jeffdaily

Copy link
Copy Markdown
Collaborator

@pytorchbot merge -i

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 1 checks: trunk / macos-py3-arm64 / test (mps, 1, 1, macos-m2-15)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

This branch was previously deployed

1 inactive deployment
bedrock — d1d41e1a Deployed Oct 19, 2026 by pytorchbot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-triaged This is a label only to be used by the auto triage bot ciflow/trunk Trigger trunk jobs on your pull request Merged missing actionable issue A PR without a linked actionable issue or maintainer sponsor module: rocm AMD GPU support for Pytorch open source release notes: rocm mandatorylabel topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ROCm] On Windows, LibTorch C++ programs never load torch_hip.dll, so torch::cuda::is_available() is false

4 participants