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

Can't get ORTStableDiffusionPipeline to run on GPU on neither AWS nor GCP fresh instances #1844

Open
2 of 4 tasks
iuliaturc opened this issue May 3, 2024 · 1 comment
Open
2 of 4 tasks
Labels
bug Something isn't working

Comments

@iuliaturc
Copy link

System Info

The same problem manifests on both of these systems:

System 1
---
- Amazon EC2 instance
- Type: g5.2xlarge
- Image: Deep Learning OSS Nvidia Driver AMI GPU PyTorch 2.2.0 (Amazon Linux 2)
- Python 3.10.9
- optimum==1.19.1
- onnx==1.16.0
- onnxruntime-gpu==1.16.3 (won't let me install 1.17)

System 2
---
- GCP NVIDIA A100/40GB instance
- Type: a2-highgpu-1g
- Image: deeplearning-vm
- Python 3.10.13
- optimum==1.19.1
- onnx==1.16.0
- onnxruntime-gpu==1.17.1

Who can help?

Pipelines: @philschmid
ONNX Runtime: @JingyaHuang, @echarlaix

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction (minimal, reproducible, runnable)

Step 1: Verify that ONNX sees the GPU:

>>> import onnxruntime as ort
>>> print(ort.get_device())
GPU
>>> print(ort.get_available_providers())
['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider']

Step 2: Attempt to run this official example using the 'CUDAExecutionProvider':

from optimum.onnxruntime import ORTStableDiffusionPipeline
pipeline = ORTStableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", revision="onnx", provider="CUDAExecutionProvider")

Error:

2024-05-03 19:32:16.794901908 [W:onnxruntime:Default, onnxruntime_pybind_state.cc:861 CreateExecutionProviderInstance] Failed to create CUDAExecutionProvider. Please reference https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirementsto ensure all dependencies are met.

From what I can tell, the requirements are met, at least on the GCP setup:
CUDA version = 12.1
cuDNN version = 8.9
onnxruntime version = 1.17

Note that, if I omit the provider, the pipeline will run on the CPU (I can tell because one image generation takes ~3 minutes, and nvidia-smi shows no activity on the GPU).

Expected behavior

pipeline = ORTStableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", revision="onnx", provider="CUDAExecutionProvider") should run with no errors.

@iuliaturc iuliaturc added the bug Something isn't working label May 3, 2024
@iuliaturc
Copy link
Author

FYI, I just tried your Docker image with an additional pip install optimum[onnxruntime-gpu], and the behavior is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant