[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pytorch and CUDA



Hi,

On 2023-02-15 20:22, M. Zhou wrote:
I was slowly pushing this forward (yes, very slow).
Long time ago, building pytorch cuda version is impossible due to
the lack of nvidia-cudnn. At that time I tried to package the upstream
binary but the license terms to be a blocker.

Now, I kept src:nvidia-cudnn a downloader package, and let
it Provides: libcudnn.so . We have enough build dependencies
for the pytorch-cuda variant, but I have not yet tried that.

Things remains to be done for enabling the pytorch-cuda variant:

1. build bin:pytorch-src from src:pytorch. It's beneficial to other
     variants like pytorch-rocm. In that case, we can simply reuse
     the same source package bin:pytorch-src, and create blank
     packages src:pytorch-cuda that Build-Depends: pytorch-src
     with CUDA enabled in d/rules.

     I have tried this the last year (search for "pytorch-src" in the
     git history), but some trivial bug blocked me and I eventually
     postponed this attempt.

2. toggle NO_CUDA=0, USE_CUDA=ON, USE_CUDNN=ON.
     We may also export CUDA_HOME=/usr to help the cmake
     find the nvcc executable.

     The expected extra build dependencies are:
     nvidia-cuda-toolkit, libcub-dev, nvidia-cudnn
Thanks a lot for prompt and detailed answer. I will look into pytorch-cuda branch and try to see whether I can contribute anything here. I have little experience with CUDA (managed to package openmm with CUDA locally, though).

By the way, pytorch seems to be able to use OpenCL, but Debian build does not seem to have it enabled.

Best,
Andrius


Reply to: