-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] GPU installation does not work #707
Comments
Same here... |
same here |
同样在这里 |
Same here |
same here |
Same... |
Unfortunately, at the moment I only have access to a Mac M1, so I can't test this issue on Windows with a GPU. I'd appreciate it if someone could investigate this issue further and maybe even open a PR :) |
Same here |
I have solved this issue by modifying a little bit of code in the library files first make sure that your onnxruntime library is gpu version or cpu version step 1 command : step 2: change write providers =['CUDAExecutionProvider'] in new_session function initialization this will force the onnxruntime to use CUDA it has worked for me on windows 10 , RTX 3060 12gb with Model birefnet-massive |
@ShyamCrossShore, could you help me fix this? I don’t have a GPU. 😞 Could you try testing with:
If this change allows it to run correctly on both GPU and CPU, we could open a PR to set these providers as the default. What do you think? |
I finally got this working. First, problem was that several libraries were not being loaded due to LD_LIBRARY_PATH not including them. I fixed it by: export LD_LIBRARY_PATH='/path/to/lib/python3.13/site-packages/nvidia/cublas/lib/':'/path/to/lib/python3.13/site-packages/onnxruntime/capi/':'/path/to/lib/python3.13/site-packages/nvidia/cudnn/lib/' Secondly, I explicitly specified CUDAExecutionProvider in rembg/sessions/base.py (I think the providers are not being passed in, CMIIW)
|
Describe the bug
GPU is not working
To Reproduce
I have a RTX 4080 GPU and Windows 11.
I used conda to create the environment:
conda create -n rembg python=3.12
And installed gpu support with (I need those specific versions for another:
conda install conda-forge::cuda-runtime=12.6.3 conda-forge::cudnn=9.3.0.75
A clean environment following the readme to install rembg with gpu
pip install "rembg[gpu,cli]"
when you use rembg cli or inside a python script gives this error
Expected behavior
It should work as previous versions
OS Version:
Windows 11 and Windows 10
Rembg version:
v2.0.61
Additional context
Tested with multiple PCs with Windows 11 and Windows 10, using RTX 4080 and RTX 4070. It works as planned with CPU when I install it with
pip install "rembg[cpu,cli]"
The text was updated successfully, but these errors were encountered: