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

Support Cuda 11.8 #954

Closed
phgrosjean opened this issue Dec 26, 2022 · 9 comments · Fixed by #1089
Closed

Support Cuda 11.8 #954

phgrosjean opened this issue Dec 26, 2022 · 9 comments · Fixed by #1089

Comments

@phgrosjean
Copy link

Hello,

Pytorch 22.09 is now compatible with CUDA 11.8. Would it be possible to do the same for R torch? CUDA 11.6 is not (easily) installable on Ubuntu 22.04 which provides only CUDA 11.7 or 11.8.
Thanks.

@yolshanskiy
Copy link

Have the same issue with Ubuntu 22.04, though current Nvidia drives (525) go with CUDA 12.0. I didn't find a better solution than using PyTorch.

@dfalbel
Copy link
Member

dfalbel commented Feb 3, 2023

Hello @yolshanskiy and @phgrosjean,

I'm experiment with new pre-built binaries for torch that include all CUDA necessary dependencies. By installing those binaries you don't need to install CUDA and cuDNN as additional steps. I'd love some on how it works for you.

You can install from the pre-built bianries with:

kind <- "cu113" # "cpu", "cu113" are the only currently supported.
version <- "0.9.1.9000"
options(repos = c(
  torch = sprintf("https://storage.googleapis.com/torch-lantern-builds/packages/%s/%s/", kind, version),
  CRAN = "https://cloud.r-project.org" # or any other from which you want to install the other R dependencies.
))
install.packages("torch")

@phgrosjean
Copy link
Author

@dfalbel Thank you. Indeed, if you provide the binaires, it solves the problem too (but it means to download 2GB).

I think it should be kind <- "cu11.3" instead. Anyway, even with this change, I was not able to install it that way. I had to download it manually from https://storage.googleapis.com/torch-lantern-builds/packages/cu11.3/0.9.1.9000/src/contrib/torch_0.9.1.9000_R_x86_64-pc-linux-gnu.tar.gz. Then I did install.packages("torch_0.9.1.9000_R_x86_64-pc-linux-gnu.tar.gz", repos = NULL).

Then, everything was fine and I am now able to use {torch} with CUDA 11.3 on my Ubuntu 22.04.

Thanks!

@olarerin-lab
Copy link

@dfalbel Thank you for the prebuilt binaries. Thar worked for me as well on Ubuntu 22.

@yolshanskiy
Copy link

Thank you, @dfalbel and @phgrosjean! Manual installation suggested by @phgrosjean perfectly worked for me in the end.

(I ended up with specification:
Ubuntu 22.04, NVIDIA-SMI 515.65.01, CUDA Version: 11.7,
it is compatible with both pytorch and R.torch)

@BastienFR
Copy link

The prebuild binaries worked for me as well. It was a super easy way to install torch in "very close" corporate environment. I used link provided by @phgrosjean for the test, however I'm noticing the version of the package is older (0.9 while it is now 0.11) and same thing for the CUDA version (11.3 vs 11.6 or 7). I couldn't find other binaries with newer versions. @dfalbel, are you planning to automatically release prebuild version of the binaries each time you update the package? And if yes, what will be the way to access those binaries (do you have any links giving a list of all binaries version available?)

@dfalbel
Copy link
Member

dfalbel commented Aug 1, 2023

@BastienFR

My recommendation is to use the following:

options(timeout = 600) # increasing timeout is recommended since we will be downloading a 2GB file.
# For Windows and Linux: "cpu", "cu117" are the only currently supported
# For MacOS the supported are: "cpu-intel" or "cpu-m1"
kind <- "cu117" 
version <- "0.10.0"
options(repos = c(
  torch = sprintf("https://storage.googleapis.com/torch-lantern-builds/packages/%s/%s/", kind, version),
  CRAN = "https://cloud.r-project.org" # or any other from which you want to install the other R dependencies.
))
install.packages("torch")

I also plan to keep the section about pre-built binaries in the installation article: https://torch.mlverse.org/docs/articles/installation.html#installing-from-pre-built-binaries updated in case something changes.

@BastienFR
Copy link

@dfalbel , thanks for your answer.

Your recommended method may work for people on computers that have internet access, but if you're like me and you're main machine learning computer is inside a firewall with very limited access, it is impossible to download the binaries that way.

In the useful link you gave, you mention the function get_install_libs_url(). I've tried this but and the link it provided for lantern was not the latest version (0.9.1 vs 0.10.0):
image

and the link didn't work anyway:
image

This approach however do seems like a verry good and useful way to install the torch library.

@dfalbel
Copy link
Member

dfalbel commented Aug 1, 2023

OOh, ok, I think we could create a function that could help getting the correct link.
I think we should be able to reverse engineer download.packages in order to get the correct download link, eg:

kind <- "cu117" 
version <- "0.10.0"
url <- sprintf("https://storage.googleapis.com/torch-lantern-builds/packages/%s/%s/", kind, version)
download.packages("torch", "~/Downloads/", repos = url)

Edit:

Also something like this: https://stackoverflow.com/a/52383592/3297472 should work after setting the repos.

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 a pull request may close this issue.

5 participants