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

YOLOv7: use the correct version of ONNX Runtime for GPU #6940

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Oct 4, 2023

Motivation and context

Currently, we install plain onnxruntime, which means that when the function is deployed with deploy_gpu.sh, it ends up using the CPU anyway.

Fixes #6793.

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have added a description of my changes into the CHANGELOG file
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@bsekachev
Copy link
Member

@SpecLad

2023-12-01 12:23:24.752469237 [E:onnxruntime:Default, provider_bridge_ort.cc:1480 TryGetProviderInfo_CUDA] /onnxruntime_src/onnxruntime/core/session/provider_bridge_ort.cc:1193 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_cuda.so with error: libcublasLt.so.11: cannot open shared object file: No such file or directory

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

From this link https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements we probably need specific CUDA version compatible with onnx runtime version. My cuda is 12.1 and I got this error. It installed onnxruntime-gpu==1.16.3 in my case.

And it requires CUDNN. So, after research:

  • Correct base image is: nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
  • And probably we need to fix version of onnxruntime-gpu in yaml file.

Currently, we install plain `onnxruntime`, which means that when the function
is deployed with `deploy_gpu.sh`, it ends up using the CPU anyway.

`onnxruntime-gpu` depends on a specific version of CUDA, so update the base
image and bound the version of the package to avoid mismatches in the
future.
@SpecLad
Copy link
Contributor Author

SpecLad commented Dec 1, 2023

@bsekachev Thanks for the investigation. I updated the PR, could you try it again?

@bsekachev
Copy link
Member

Yes, it works in current configuration

@bsekachev bsekachev marked this pull request as ready for review December 2, 2023 11:19
Copy link

codecov bot commented Dec 2, 2023

Codecov Report

Merging #6940 (4f0cd7a) into develop (de4d4c1) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6940      +/-   ##
===========================================
- Coverage    81.50%   81.49%   -0.01%     
===========================================
  Files          365      365              
  Lines        39923    39923              
  Branches      3703     3703              
===========================================
- Hits         32538    32536       -2     
- Misses        7385     7387       +2     
Components Coverage Δ
cvat-ui 75.53% <ø> (-0.01%) ⬇️
cvat-server 87.09% <ø> (-0.01%) ⬇️

@bsekachev bsekachev merged commit 2811210 into cvat-ai:develop Dec 3, 2023
43 checks passed
@SpecLad SpecLad deleted the onnxruntime-gpu branch December 4, 2023 12:00
@cvat-bot cvat-bot bot mentioned this pull request Dec 11, 2023
amjadsaadeh pushed a commit to amjadsaadeh/cvat that referenced this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run YOLOv7 model, CPU memory usage increased significantly.
2 participants