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
Wrong CUDA version during freezing project with PyTorch #1704
Comments
What are the values of PATH (os.environ["PATH"]) and sys.path? |
Can you provide a minimal sample? |
I made a patch. To install the latest development build:
|
I have both CUDA paths in os.environ and sys.path
The v11.7 is before v11.3 |
I'll add sample.
|
Can you test with this version? |
You must remove the wrong version from sys.path (and perhaps from PATH). |
I mean, test with the dev version, if that doesn't work, try removing from sys.path and then from PATH. |
Can you test with this version? |
This patch did not solve the problem, the files are still copied from the wrong version. But removing the path with the wrong version of CUDA from PATH helped. |
Yes, I try with version: 6.14.0.dev1 |
PS C:\Projects\python_projects\cx_freeze_issues\cuda_dlls_versions\venv\Scripts> .\python.exe -m pip list
Package Version
------------------ ------------
certifi 2022.12.7
charset-normalizer 2.1.1
cx-Freeze 6.14.0.dev1
cx-Logging 3.1.0
idna 3.4
importlib-metadata 5.2.0
lief 0.12.3
numpy 1.24.0
packaging 22.0
Pillow 9.3.0
pip 22.3.1
requests 2.28.1
setuptools 65.6.3
torch 1.11.0+cu113
torchvision 0.12.0+cu113
typing_extensions 4.4.0
urllib3 1.26.13
wheel 0.38.4
zipp 3.11.0 |
Code to reproduce: requirements.txt
Python project: import torch
print(f"PyTorch: version={torch.version.__version__}, cuda={torch.version.cuda}") Freezer script: set WORKSPACE=%~dp0
set SCRIPTS_DIRPATH=%WORKSPACE%\venv\Scripts
set PYTHON_EXE_PATH="%SCRIPTS_DIRPATH%\python.exe"
set FREEZER_EXE_PATH="%SCRIPTS_DIRPATH%\cxfreeze.exe"
set TARGET_DIR=out
set TARGET_NAME=project_out.exe
set PACKAGES=torch
set PROJECT_SOURCE_PY_PATH=project.py
%PYTHON_EXE_PATH% -m pip install --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze --upgrade
%FREEZER_EXE_PATH% -O -OO --target-dir=%TARGET_DIR% --target-name=%TARGET_NAME% --packages=%PACKAGES% %PROJECT_SOURCE_PY_PATH% > cx_freeze_log.txt In output file with log |
If I remove all CUDA paths from system PATH and use develop cx_freeze version then everything is OK. |
Describe the bug
I'm trying freeze project with PyTorch 1.11 + CUDA 11.3
But during freezing the project CUDA DLLs are copied from
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\*
instead of
...\venv\lib\site-packages\torch\lib\*
Desktop (please complete the following information):
Part of the cx-freeze output:
The text was updated successfully, but these errors were encountered: