Skip to content

A docker file example used to build OpenCV with cudacodec module.

Notifications You must be signed in to change notification settings

ljwwayneli/opencv-cuda-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

opencv-cuda-docker

OpenCV with CUDA docker image build settings based on CUDA containers.
Feel free to quote and modify as needed.

System Requirement

  • Ubuntu 22.04
  • NVIDIA GPU driver version 535.104.05 or later.
  • Docker engine.
  • NVIDIA container runtime.
  • NVIDIA Video Codec SDK. Recommended version 12.1.14.

Build Image

Modify the video_codec_sdk zip file path in dockerfile and execute build_image.sh.
If necessary, you can use ARG to adjust the version number in dockerfile.

Push Image

docker tag opencv-cuda:{opencv_version}-cuda{cuda_version}-ubuntu{ubuntu_version} {your-docker-hub}/opencv-cuda:{opencv_version}-cuda{cuda_version}-ubuntu{ubuntu_version}
docker push {your-docker-hub}/opencv-cuda:{opencv_version}-cuda{cuda_version}-ubuntu{ubuntu_version}

Run Image

docker run --rm -it --gpus=all opencv-cuda:{opencv_version}-cuda{cuda_version}-ubuntu{ubuntu_version}

Usage Sample

python3
import cv2
cv2.cuda.getCudaEnableDeviceCount()
cv2.cuda.printCudaDeviceInfo(0)
video_reader = cv2.cudacodec.createVideoReader("your_video_source")

About

A docker file example used to build OpenCV with cudacodec module.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages