%matplotlib inline
import os
import torch
import torchvision
OSError Traceback (most recent call last)
in
1 get_ipython().run_line_magic(‘matplotlib’, ‘inline’)
2 import os
----> 3 import torch
4 import torchvision
D:\Anaconda3\lib\site-packages\torch_init _.py in
122 err = ctypes.WinError(last_error)
123 err.strerror += f’ Error loading “{dll}” or one of its dependencies.’
→ 124 raise err
125 elif res is not None:
126 is_loaded = True
OSError: [WinError 127] Error loading “D:\Anaconda3\lib\site-packages\torch\lib\c10_cuda.dll” or one of its dependencies.
Have you resolved this? I’m getting the same error.
If you are using torch Cuda 11.8, put cudart64_110 from cuda toolkit 11.4 inside torch/lib folder.
opened 09:08PM - 29 Jan 23 UTC
closed 10:04AM - 30 Jan 23 UTC
asking-for-help-with-local-system-issues
### Is there an existing issue for this?
- [X] I have searched the existing iss… ues and checked the recent builds/commits
### What happened?
I tried running stable-diffusion-webui on Windows 7, SP1, using the unofficial build of Python version 3.10.6 (PythonWin7).
The first time I run webui-user.bat, I get the following error:
`OSError: [WinError 126] Error loading "E:\stable-diffusion-webui\venv\lib\site-packages\torch\lib\cudart64_110.dll" or one of its dependencies.`
Screenshot:
![image](https://user-images.githubusercontent.com/28364655/215355694-79d1dce2-0a48-4384-8a6b-451b33b70107.png)
The cudart64_100.dll shipped with torch-1.13.1+cu117 seems to be incompatible with Windows 7.
- The last CUDA Toolkit released by Nvidia for Windows 7 is CUDA Toolkit 11.1.
- Stable-diffusion-webui currently uses PyTorch 1.13.1 compiled for CUDA 11.7.
- The Nvidia drivers 450.80.02+ for Windows 7 seem to be forward compatible with all versions of CUDA 11.x
Replacing the offending dll with the one from the CUDA Toolkit 11.1 for Windows 7, in the following locations seems to resolve the issue:
- .\venv\Lib\site-packages\torchvision
- .\venv\Lib\site-packages\torch\lib
So far I have generated thousands of images without encountering any errors or experiencing any speed degradations.
### Steps to reproduce the problem
Just run webui-user.bat on Windows 7 for the first time, and you will get an error similar to the following:
OSError: [WinError 126] Error loading "E:\stable-diffusion-webui\venv\lib\site-packages\torch\lib\cudart64_110.dll" or one of its dependencies.
### What should have happened?
The Nvidia drivers 450.80.02+ for Windows 7 seem to be forward compatible with all versions of CUDA 11.x, so please add a workaround to at least allow Windows 7 users to use cudart64_110.dll from CUDA 11.1 (last released CUDA Toolkit for Windows 7).
### Commit where the problem happens
7ff1ef77dd22f7b38612f91b389237a5dbef2474
### What platforms do you use to access the UI ?
Windows
### What browsers do you use to access the UI ?
Google Chrome
### Command Line Arguments
```Shell
No
```
### List of extensions
No
### Console logs
```Shell
OSError: [WinError 126] Error loading "E:\stable-diffusion-webui\venv\lib\site-packages\torch\lib\cudart64_110.dll" or one of its dependencies.
```
### Additional information
_No response_