Skip to content

Commit

Permalink
docs: minor improvements to CUDA docs in READMEs
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram committed Oct 21, 2020
1 parent eec3fce commit d25e225
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The GoCV package provides Go language bindings for the [OpenCV 4](http://opencv.

The GoCV package supports the latest releases of Go and OpenCV (v4.5.0) on Linux, macOS, and Windows. We intend to make the Go language a "first-class" client compatible with the latest developments in the OpenCV ecosystem.

GoCV supports [CUDA](https://en.wikipedia.org/wiki/CUDA) for hardware acceleration using Nvidia GPUs. Check out the [CUDA README](./cuda/README.md) for more info on how to use GoCV with OpenCV/CUDA.

GoCV also supports [Intel OpenVINO](https://software.intel.com/en-us/openvino-toolkit). Check out the [OpenVINO README](./openvino/README.md) for more info on how to use GoCV with the Intel OpenVINO toolkit.

## How to use
Expand Down
28 changes: 15 additions & 13 deletions cuda/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Cuda
# CUDA

In order to use the cuda package, the cuda toolkit from nvidia needs to be installed on the host system.
CUDA backend for DNN module requires CC (Compute Capability) 5.3 or higher. Check your GPU https://developer.nvidia.com/cuda-gpus
In order to use the GoCV `cuda` package, the CUDA toolkit from nvidia needs to be installed on the host system.

The CUDA backend for DNN module requires CC (Compute Capability) 5.3 or higher. Check your GPU https://developer.nvidia.com/cuda-gpus

Please see https://docs.nvidia.com/cuda/index.html for more information.

Furthermore opencv must be compiled with cuda support.
Furthermore opencv must be compiled with CUDA support.

GoCV supports using the Cuda as a backend for the OpenCV deep neural network (DNN) module.
GoCV also supports using CUDA as a backend for the OpenCV deep neural network (DNN) module.

## How to use

This code loads a Caffe model, and then uses Cuda to prepare it for execution on the GPU:
This code loads a Caffe model, and then uses CUDA to prepare it for execution on the GPU:

```go
net := gocv.ReadNet("/path/to/your/model.caffemodel", "/path/to/your/config.proto")
Expand All @@ -24,20 +25,21 @@ net.SetPreferableBackend(gocv.NetBackendType(gocv.NetBackendCUDA))
net.SetPreferableTarget(gocv.NetTargetType(gocv.NetTargetCUDA))
```

## Install Cuda
## Installing CUDA

Download and install packages from https://developer.nvidia.com/cuda-downloads

example 'cuda_10.2.89_440.33.01_linux.run'
For example, download 'cuda_10.2.89_440.33.01_linux.run'

Download and install packages from https://developer.nvidia.com/rdp/cudnn-archive

example 'cuDNN Runtime Library for Ubuntu18.04 (Deb)' and 'cuDNN Developer Library for Ubuntu18.04 (Deb)'
For example the 'cuDNN Runtime Library for Ubuntu18.04 (Deb)' and 'cuDNN Developer Library for Ubuntu18.04 (Deb)'

## Compiling opencv with cuda
## Compiling OpenCV with CUDA

For now we have included the make target `install_cuda` that compiles opencv with cuda. (For more details on the compilation process please see the `Makefile`)
We have included the make target `install_cuda` that compiles OpenCV with CUDA support. (For more details on the compilation process please see the `Makefile`)

Simply issue the command `make install_cuda` and you should be good to go.
Run the command `make install_cuda` and you should be good to go.

If you need static opencv libraries

Expand All @@ -50,6 +52,6 @@ Then finally verify that it is all working

You should see something along the lines of:

gocv version: 0.19.0
gocv version: 0.25.0
cuda information:
Device 0: "GeForce MX150" 2003Mb, sm_61, Driver/Runtime ver.10.0/10.0

0 comments on commit d25e225

Please sign in to comment.