Download cuDNN via wget or curl?

I’m working via SSH, ideally it would be nice if I could include a script that automatically downloads cuDNN without the need to store the cuDNN installer in our repository.

Tried a few variants of wget with --user, --password, --ask-password, --secure-protocol=auto, no luck so far.

Advice welcome.

3 Likes

Same problem

The libraries sourced from developer.nvidia.com like cuDNN are behind an authorization process that cannot be bypassed in this way.

What you can do is run Link Redirect Trace in Chrome and look for the location field:

https://chrome.google.com/webstore/detail/link-redirect-trace/nnpljppamoaalgkieeciijbcccohlpoh

You should find the file location before the question mark in the path. You can then download from this link on any machine with wget, curl, or my favorite, HTTPie. This should work for basically any download on NVIDIA Developer and is very useful if you need to install to a headless machine.

Adam

3 Likes

Hi, here was my solution.

  1. Like erickson suggested, download the Link Redirect Trace tool from https://chrome.google.com/webstore/detail/link-redirect-trace/nnpljppamoaalgkieeciijbcccohlpoh/related?hl=en.
  2. Click on the download link from the Nvidia page (e.g. "cuDNN v7.0.5 Library for Linux") but don't download it (for my case, I was downloading to a remote server, and needed to use wget)
  3. Click on the Link Redirect Trace tooltip in the browser toolbar, and expand to see the details. The "location" param should have the right link, with a valid auth token. You can use wget with this.

Hope this helps!

7 Likes

Thank you! This is really helpful for crafting a Dockerfile!

@bkbolte18 How do you get the redirect link without actually launching the download?
In my cause Chrome will always trigger the download. So when I cancel and try to use the redirect link in my ssh CLI, it is still forbidden

it did not work for me as well…

1 Like

The NVIDIA-maintained docker images on dockerhub should give you a recipe for installing cudnn without any download issues:

For example, the 18.04 base image for CUDA 10.1:

https://gitlab.com/nvidia/cuda/blob/master/dist/ubuntu18.04/10.1/runtime/cudnn7/Dockerfile

ENV CUDNN_VERSION 7.6.2.24
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"

RUN apt-get update && apt-get install -y --no-install-recommends \
    libcudnn7=$CUDNN_VERSION-1+cuda10.1 \
&& \
    apt-mark hold libcudnn7 && \
    rm -rf /var/lib/apt/lists/*

The above is not a complete recipe, it depends on selecting the package archive correctly, which is shown in the non-cudnn base image.

Sorry for necroposting, but if someone stumble upon this issue, a solution could be:

  • open a dev console for your browser and make sure you are logging the network request
  • start the download
  • log the second request to your file and you’ll find the link with the auth token as get param
  • copy that url as argument for wget on your remote server

Enjoy!

10 Likes

This worked like a charm. Thank you :)

This works perfectly. Thanks!