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

Comprehensive Documentation Needed for libtorch Setup and Troubleshooting #587

Closed
antimora opened this issue Aug 4, 2023 · 6 comments · Fixed by #1185
Closed

Comprehensive Documentation Needed for libtorch Setup and Troubleshooting #587

antimora opened this issue Aug 4, 2023 · 6 comments · Fixed by #1185
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@antimora
Copy link
Collaborator

antimora commented Aug 4, 2023

Issue Description

In the process of building and running our Burn projects, it has been observed that some users are encountering difficulties with setting the environment variables and the CUDA version for libtorch. Additionally, some are experiencing issues when executing a built binary with Rust where the libtorch library path is lost, likely due to it being outside of the Cargo context.

Although libtorch is downloaded during the build, these complications highlight the need for a more detailed and thorough documentation page that addresses libtorch setup and troubleshooting.

Suggested Solution

We need to create a comprehensive document that covers all aspects related to libtorch setup, including but not limited to:

  • Setting environment variables
  • Selecting and configuring the correct CUDA version
  • Navigating issues with the libtorch library path, particularly in relation to the Cargo context
  • Document should be written not only from the burn's developer perspective but also from the end user perspective who use Burn framework as a library.

This document should also include a troubleshooting guide that helps users diagnose and resolve common problems they may encounter during setup or operation.

Additional Information

By improving our documentation, we can better support our users and potentially reduce the number of support queries related to libtorch setup. Detailed, clear, and accurate documentation is a critical component of user experience and can play a significant role in the success of our projects.

If there are any suggestions or feedback about what to include in this documentation, please comment on this issue.

@antimora antimora added documentation Improvements or additions to documentation help wanted Extra attention is needed good first issue Good for newcomers labels Aug 4, 2023
@antimora
Copy link
Collaborator Author

antimora commented Aug 4, 2023

Related issue ticket where someone was not able to run the binary outside cargo context: Gadersd/whisper-burn#1

@antimora
Copy link
Collaborator Author

antimora commented Aug 6, 2023

Someone on Reddit claimed AMD with torch works:

It already works out of the box with AMD, because it uses burn with the burn-tch Torch backend which depends on the tch torch crate, and thats where a compatible PyTorch needs to be setup.

Just download the ROCm version of the C++ Torch from https://pytorch.org/get-started/locally/ and set LIBTORCH and the tch crate will Just Use It, and your AMD GPU will Just Work. Or install it system-wide, if you want.

I just tested this myself using a AMD RX 6800M GPU, fans currently blasting away and its at full bore.

ninjaedit: it finished while i was writing this! Successful image generation confirmed!

It's important note that burn-tch supports Vulkan backend as well.

@antimora
Copy link
Collaborator Author

antimora commented Aug 7, 2023

@antimora
Copy link
Collaborator Author

antimora commented Aug 7, 2023

This person has installed a different version of CUDA but resolved it: Gadersd/stable-diffusion-burn#2 (comment)

@antimora
Copy link
Collaborator Author

Someone had a problem with torch backend probably because cuda version mismatch: #837

@laggui
Copy link
Member

laggui commented Jan 26, 2024

@antimora I'm currently looking into this and I was wondering if you had any pointers for MPS with Apple hardware? I see that you commented in some issues that you've worked on getting torch running on Mac.

Right now the instructions will recommend a manual download since it's easier to control and point to the right stuff that we know worked for us. But there's no official libtorch distribution for MPS, so in this case maybe we should link to pytorch instructions for tch-rs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants