8000 Python Crashes When Importing Torch With C API · Issue #104128 · pytorch/pytorch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Python Crashes When Importing Torch With C API #104128

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

Closed
tempaccountforissue opened this issue Jun 23, 2023 &midd 8000 ot; 20 comments
Closed

Python Crashes When Importing Torch With C API #104128

tempaccountforissue opened this issue Jun 23, 2023 · 20 comments
Assignees
Labels
module: third_party module: windows Windows support for PyTorch needs reproduction Someone else needs to try reproducing the issue given the instructions. No action needed from user triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@tempaccountforissue
Copy link
tempaccountforissue commented Jun 23, 2023

🐛 Describe the bug

EDIT: Please read my comment to @malfet below. It isn't the case that Python is crashing. Rather, my C++ file seems to hang midway through importing torch when I call PyImport_ImportModule.

I'm trying to embed Python into a C++ based application using the Python/C API. If I don't include an embedded Python installation inside my projects folder, then the program uses my local Python install by default. Using the local install doesn't result in any errors and torch is able to import successfully. However, if I include a Windows embeddable package (64-bit) version of Python in my projects folder, then Python crashes after calling PyImport_ImportModule("importsFile") in my C++ file.

Inside of importsFile.pyI have the following code:

import numpy as np
import matplotlib
import torch

If I comment out import torch, then the other modules are able to import without error. However, if I leave import torch uncommented, then Python crashes.

I'm not sure if this is a bug on Python's side or PyTorch's side. Python only seems to crash when importing torch specifically, so it seems to me like it should be on PyTorch's side, but I may be wrong about this.

Is this a known issue?
How can I fix it?

Versions

PyTorch version: 2.0.1+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 10 Education
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.19041-SP0
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3070 Ti
Nvidia driver version: 535.98
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture=9
CurrentClockSpeed=3701
DeviceID=CPU0
Family=107
L2CacheSize=6144
L2CacheSpeed=
Manufacturer=AuthenticAMD
MaxClockSpeed=3701
Name=AMD Ryzen 9 5900X 12-Core Processor
ProcessorType=3
Revision=8448

Versions of relevant libraries:
[pip3] numpy==1.24.1
[pip3] torch==2.0.1+cu118
[pip3] torchaudio==2.0.2+cu118
[pip3] torchvision==0.15.2+cu118
[conda] Could not collect

cc @peterjc123 @mszhanyi @skyline75489 @nbcsm @vladimir-aubrecht @iremyux @Blackhex @cristianPanaite

@mahdimedfouni

This comment was marked as off-topic.

@tempaccountforissue
Copy link
Author

@mahdimedfouni I don't know what you're asking.

@malfet malfet added module: windows Windows support for PyTorch module: third_party needs reproduction Someone else needs to try reproducing the issue given the instructions. No action needed from user triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jun 26, 2023
@malfet
Copy link
Contributor
malfet commented Jun 26, 2023

Can you please provide an source code of your example and backtrace of the crash.

@tempaccountforissue
Copy link
Author
tempaccountforissue commented Jun 28, 2023

@malfet I'm using a fork of a fork of a five year old GitHub project that's heavily embedded into my own project. The closest I can get to providing source code is linking this line as the one causing issues. I do have a small update as well. I tried attaching my projects .exe file in VS Code for debugging and I found that it isn't the case that Python is crashing. Rather, my C++ file seems to hang midway through importing torch when I call PyImport_ImportModule. It seems to get stuck when trying to load nvrtc-builtins64_118.dll. This isn't the case if I try to import torch directly from python.exe or if I use a local installation rather than an embedded one. Do you know why this could be?

@tempaccountforissue
Copy link
Author

This is the output when torch imports properly:

'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_ctypes.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs\libffi-7.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_bz2.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_lzma.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\asmjit.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\c10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\c10_cuda.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\caffe2_nvrtc.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\nvrtc64_112_0.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cublas64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cublasLt64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Windows\System32\nvcuda.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudart64_110.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn_adv_infer64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn_ops_infer64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn_adv_train64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn_ops_train64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn_cnn_infer64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\zlibwapi.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cudnn_cnn_train64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cufft64_10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cufftw64_10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cupti64_2022.3.0.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\curand64_10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cusolver64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cusolverMg64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\cusparse64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\fbgemm.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\libiomp5md.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\libiompstubs5md.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\nvfuser_codegen.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\nvToolsExt64_1.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch_cuda.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch_cpu.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch_cpu.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Unloaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch_cpu.dll'
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\uv.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\nvrtc-builtins64_118.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\shm.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch_global_deps.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch\lib\torch_python.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_socket.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs\select.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\torch_C.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy.libs\libopenblas64__v0.3.21-gcc_10_3_0.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\core_multiarray_umath.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\core_multiarray_tests.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\linalg_umath_linalg.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\fft_pocketfft_internal.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random\mtrand.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random\bit_generator.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_common.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_hashlib.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs\libcrypto-1_1.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_bounded_integers.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_mt19937.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_philox.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_pcg64.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\U 8000 sers\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_sfc64.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\numpy\random_generator.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_multiprocessing.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_ssl.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs\libssl-1_1.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs\unicodedata.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_queue.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\Lib\site-packages\nvfuser_C.cp39-win_amd64.pyd'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_decimal.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_asyncio.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\AppData\Local\Programs\Python\Python39\DLLs_overlapped.pyd'. 

This is the output when torch fails to import:

'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\python3.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\DLLs_ctypes.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\DLLs\libffi-7.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\DLLs_bz2.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\DLLs_lzma.pyd'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\asmjit.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\c10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\c10_cuda.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\caffe2_nvrtc.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\nvrtc64_112_0.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cublas64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cublasLt64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Windows\System32\nvcuda.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudart64_110.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn_adv_infer64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn_ops_infer64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn_adv_train64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn_ops_train64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn_cnn_infer64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\zlibwapi.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cudnn_cnn_train64_8.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cufft64_10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cufftw64_10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cupti64_2022.3.0.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\curand64_10.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cusolver64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cusolverMg64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\cusparse64_11.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\fbgemm.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\libiomp5md.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\libiompstubs5md.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\nvfuser_codegen.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\nvToolsExt64_1.dll'. 
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\torch_cuda.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\torch_cpu.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\torch_cpu.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Unloaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\torch_cpu.dll'
'MyProject.exe' (Win32): Loaded 'C:\Users\Name\Downloads\MyProject\Binaries\Win64\Lib\site-packages\torch\lib\uv.dll'. Module was built without symbols.
'MyProject.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. 

@andreigh
Copy link
Contributor
andreigh commented Sep 9, 2023

Run "gflags /i MyProject.exe +sls" after compiling your exe, and then debug in Visual Studio, this should show more details on loading the DLLs

@tempaccountforissue
Copy link
Author

@andreigh I've never used gflags before. I tried running the command in Command Prompt, but I got this error:

'gflags' is not recognized as an internal or external command,
operable program or batch file.

Do I need to download something to use gflags?

I found these 2 potential sources:
https://github.com/gflags/gflags/tree/master
https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/

Please let me know if either of these are correct or if there's something else I need.

@andreigh
Copy link
Contributor
andreigh commented Sep 10, 2023 via email

@tempaccountforissue
Copy link
Author
tempaccountforissue commented Sep 12, 2023

Yes you need to download it from https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-download-tools. This is very helpful to debug various DLL loading issues.

On Sat, Sep 9, 2023, 5:24 PM tempaccountforissue @.> wrote: @andreigh https://github.com/andreigh I've never used gflags before. I tried running the command in Command Prompt, but I got this error: 'gflags' is not recognized as an internal or external command, operable program or batch file. Do I need to download something to use gflags? I found these 2 potential sources: https://github.com/gflags/gflags/tree/master https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/ Please let me know if either of these are correct or if there's something else I need. — Reply to this email directly, view it on GitHub <#104128 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS4G672CMQZ2B5TQDS6FCDXZTUCBANCNFSM6AAAAAAZSB4OTE . You are receiving this because you were mentioned.Message ID: @.>

I was able to download gflags and run the command. It returned a huge debug log, so I'm only including the last hundred or so lines since that should be where the DLL is failing to load.

EDIT: I think this line is what's causing the DLL to fail to load, but I'm not sure what it means.
7914:3774 @ 1888763468 - LdrpFindDllActivationContext - INFO: Probing for the manifest of DLL "C:\Windows\System32\PSAPI.DLL" failed with status 0xc000008a

7914:3f24 @ 1888762484 - LdrpSearchPath - ENTER: DLL name: torch_cpu.dll
7914:3f24 @ 1888762484 - LdrpResolveDllName - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll
7914:3f24 @ 1888762484 - LdrpResolveDllName - RETURN: Status: 0x00000000
7914:3f24 @ 1888762484 - LdrpSearchPath - RETURN: Status: 0x00000000
7914:75f0 @ 1888762562 - LdrpMinimalMapModule - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cuda_cu.dll
'MyProject-Win64-DebugGame.exe' (Win32): Loaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cuda_cu.dll'. Module was built without symbols.
7914:75f0 @ 1888762562 - LdrpMinimalMapModule - RETURN: Status: 0x00000000
7914:75f0 @ 1888762578 - LdrpFindKnownDll - ENTER: DLL name: torch_cpu.dll
7914:75f0 @ 1888762578 - LdrpFindKnownDll - RETURN: Status: 0xc0000135
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-runtime-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-math-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-heap-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-stdio-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-utility-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-environment-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-filesystem-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-string-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-convert-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-time-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888762578 - LdrpSearchPath - ENTER: DLL name: torch_cpu.dll
7914:75f0 @ 1888762578 - LdrpResolveDllName - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll
7914:75f0 @ 1888762578 - LdrpResolveDllName - RETURN: Status: 0x00000000
7914:75f0 @ 1888762578 - LdrpSearchPath - RETURN: Status: 0x00000000
7914:75f0 @ 1888763468 - LdrpMinimalMapModule - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll
7914:3f24 @ 1888763468 - LdrpMinimalMapModule - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll
7914:3774 @ 1888763468 - LdrpMinimalMapModule - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll
'MyProject-Win64-DebugGame.exe' (Win32): Loaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll'. Module was built without symbols.
7914:75f0 @ 1888763468 - LdrpMinimalMapModule - RETURN: Status: 0x00000000
'MyProject-Win64-DebugGame.exe' (Win32): Loaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll'. Module was built without symbols.
'MyProject-Win64-DebugGame.exe' (Win32): Loaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll'. Module was built without symbols.
'MyProject-Win64-DebugGame.exe' (Win32): Unloaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll'
7914:3f24 @ 1888763468 - LdrpMinimalMapModule - RETURN: Status: 0xc000022d
'MyProject-Win64-DebugGame.exe' (Win32): Unloaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\torch_cpu.dll'
7914:3774 @ 1888763468 - LdrpMinimalMapModule - RETURN: Status: 0xc000022d
7914:75f0 @ 1888763468 - LdrpFindKnownDll - ENTER: DLL name: uv.dll
7914:75f0 @ 1888763468 - LdrpFindKnownDll - RETURN: Status: 0xc0000135
7914:3774 @ 1888763468 - LdrpSearchPath - ENTER: DLL name: uv.dll
7914:3774 @ 1888763468 - LdrpResolveDllName - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\uv.dll
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-runtime-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-heap-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-math-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-environment-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-string-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-convert-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-stdio-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-locale-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-filesystem-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-utility-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-time-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-process-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpResolveDllName - RETURN: Status: 0x00000000
7914:3774 @ 1888763468 - LdrpSearchPath - RETURN: Status: 0x00000000
7914:3774 @ 1888763468 - LdrpMinimalMapModule - ENTER: DLL name: C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\uv.dll
'MyProject-Win64-DebugGame.exe' (Win32): Loaded 'C:\Users\Name\Downloads\Windows\MyProject\Binaries\Win64\torch\lib\uv.dll'. Module was built without symbols.
7914:3774 @ 1888763468 - LdrpMinimalMapModule - RETURN: Status: 0x00000000
7914:3774 @ 1888763468 - LdrpFindKnownDll - ENTER: DLL name: PSAPI.DLL
7914:3774 @ 1888763468 - LdrpFindKnownDll - RETURN: Status: 0x00000000
7914:3774 @ 1888763468 - LdrpMinimalMapModule - ENTER: DLL name: C:\Windows\System32\PSAPI.DLL
'MyProject-Win64-DebugGame.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. 
7914:3774 @ 1888763468 - LdrpMinimalMapModule - RETURN: Status: 0x00000000
7914:3774 @ 1888763468 - LdrpFindDllActivationContext - INFO: Probing for the manifest of DLL "C:\Windows\System32\PSAPI.DLL" failed with status 0xc000008a
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-psapi-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-libraryloader-l1-2-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-profile-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-processthreads-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernel32.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-sysinfo-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-errorhandling-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-psapi-obsolete-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-psapi-ansi-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-runtime-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-stdio-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-convert-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-environment-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-heap-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-filesystem-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-string-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-utility-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-crt-math-l1-1-0.dll was redirected to C:\Windows\SYSTEM32\ucrtbase.dll by API set
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlQueryPerformanceCounter" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "SystemFunction036" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeSListHead" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "VerSetConditionMask" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeCriticalSection" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlEnterCriticalSection" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlLeaveCriticalSection" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlDeleteCriticalSection" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlTryEnterCriticalSection" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeConditionVariable" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlWakeConditionVariable" by name
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlWakeAllConditionVariable" by name
7914:3774 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-synch-l1-2-0 was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:3774 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "SleepConditionVariableCS" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeSListHead" by name
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-synch-l1-2-0 was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "InitOnceComplete" by name
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-synch-l1-2-0 was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "InitOnceBeginInitialize" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlAcquireSRWLockExclusive" by name
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-synch-l1-2-0 was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "InitOnceExecuteOnce" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlAllocateHeap" by name
7914:75f0 @ 1888763468 - LdrpPreprocessDllName - INFO: DLL api-ms-win-core-sysinfo-l1-1-0 was redirected to C:\Windows\SYSTEM32\kernelbase.dll by API set
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "GetLogicalProcessorInformationEx" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeCriticalSection" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlEnterCriticalSection" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlLeaveCriticalSection" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlDeleteCriticalSection" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeSRWLock" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlReleaseSRWLockExclusive" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlReleaseSRWLockShared" by name
7914:75f0 @ 1888763468 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlAcquireSRWLockShared" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlAllocateHeap" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeCriticalSection" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlEnterCriticalSection" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlLeaveCriticalSection" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeSListHead" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlTryEnterCriticalSection" by name
7914:3f24 @ 1888763500 - Ldr 8000 pGetProcedureAddress - INFO: Locating procedure "RtlDeleteCriticalSection" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeSListHead" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlAllocateHeap" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeCriticalSection" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlEnterCriticalSection" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlLeaveCriticalSection" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlTryEnterCriticalSection" by name
7914:6be4 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlDeleteCriticalSection" by name
7914:3f24 @ 1888763500 - LdrpGetProcedureAddress - INFO: Locating procedure "RtlInitializeSListHead" by name
The thread 'Foreground Worker #0' (0x96e0) has exited with code 0 (0x0).
The thread 0xa54 has exited with code 0 (0x0).
The thread 0xf5c has exited with code 0 (0x0).
The thread 0x75f0 has exited with code 0 (0x0).
The thread 0x3f24 has exited with code 0 (0x0).
The thread 0x3774 has exited with code 0 (0x0).
The thread 'Foreground Worker #1' (0x2fbc) has exited with code 0 (0x0).
The thread 'Background Worker #11' (0x34b0) has exited with code 0 (0x0).
The thread 'Background Worker #7' (0x257c) has exited with code 0 (0x0).
The thread 'Background Worker #15' (0x93e4) has exited with code 0 (0x0).
The thread 'GameThread' (0x6be4) has exited with code 0 (0x0).
The thread 'Background Worker #10' (0xa4cc) has exited with code 0 (0x0).
The thread 'Background Worker #16' (0x56c0) has exited with code 0 (0x0).
The thread 'Background Worker #21' (0xa4a0) has exited with code 0 (0x0).
The thread 'Background Worker #3' (0x7168) has exited with code 0 (0x0).
The thread 'Background Worker #19' (0x5174) has exited with code 0 (0x0).
The thread 'Background Worker #20' (0x8120) has exited with code 0 (0x0).
The thread 'BackgroundThreadPool #1' (0x7510) has exited with code 0 (0x0).
The thread 'Reserve Worker #0' (0x392c) has exited with code 0 (0x0).
The thread 'Reserve Worker #3' (0x473c) has exited with code 0 (0x0).
The thread 'Reserve Worker #1' (0xa6ec) has exited with code 0 (0x0).
The thread 'Background Worker #5' (0x96ac) has exited with code 0 (0x0).
The thread 'Reserve Worker #4' (0x281c) has exited with code 0 (0x0).
The thread 'Reserve Worker #2' (0x83dc) has exited with code 0 (0x0).
The thread 'Reserve Worker #5' (0x2780) has exited with code 0 (0x0).
The thread 'Reserve Worker #8' (0xa1c0) has exited with code 0 (0x0).
The thread 'Reserve Worker #7' (0x8c34) has exited with code 0 (0x0).
The thread 'Background Worker #4' (0x773c) has exited with code 0 (0x0).
The thread 'Reserve Worker #9' (0x5598) has exited with code 0 (0x0).
The thread 'Reserve Worker #11' (0x26e0) has exited with code 0 (0x0).
The thread 'Reserve Worker #14' (0x9c7c) has exited with code 0 (0x0).
The thread 'Reserve Worker #13' (0x45a0) has exited with code 0 (0x0).
The thread 'Background Worker #9' (0x6f74) has exited with code 0 (0x0).
The thread 'Reserve Worker #16' (0x9078) has exited with code 0 (0x0).
The thread 'Reserve Worker #17' (0x8aa0) has exited with code 0 (0x0).
The thread 'Reserve Worker #19' (0x60a4) has exited with code 0 (0x0).
The thread 'Reserve Worker #18' (0x9258) has exited with code 0 (0x0).
The thread 'Reserve Worker #21' (0x6570) has exited with code 0 (0x0).
The thread 'FAsyncWriter_MyProject' (0x757c) has exited with code 0 (0x0).
The thread 'FMediaTicker' (0x2e88) has exited with code 0 (0x0).
The thread 'Background Worker #8' (0x7f08) has exited with code 0 (0x0).
The thread 0xa258 has exited with code 0 (0x0).
The thread 'HttpManagerThread' (0x2778) has exited with code 0 (0x0).
The thread 'OnlineAsyncTaskThreadNull DefaultInstance(1)' (0x8da0) has exited with code 0 (0x0).
The thread 'Background Worker #6' (0x7048) has exited with code 0 (0x0).
The thread 'IOThreadPool #0' (0x97bc) has exited with code 0 (0x0).
The thread 'IOThreadPool #1' (0x4fc0) has exited with code 0 (0x0).
The thread 0x26e8 has exited with code 0 (0x0).
The thread 'IOThreadPool #2' (0x86dc) has exited with code 0 (0x0).
The thread 0x995c has exited with code 0 (0x0).
The thread 'IoService' (0x5a1c) has exited with code 0 (0x0).
The thread 'IoDispatcher' (0x4654) has exited with code 0 (0x0).
The thread 0x18c4 has exited with code 0 (0x0).
The thread 0x7208 has exited with code 0 (0x0).
The thread 0x13f8 has exited with code 0 (0x0).
The thread 0x2be8 has exited with code 0 (0x0).
The thread 0x9220 has exited with code 0 (0x0).
The thread 'Background Worker #12' (0xa5a0) has exited with code 0 (0x0).
The thread 'D3D Background Thread 2' (0x2270) has exited with code 0 (0x0).
The thread 'D3D Background Thread 3' (0x586c) has exited with code 0 (0x0).
The thread 0x1d60 has exited with code 0 (0x0).
The thread 0x1bfc has exited with code 0 (0x0).
The thread 0x6304 has exited with code 0 (0x0).
The thread 'Background Worker #17' (0x3f68) has exited with code 0 (0x0).
The thread 'RenderThread 0' (0x9c28) has exited with code 0 (0x0).
The thread 'RTHeartBeat 0' (0x6f24) has exited with code 0 (0x0).
The thread 'RHIThread' (0x938c) has exited with code 0 (0x0).
The thread 0x4740 has exited with code 0 (0x0).
The thread 0x7300 has exited with code 0 (0x0).
The thread 0xa22c has exited with code 0 (0x0).
The thread 0x3eb8 has exited with code 0 (0x0).
The thread 'NVFBCAsyncThread' (0xa04c) has exited with code 0 (0x0).
The thread 0x73dc has exited with code 0 (0x0).
The thread 'Background Worker #14' (0x4240) has exited with code 0 (0x0).
The thread 'BackgroundThreadPool #0' (0x7ea4) has exited with code 0 (0x0).
The thread 'Background Worker #2' (0x7760) has exited with code 0 (0x0).
The thread 'Reserve Worker #6' (0x595c) has exited with code 0 (0x0).
The thread 'Reserve Worker #10' (0xa1a4) has exited with code 0 (0x0).
The thread 'Reserve Worker #12' (0x1978) has exited with code 0 (0x0).
The thread 'Reserve Worker #15' (0xa6d4) has exited with code 0 (0x0).
The thread 'Reserve Worker #20' (0x5ee8) has exited with code 0 (0x0).
The thread 'IOThreadPool #3' (0x2fc4) has exited with code 0 (0x0).
The thread 'Background Worker #18' (0x9c24) has exited with code 0 (0x0).
The thread 0x1d44 has exited with code 0 (0x0).
The thread 'D3D Background Thread 0' (0x90d4) has exited with code 0 (0x0).
The thread 0x850c has exited with code 0 (0x0).
The thread 'D3D Background Thread 1' (0x76b4) has exited with code 0 (0x0).
The thread 'Background Worker #13' (0xdc4) has exited with code 0 (0x0).
The program '[30996] MyProject-Win64-DebugGame.exe' has exited with code 0 (0x0).

@andreigh
Copy link
Contributor

Can you save and attach the entire huge log please ? Thank you

@tempaccountforissue
Copy link
Author
tempaccountforissue commented Sep 14, 2023

Can you save and attach the entire huge log please ? Thank you

Sure thing, here it is.
DebugLog.txt

Just as a heads up, I made my project with Unreal Engine, so some of the debug might have more to do with Unreal than PyTorch, but idk.

@andreigh
Copy link
Contributor

Nothing related to PyTorch in the log.
Do you have the source code for that ue_site module that's imported via "if (PyImport_ImportModule("ue_site"))" ?

@tempaccountforissue
Copy link
Author

Nothing related to PyTorch in the log. Do you have the source code for that ue_site module that's imported via "if (PyImport_ImportModule("ue_site"))" ?

If you do ctrl+f and search for torch it does mention it.

This is the source code for ue_site.py:

print("Running ue_site")
import torch
print("Not Running ue_site")

@andreigh
Copy link
Contributor

Yes it does, I wanted to say no errors related to PyTorch in that log :)
Does the same error happens in Release mode for your project ?

@tempaccountforissue
Copy link
Author

Yes it does, I wanted to say no errors related to PyTorch in that log :) Does the same error happens in Release mode for your project ?

It's weird, even before running gflags it doesn't return an error. It just sort of freezes half way through importing torch. Release mode also has the same issue. If it'd make it easier to debug, I could send you the projects folder to your email?

@tempaccountforissue
Copy link
Author

@andreigh Hello, it's been about a week so I just wanted to follow up and check if you saw my last comment.

@andreigh
Copy link
Contributor
andreigh commented Sep 21, 2023 via email

@tempaccountforissue
Copy link
Author

@andreigh I just sent over a mega link for my project to the email on your profile page. Please let me know if you received it. If it is able to work on your computer, but not on mine, then a remote debugging session would definitely be good.

@ozanMSFT ozanMSFT self-assigned this Nov 13, 2023
@kalaskarsanket kalaskarsanket moved this from Backlog to Groomed in PyTorch On Windows Dec 19, 2023
@kalaskarsanket kalaskarsanket moved this from Groomed to In Progress in PyTorch On Windows Mar 18, 2024
@kalaskarsanket kalaskarsanket moved this from In Progress to Groomed in PyTorch On Windows Apr 15, 2024
@mantaionut mantaionut assigned ozanMSFT and mantaionut and unassigned ozanMSFT Jul 24, 2024
@mantaionut mantaionut moved this from Groomed to In Progress in PyTorch On Windows Jul 24, 2024
@mantaionut mantaionut assigned malfet and unassigned malfet Jul 24, 2024
@mantaionut
Copy link
Collaborator

@tempaccountforissue any luck with the debugging session?
I tested with UE5 with their Python extension and had no issue.
Do you still encounter this issue?

@mantaionut
Copy link
Collaborator

I am closing this issue due to a lack of activity and since I could not reproduce it. Please don't hesitate to open a new issue if you still encounter this issue.

@github-project-automation github-project-automation bot moved this from In Progress to Done in PyTorch On Windows Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: third_party module: windows Windows support for PyTorch needs reproduction Someone else needs to try reproducing the issue given the instructions. No action needed from user triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
Status: Done
Development

No branches or pull requests

6 participants
0