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

Windows torchvision-0.11.1 CUDA-10.2 wheel packages are not bundled with nvjpeg dll #4894

Open
malfet opened this issue Nov 10, 2021 · 7 comments
Labels

Comments

@malfet
Copy link
Contributor

malfet commented Nov 10, 2021

🐛 Describe the bug

Steps to reproduce:

  1. Download TorchVision 0.11.1 windows wheel from https://download.pytorch.org/whl/cu102/torchvision/
  2. Unpack the binary
  3. Run dumpbin /dependents image.pyd to make sure it depends on nvjpeg64_10.dll:
C:\Users\circleci\Downloads\torchvision>dumpbin /dependents image.pyd
Microsoft (R) COFF/PE Dumper Version 14.00.24245.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file image.pyd

File Type: DLL

  Image has the following dependencies:

    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    libpng16.dll
    nvjpeg64_10.dll
    c10.dll
    torch_cpu.dll
    cudart64_102.dll
    c10_cuda.dll
    MSVCP140.dll
    KERNEL32.dll
    VCRUNTIME140_1.dll
    VCRUNTIME140.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll

  Summary

        2000 .data
        3000 .pdata
       2E000 .rdata
        1000 .reloc
        1000 .rsrc
       3C000 .text

  1. Noticesthat nvjpeg64_10.dll is missing from the archive

This causes torchvision.io.read_image fail on Windows

Versions

0.11.1 win+cu102

cc @peterjc123 @nbcsm @guyang3532 @maxluk @gunandrose4u @mszhanyi

@malfet malfet added release-issue For release-related issues topic: binaries windows labels Nov 10, 2021
@malfet malfet changed the title Windowstorchvision-0.11.1 CUDA-11.3 wheel packages are not compiled with nvjpeg acceleration enabled Windows torchvision-0.11.1 CUDA-10.2 wheel packages are not bundled with nvjpeg dll Nov 10, 2021
@mega-optimus
Copy link

Hi,
I just installed torchvision==0.11.1+cu102 on Windows 7 and get this "nvjpeg64_10.dll is missing" error window. Where can I find this dll manually and fix the blocking problem? Thank you!

@malfet
Copy link
Contributor Author

malfet commented Dec 15, 2021

nvjpeg64_10.dll can be downloaded from https://developer.nvidia.com/cuda-10.2-download-archive

@mega-optimus
Copy link

nvjpeg64_10.dll can be downloaded from https://developer.nvidia.com/cuda-10.2-download-archive

Thanks!
A bit curious, I've installed CUDA 10.2 already.

@puyebu
Copy link

puyebu commented Dec 18, 2021

I had the same problem and this is the only page I found,

Python/Pytorch does not search the path Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin for some reason, despite the path being specified in the environment, therefore causing dll error.
I couldn't find a proper solution and instead made hardlinks to the missing dlls in the Python\Lib\site-packages\torch\lib folder using mklink /H cmd command.

I am sure there must be a better way but I couldn't figure it out.

@you74674
Copy link

you74674 commented Mar 2, 2022

I also have this problem, and I fix it by manually add cuda path using os.add_dll_directory.
I think it's related to #4787? Although #4893 claimed to fix it.
Looks like the problem is _get_extension_path only add the package folder as dll directory but not any other path, but adding all path to dll directory doesn't seem to be the right way.

@jwdunn1
Copy link

jwdunn1 commented Mar 10, 2022

Same problem. Thanks to @puyebu, I was able to figure out a temporary solution. The complete command I used (running as administrator) was:
> mklink /H nvjpeg64_10.dll "c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvjpeg64_10.dll"

@panicwq
Copy link

panicwq commented Oct 25, 2023

I had this problem today.
After installing cuda10.2 on windows server2012 r2 with pip install torch==1.10.1+cu102 torchvision==0.11.2+cu102 torchaudio==0.10.1, it comes up with the missing nvjpeg64_10.dll popup.

My temporary solution is to copy nvjpeg64_10.dll to "Python\Lib\site-packages\torch\lib".
I'm not sure if there is a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants