Skip to content

Latest commit

 

History

History
80 lines (60 loc) · 4.75 KB

README.md

File metadata and controls

80 lines (60 loc) · 4.75 KB

CV-CUDA Samples

Description

These are some sample applications showcasing various CV-CUDA APIs. Sample applications are available in C++ and Python.

Pre-requisites

Setting up the following is only required if you want to setup and run the samples in a docker container:

Setup to compile the sample from source.

  1. Get your CUDA and TensorRT installations ready. If you wish to install CUDA and TensorRT on your existing system you may do so by downloading those packages from NVIDIA's website. Or if you wish to work with in a docker container, you can use the TensorRT docker from NVIDIA NGC's catalog. It comes with CUDA and TensorRT pre-installed. Make sure you have setup NGC account properly and that your local docker installation has been logged into nvcr.io domain to be able to pull from that registry. Run the following command to start the container and continue rest of the installation steps in that container. Fill in the local_mount_path and docker_mount_path to reflect any paths on your system which you want to mount inside the container as well. This container comes with Ubuntu 20.04 with Python 3.8.10.

    docker run -it --gpus=all -v <local_mount_path>:<docker_mount_path> nvcr.io/nvidia/tensorrt:22.09-py3
    
  2. Make sure that the other helper scripts present in the samples/scripts folder is executable by executing following chmod commands.

    cd samples
    chmod a+x scripts/*.sh
    chmod a+x scripts/*.py
    
  3. Install all the dependencies required to run the samples. These are mentioned above in the prerequisites section. A convenient script to install all the dependencies is available at scripts/install_dependencies.sh. This script may require sudo privileges depending on your setup.

    ./scripts/install_dependencies.sh
    
  4. Install the CV-CUDA packages. Please note that since the above container comes with Python 3.8.10, we will install nvcv-python3.8-0 package as mentioned below. If you have any other Python distributions, you would need to use the appropriate nvcv-python Debian package below.

    dpkg -i nvcv-lib-0.3.1_beta-cuda11-x86_64-linux.deb
    dpkg -i nvcv-dev-0.3.1_beta-cuda11-x86_64-linux.deb
    dpkg -i cvcuda-samples-0.3.1_beta-cuda11-x86_64-linux.deb
    dpkg -i nvcv-python3.8-0.3.1_beta-cuda11-x86_64-linux.deb
    
  5. Copy the samples folder to the target directory.

    cp -rf /opt/nvidia/cvcuda*/samples ~/
    cd ~/samples
    
  6. Build the samples (whichever sample requires a build)

    ./scripts/build_samples.sh
    
  7. Run all the samples on by one. The run_samples.sh script conveniently runs all the samples in one shot. Some samples may use the TensorRT backend to run the inference and it may require a serialization step to convert a PyTorch model into a TensorRT model. This step should take some time depending on the GPUs used but usually it is only done once during the first run of the sample. The run_samples.sh script is supplied to serve only as a basic test case to test the samples under most frequently used command line parameters. It does not cover all the settings and command line parameters a sample may have to offer. Please explore and run the samples individually to explore all the capabilities of the samples.

    ./scripts/run_samples.sh