Environment Information
-
Operating System: Windows 11 Professional (64-bit)
-
GPU: NVIDIA RTX 4060
-
Python: 3.11.7 (installed via official Python installer, not Anaconda)
-
Virtual Environment:
venv, located atF:\ai_data\.venv
System Dependencies
-
Microsoft Visual C++ Redistributable 2015–2022 (x64) — installed
-
Microsoft Visual C++ Redistributable 2015–2022 (x86) — installed
-
Both redistributables were reinstalled, and the system was rebooted multiple times
NVIDIA Driver & CUDA
Checked via nvidia-smi:
-
Driver Version: 591.74
-
CUDA Version (reported by driver): 13.1
-
PyTorch Installation Details
-
Installed using pip inside the virtual environment
-
Installation command used:
pip install torch torchvision -
Installed PyTorch version:
-
torch: 2.9.1
-
Build: Stable
-
Platform: Windows
-
Compute Platform: CPU
-
-
No errors were reported during installation
Verification:
python -m pip show torchOutput:
Name: torch Version: 2.9.1
Additional Attempts
I have repeatedly:
-
Deleted and recreated the virtual environment
-
Reinstalled PyTorch multiple times using pip
-
Tried different compute platforms, including:
-
CUDA 12.6
-
CUDA 12.8
-
CUDA 13.0
-
CPU-only builds
-
Despite these attempts, the issue remains unchanged.
The Problem
When running the following command inside the virtual environment:
import torchI consistently encounter this error:
OSError: [WinError 1114] The initialization routine of the dynamic link library (DLL) failed. Error loading "F:\ai_data\.venv\Lib\site-packages\torch\lib\c10.dll" or one of its dependencies.
Question
What could cause
c10.dll(or one of its dependencies) to fail during initialization on Windows, even though PyTorch installs successfully via pip, all Visual C++ Redistributables are installed, and the NVIDIA driver is up to date?Any guidance on diagnosing or resolving this issue would be greatly appreciated.
-