Hello,
I am trying to build an exe from my python project, which is based on a lot of packages including cupy. For the version without cupy the exe works fine.
For the version with cupy,
I am running this command: pyinstaller --clean --onefile *.spec
In the spec file:
I set the hiddenimports=['cupy_backends.cuda.stream','cupy._core._carray','fastrlock','fastrlock.rlock','cupy._core._cub_reduction','cupy._core._ufuncs','cupy._core._routines_sorting']
And added
a.datas += Tree("C:\\Users\\XX\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages\\cupy\\_core\\include\\cupy", "C:\\Users\\XX\\AppData\\Local\\Temp\\_MEI821682\\cupy\\_core")
When I run the pyinstaller command above, I have 3 warnings:
118455 WARNING: lib not found: nvToolsExt64_1.dll dependency of c:\users\XX\appdata\local\programs\python\python38\lib\site-packages\cupy_backends\cuda\libs\nvtx.cp38-win_amd64.pyd
118572 WARNING: lib not found: cuTENSOR.dll dependency of c:\users\XX\appdata\local\programs\python\python38\lib\site-packages\cupy_backends\cuda\libs\cutensor.cp38-win_amd64.pyd
118651 WARNING: lib not found: cudnn64_8.dll dependency of c:\users\XX\appdata\local\programs\python\python38\lib\site-packages\cupy_backends\cuda\libs\cudnn.cp38-win_amd64.pyd
The exe was generated, when I run the exe, it gives following error:
Failed to extract C:\Users\XX\AppData\Local\Temp\_MEI821682\cupy\_core\README.md: failed to open target file!
fopen: Invalid argument
I am not sure if this is related to the warnings. I googled online and followed some advice.
I tried add datas in *spec:
datas=[('C:\\Users\\XX\\AppData\\Local\\Temp\\_MEI821682\\cupy\\_core\\README.md',
'.')], but it complains when running the pyinstaller command since the file does not exist.
I also added the related folders to exclude from my windows defender antivirus scan. But it did not help.
Could someone helping me solving this? Really appreciate your help!
Thanks a lot!
Xin