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
'Development > Onnx' 카테고리의 다른 글
[ONNX] Convert TorchScript model to Onnx model (0) | 2022.10.25 |
---|---|
[ONNX] Onnx-modifier (2) | 2022.10.21 |
[Onnx] onnx-simplifier dynamic batch 모델 사용 방법 (0) | 2022.02.04 |
[Onnx] onnx-simplifier를 이용한 onnx 모델 간소화 (0) | 2021.08.23 |
댓글