Using torch <=1.5.0 with CUDA 11

I need to use torch version <=1.5.0 on a system that only has CUDA drivers >=11.

Does this mean I have to follow the steps under build from source, by cloning the pytorch repo at respective version tags - e.g., 1.5.0?

P.s: I’ve looked up the discussion threads and could not find a directly related discussion. Apologies if I missed an existing FAQ-response.

You can install any 1.5.0 release with the supported CUDA version. Your CUDA driver will work as it can be newer than the CUDA runtime packages with the PyTorch binaries.

Hello, thank you for the clarification.
I installed torch v1.5.0 (cudatoolkit 10.2) and checked with several CUDA/11.* drivers. However, this error kept popping up for all combinations (torch v1.5.0 [cudatoolkit 9.2 or 10.1 or 10.2]):

RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)

In the end, I installed the oldest torch version that is built for CUDA/11.* drivers - v1.7.1 with cudatoolkit 11.0 and managed to get it working. :expressionless:

I don’t know which GPU you are using but Ampere+ requires CUDA11+ and will fail with older releases.

Aah okay! I’m using NVIDIA A100 (Ampere arch indeed).

So, if I’d have to use older torch versions (not built for CUDA11+), could I conclude that the only option is to build from source?

Not necessarily, since older PyTorch versions might not even support newer CUDA versions. In this case you would need to backport all needed changes enabling the desired CUDA version (if possible) to the older PyTorch release and then build from source. I’m still unsure why you won’t just install the latest stable or nightly release instead.

Okay, thank you!

Oh, regarding not using the latest torch: I’m currently working with a codebase (implemented in 2019 using torch v1.3.0, besides older versions of other libraries such as transformers, pytorch-pretrained-bert, pytorch-ignite... etc).
Simply upgrading torch to the latest version resulted in a galore of errors and conflicts which might not be fixable individually. So, without changing the code or the versions of other libraries, I wanted to check if a torch version (closer to the original version) would work.

As mentioned, v1.7.1 with cudatoolkit 11.0 worked :slight_smile: