본문 바로가기
Development/Onnx

onnxruntime-gpu: Failed to create CUDAExecutionProvider

by shuka 2023. 5. 11.
728x90
728x90

onnxruntime-gpu: Failed to create CUDAExecutionProvider 경고

 

onnxruntime-gpu를 설치하고 onnx 모델을 테스트 하는데 다음과 같이 'Failed to create CUDAExecutionProvider'했다는 경고가 뜨면서 cpu로 model이 inference되는 상황이 발생했다.

 

[W:onnxruntime:Default, onnxruntime_pybind_state.cc:566 CreateExecutionProviderInstance] Failed to create CUDAExecutionProvider. Please reference https://onnxruntime.ai/docs/reference/execution-providers/ CUDA-ExecutionProvider.html#requirements to ensure all dependencies are met.

 

 

해결 방법

내 경우 해결 방법은 밑의 링크를 참고해서 해결했다.

 

pip install optimum[onnxruntime-gpu]

 

onnxruntime-gpu를 사용하기 위해서는 onnxruntime이 설치되어 있으면 안된다.

 

만약, 설치되어 있는 경우 pip uninstall onnxruntime을 해주고 onnxruntime-gpu를 설치해준다

 

 

https://huggingface.co/docs/optimum/main/en/onnxruntime/usage_guides/gpu#installation

 

Accelerated inference on NVIDIA GPUs

By default, ONNX Runtime runs inference on CPU devices. However, it is possible to place supported operations on an NVIDIA GPU, while leaving any unsupported ones on CPU. In most cases, this allows costly operations to be placed on GPU and significantly ac

huggingface.co

 

728x90
반응형

댓글