Skip to content
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

Cannot use GPU #661

Closed
hjj-lmx opened this issue Jul 30, 2024 · 6 comments
Closed

Cannot use GPU #661

hjj-lmx opened this issue Jul 30, 2024 · 6 comments
Labels
bug Something isn't working stale

Comments

@hjj-lmx
Copy link

hjj-lmx commented Jul 30, 2024

pip install rembg[gpu]
call
from rembg import remove
from PIL import Image
input_path = 'input.png'
output_path = 'output.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
GPU is not running

@hjj-lmx hjj-lmx added the bug Something isn't working label Jul 30, 2024
@dicebattle
Copy link

The same goes for me. I'll write down a little more detailed environment.
OS: Ubuntu 20.04
CUDA: 12.2
ONNX-Runtime: 1.18.1
rembg: (latest)

If I launch the program in server mode and check the GPU utilisation with the nvidia-smi command, the GPU is not running at all. On the other hand, if I check the CPU utilisation with the htop command, it is using all 12 cores.

@FuzzyCatZ
Copy link

Same with me

@gongminmin
Copy link

gongminmin commented Aug 23, 2024

My solution is

  1. Download CUDNN v9.2, extract, put its bin into the PATH.
  2. Download zlib (zlibwapi.dll on Windows), also put its path into PATH.
  3. pip uninstall onnxruntime_gpu
  4. pip install onnxruntime_gpu

Then it runs on GPU.

@lhh-pi
Copy link

lhh-pi commented Aug 23, 2024

providers = ['CUDAExecutionProvider', 'CPUExecutionProvider']
session = new_session(providers=providers)
f = remove(image, session=session)

You can try this. It worked for me.

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Sep 23, 2024
Copy link

github-actions bot commented Oct 7, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

5 participants