### Setup CUDA Keyring and Update Repositories Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and install the CUDA keyring, then update the package list to include CUDA repositories. ```bash wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update ``` -------------------------------- ### Install CUDA Toolkit and Run Installer Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and silently install the CUDA toolkit. ```bash wget https://developer.download.nvidia.com/compute/cuda/12.6.3/local_installers/cuda_12.6.3_560.35.05_linux.run sudo sh cuda_12.6.3_560.35.05_linux.run --silent --toolkit ``` -------------------------------- ### Download and Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download the CUDA toolkit installer and silently install it with the toolkit option. ```bash wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run sudo sh cuda_11.1.1_455.32.00_linux.run --silent --toolkit ``` -------------------------------- ### Install NVIDIA Driver (Desktop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install the NVIDIA driver silently, disabling nouveau, enabling DKMS, installing libglvnd, and running nvidia-xconfig. This is for desktop installations. ```bash sudo sh NVIDIA-Linux-x86_64-515.65.01.run --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Install NVIDIA Driver (Laptop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install the NVIDIA driver silently, disabling nouveau, enabling DKMS, and installing libglvnd. This is for laptop installations. ```bash sudo sh NVIDIA-Linux-x86_64-515.65.01.run --silent --disable-nouveau --dkms --install-libglvnd ``` -------------------------------- ### Install System Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs necessary system packages for DeepStream and NVIDIA components. Ensure these are installed before proceeding. ```bash sudo apt-get install dkms sudo apt-get install libssl1.1 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev libjsoncpp-dev protobuf-compiler ``` -------------------------------- ### Install NVIDIA Driver (Desktop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on a desktop, disabling nouveau drivers, enabling DKMS, installing libglvnd, and running nvidia-xconfig. ```bash sudo sh NVIDIA-Linux-x86_64-510.47.03.run --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Download and Install CUDA Keyring Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads the CUDA keyring package and installs it, then updates the apt package list. ```bash wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update ``` -------------------------------- ### Install GCC 12 and Update Alternatives Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install GCC version 12 and configure the system to use it as the default compiler. ```bash sudo apt-get install gcc-12 g++-12 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12 sudo update-initramfs -u ``` -------------------------------- ### Install Essential Packages Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs fundamental development tools and kernel headers required for DeepStream installation. ```bash sudo apt-get update sudo apt-get install gcc make git libtool autoconf autogen pkg-config cmake python3 python3-dev python3-pip sudo apt-get install linux-headers-$(uname -r) ``` -------------------------------- ### Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads and installs the CUDA 12.8.1 toolkit silently. ```bash wget https://developer.download.nvidia.com/compute/cuda/12.8.1/local_installers/cuda_12.8.1_570.124.06_linux.run sudo sh cuda_12.8.1_570.124.06_linux.run --silent --toolkit ``` -------------------------------- ### Setup Inside DeepStream Docker Container Source: https://context7.com/marcoslucianops/deepstream-yolo/llms.txt Install necessary build tools and multimedia packages inside the Docker container. Compile the custom inference library and run the DeepStream application. ```bash # Inside container: apt-get install build-essential # Install multimedia packages (needed for MP4 streams with audio in DS 8.0) /opt/nvidia/deepstream/deepstream/user_additional_install.sh export CUDA_VER=12.8 make -C /workspace/nvdsinfer_custom_impl_Yolo clean && \ make -C /workspace/nvdsinfer_custom_impl_Yolo deepstream-app -c /workspace/deepstream_app_config.txt ``` -------------------------------- ### Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and silently install the CUDA toolkit. Ensure CUDA 11.4.1 is used. ```bash wget https://developer.download.nvidia.com/compute/cuda/11.4.1/local_installers/cuda_11.4.1_470.57.02_linux.run sudo sh cuda_11.4.1_470.57.02_linux.run --silent --toolkit ``` -------------------------------- ### Install OpenCV Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/INT8Calibration.md Installs the OpenCV development library using apt-get. Ensure your system's package list is up-to-date before running. ```bash sudo apt-get install libopencv-dev ``` -------------------------------- ### Install DeepStream SDK (6.0.1) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install DeepStream 6.0.1 for Servers and Workstations using the provided .deb package. ```bash sudo apt-get install ./deepstream-6.0_6.0.1-1_amd64.deb ``` -------------------------------- ### Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the CUDA toolkit, including the toolkit component. ```bash sudo sh cuda_11.6.1_510.47.03_linux.run --silent --toolkit ``` -------------------------------- ### Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads and installs the CUDA Toolkit silently. Ensure you have the correct version for your drivers. ```bash wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda_12.1.1_530.30.02_linux.run sudo sh cuda_12.1.1_530.30.02_linux.run --silent --toolkit ``` -------------------------------- ### Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and install the CUDA toolkit silently. This includes the necessary libraries and tools for GPU computing. ```bash wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run sudo sh cuda_11.8.0_520.61.05_linux.run --silent --toolkit ``` -------------------------------- ### Install DeepStream SDK (6.0) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install DeepStream 6.0 for Servers and Workstations using the provided .deb package. ```bash sudo apt-get install ./deepstream-6.0_6.0.0-1_amd64.deb ``` -------------------------------- ### Install DeepStream SDK Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install the DeepStream SDK from a local .deb package, clear the GStreamer registry cache, and create a symbolic link for CUDA. ```bash sudo apt-get install ./deepstream-5.1_5.1.0-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-11.1 /usr/local/cuda ``` -------------------------------- ### Install YOLOv9 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOv9.md Clone the YOLOv9 repository and install required Python packages. Ensure ONNX and related libraries are installed for model conversion. ```bash git clone https://github.com/WongKinYiu/yolov9.git cd yolov9 pip3 install -r requirements.txt pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install YOLOv13 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOv13.md Clone the YOLOv13 repository and install necessary Python packages. It is recommended to use a virtual environment. ```bash git clone https://github.com/iMoonLab/yolov13.git cd yolov13 pip3 install -e . pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install NVIDIA Driver (Desktop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver for desktops, disabling nouveau and enabling DKMS. This command should be run before rebooting. ```bash sudo sh NVIDIA-Linux-x86_64-535.179.run --no-cc-version-check --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Install Gold-YOLO Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/GoldYOLO.md Clone the Gold-YOLO repository and install the required Python packages. It's recommended to use a virtual environment. ```bash git clone https://github.com/huawei-noah/Efficient-Computing.git cd Efficient-Computing/Detection/Gold-YOLO pip3 install -r requirements.txt pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install NVIDIA Driver (Laptop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on a laptop, disabling nouveau drivers and enabling DKMS. This command also installs libglvnd. ```bash sudo sh NVIDIA-Linux-x86_64-510.47.03.run --silent --disable-nouveau --dkms --install-libglvnd ``` -------------------------------- ### Install DeepStream 7.1 Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and install DeepStream 7.1 for servers and workstations. This includes setting up CUDA symbolic links. ```bash wget --content-disposition 'https://api.ngc.nvidia.com/v2/resources/org/nvidia/deepstream/7.1/files?redirect=true&path=deepstream-7.1_7.1.0-1_amd64.deb' -O deepstream-7.1_7.1.0-1_amd64.deb sudo apt-get install ./deepstream-7.1_7.1.0-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-12.6 /usr/local/cuda ``` -------------------------------- ### Install NVIDIA Driver (Laptop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver for laptops, disabling nouveau and enabling DKMS. This command should be run before rebooting. ```bash sudo sh NVIDIA-Linux-x86_64-535.179.run --no-cc-version-check --silent --disable-nouveau --dkms --install-libglvnd ``` -------------------------------- ### Clone D-FINE Repo and Install Requirements Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/DFINE.md Clone the D-FINE repository and install necessary Python packages. It's recommended to use a Python virtual environment. ```bash git clone https://github.com/Peterande/D-FINE.git cd D-FINE pip3 install -r requirements.txt pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install DeepStream SDK Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs the DeepStream SDK from a .deb package, clears the GStreamer registry cache, and creates a symbolic link for CUDA. ```bash sudo apt-get install ./deepstream-6.1_6.1.0-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-11.6 /usr/local/cuda ``` -------------------------------- ### Install TensorRT and Associated Libraries Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Add NVIDIA CUDA repository, update package list, and install TensorRT development and runtime libraries along with cuDNN. ```bash sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ " sudo apt-get update sudo apt-get install libnvinfer-dev=10.4.0.26-1+cuda12.6 libnvinfer-dispatch-dev=10.4.0.26-1+cuda12.6 libnvinfer-dispatch10=10.4.0.26-1+cuda12.6 libnvinfer-headers-dev=10.4.0.26-1+cuda12.6 libnvinfer-headers-plugin-dev=10.4.0.26-1+cuda12.6 libnvinfer-lean-dev=10.4.0.26-1+cuda12.6 libnvinfer-lean10=10.4.0.26-1+cuda12.6 libnvinfer-plugin-dev=10.4.0.26-1+cuda12.6 libnvinfer-plugin10=10.4.0.26-1+cuda12.6 libnvinfer-vc-plugin-dev=10.4.0.26-1+cuda12.6 libnvinfer-vc-plugin10=10.4.0.26-1+cuda12.6 libnvinfer10=10.4.0.26-1+cuda12.6 libnvonnxparsers-dev=10.4.0.26-1+cuda12.6 libnvonnxparsers10=10.4.0.26-1+cuda12.6 tensorrt-dev=10.4.0.26-1+cuda12.6 libnvinfer-samples=10.4.0.26-1+cuda12.6 libnvinfer-bin=10.4.0.26-1+cuda12.6 libcudnn9-cuda-12=9.3.0.75-1 libcudnn9-dev-cuda-12=9.3.0.75-1 sudo apt-mark hold libnvinfer* libnvparsers* libnvonnxparsers* libcudnn9* python3-libnvinfer* uff-converter-tf* onnx-graphsurgeon* graphsurgeon-tf* tensorrt* ``` -------------------------------- ### Clone YOLOv5 Repo and Install Requirements Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOv5.md Clone the YOLOv5 repository and install necessary Python packages. It's recommended to use a virtual environment. ```bash git clone https://github.com/ultralytics/yolov5.git cd yolov5 pip3 install -r requirements.txt pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Download NVIDIA Driver Installer Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads the NVIDIA driver installer for Linux x86_64 systems. Use the appropriate version for your hardware. ```bash wget https://us.download.nvidia.com/XFree86/Linux-x86_64/525.125.06/NVIDIA-Linux-x86_64-525.125.06.run ``` -------------------------------- ### Download and Install CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download the CUDA toolkit and install it silently with the toolkit option. This includes the NVIDIA driver version 515.65.01. ```bash wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run sudo sh cuda_11.7.1_515.65.01_linux.run --silent --toolkit ``` -------------------------------- ### Install MMDetection Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/CODETR.md Install the MMDetection framework and its dependencies, including PyTorch, MMCV, and MMDeploy. Ensure you are using a Python virtual environment. ```bash git clone https://github.com/open-mmlab.git cd mmdetection pip3 install openmim mim install mmengine mim install mmdeploy mim install "mmcv>=2.0.0rc4,<2.2.0" pip3 install -v -e . pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Configure TensorRT Repositories and Install Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Adds the NVIDIA TensorRT repository, updates package lists, and installs TensorRT and cuDNN libraries. It then holds these packages to prevent automatic updates. ```bash sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ " sudo apt-get update sudo apt-get install libnvinfer8=8.5.3-1+cuda11.8 libnvinfer-plugin8=8.5.3-1+cuda11.8 libnvparsers8=8.5.3-1+cuda11.8 libnvonnxparsers8=8.5.3-1+cuda11.8 libnvinfer-bin=8.5.3-1+cuda11.8 libnvinfer-dev=8.5.3-1+cuda11.8 libnvinfer-plugin-dev=8.5.3-1+cuda11.8 libnvparsers-dev=8.5.3-1+cuda11.8 libnvonnxparsers-dev=8.5.3-1+cuda11.8 libnvinfer-samples=8.5.3-1+cuda11.8 libcudnn8=8.7.0.84-1+cuda11.8 libcudnn8-dev=8.7.0.84-1+cuda11.8 python3-libnvinfer=8.5.3-1+cuda11.8 python3-libnvinfer-dev=8.5.3-1+cuda11.8 sudo apt-mark hold libnvinfer* libnvparsers* libnvonnxparsers* libcudnn8* python3-libnvinfer* ``` -------------------------------- ### Install DeepStream 7.0 SDK Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and install the DeepStream 7.0 SDK for servers and workstations. This command also ensures the correct CUDA version is linked. ```bash wget --content-disposition 'https://api.ngc.nvidia.com/v2/resources/org/nvidia/deepstream/7.0/files?redirect=true&path=deepstream-7.0_7.0.0-1_amd64.deb' -O deepstream-7.0_7.0.0-1_amd64.deb sudo apt-get install ./deepstream-7.0_7.0.0-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-12.2 /usr/local/cuda ``` -------------------------------- ### Install NVIDIA Driver for Laptops (Silent) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on laptops, disabling nouveau and enabling dkms. This step requires a reboot. ```bash sudo sh NVIDIA-Linux-x86_64-560.35.03.run --no-cc-version-check --silent --disable-nouveau --dkms --install-libglvnd ``` -------------------------------- ### Download YOLOv12 Repository and Install Requirements Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOv12.md Clone the YOLOv12 repository and install its dependencies, including ONNX and ONNX Runtime. Using a Python virtual environment is recommended. ```bash git clone https://github.com/sunsmarterjie/yolov12.git cd yolov12 pip3 install -e . pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install MMYOLO Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/RTMDet.md Install the necessary dependencies for the MMYOLO framework, including PyTorch, MMCV, and other required libraries. It is recommended to use a Python virtual environment. ```bash git clone https://github.com/open-mmlab/mmyolo.git cd mmyolo pip3 install openmim mim install "mmengine>=0.6.0" mim install "mmcv>=2.0.0rc4,<2.1.0" mim install "mmdet>=3.0.0,<4.0.0" pip3 install -r requirements/albu.txt mim install -v -e . pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install NVIDIA Driver (Desktop - Silent) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs the NVIDIA driver silently on desktops, disabling nouveau drivers and enabling DKMS. Includes running nvidia-xconfig. ```bash sudo sh NVIDIA-Linux-x86_64-570.195.03.run --no-cc-version-check --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Install DeepStream SDK Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install the DeepStream SDK 6.1.1 using the provided .deb package. This also involves removing and creating a symbolic link for the CUDA directory. ```bash sudo apt-get install ./deepstream-6.1_6.1.1-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-11.7 /usr/local/cuda ``` -------------------------------- ### Install TensorRT Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Add the CUDA repository, update package lists, and install TensorRT and cuDNN packages. It's recommended to hold these packages to prevent accidental upgrades. ```bash sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ " sudo apt-get update sudo apt-get install libnvinfer8=8.4.1-1+cuda11.6 libnvinfer-plugin8=8.4.1-1+cuda11.6 libnvparsers8=8.4.1-1+cuda11.6 libnvonnxparsers8=8.4.1-1+cuda11.6 libnvinfer-bin=8.4.1-1+cuda11.6 libnvinfer-dev=8.4.1-1+cuda11.6 libnvinfer-plugin-dev=8.4.1-1+cuda11.6 libnvparsers-dev=8.4.1-1+cuda11.6 libnvonnxparsers-dev=8.4.1-1+cuda11.6 libnvinfer-samples=8.4.1-1+cuda11.6 libcudnn8=8.4.1.50-1+cuda11.6 libcudnn8-dev=8.4.1.50-1+cuda11.6 python3-libnvinfer=8.4.1-1+cuda11.6 python3-libnvinfer-dev=8.4.1-1+cuda11.6 sudo apt-mark hold libnvinfer* libnvparsers* libnvonnxparsers* libcudnn8* python3-libnvinfer* ``` -------------------------------- ### Install NVIDIA Driver (Desktop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on a desktop, disabling nouveau and enabling DKMS, and running nvidia-xconfig. This step will disable the nouveau drivers. ```bash sudo sh NVIDIA-Linux-x86_64-460.32.03.run --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Configure NVIDIA Prime for Laptops Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs nvidia-prime and selects the NVIDIA GPU for systems with NVIDIA Optimus. ```bash sudo apt-get install nvidia-prime sudo prime-select nvidia ``` -------------------------------- ### Prepare Calibration Images and Set Environment Variables Source: https://context7.com/marcoslucianops/deepstream-yolo/llms.txt Prepare a set of calibration images for INT8 mode and set the necessary environment variables for the calibration process. Ensure the correct number of images are selected and copied. ```bash mkdir calibration for jpg in $(ls -1 val2017/*.jpg | sort -R | head -1000); do cp "${jpg}" calibration/ done realpath calibration/*.jpg > calibration.txt ``` ```bash export INT8_CALIB_IMG_PATH=calibration.txt export INT8_CALIB_BATCH_SIZE=8 # increase for faster calibration / more accuracy ``` -------------------------------- ### Install NVIDIA Driver for Desktops (Silent) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on desktops, disabling nouveau and enabling dkms. This step requires a reboot and runs nvidia-xconfig. ```bash sudo sh NVIDIA-Linux-x86_64-560.35.03.run --no-cc-version-check --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Download CUDA Toolkit Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download the CUDA toolkit local installer for Linux x86_64. ```bash wget https://developer.download.nvidia.com/compute/cuda/11.6.1/local_installers/cuda_11.6.1_510.47.03_linux.run ``` -------------------------------- ### Install CUDA Toolkit 12.2.2 Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and silently install CUDA Toolkit 12.2.2. This command installs the toolkit without user interaction. ```bash wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run sudo sh cuda_12.2.2_535.104.05_linux.run --silent --toolkit ``` -------------------------------- ### Install TensorRT Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install TensorRT and its associated libraries using apt-get. This command adds the NVIDIA CUDA repository, updates package lists, and installs specific versions of TensorRT and cuDNN. ```bash sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ " sudo apt-get update sudo apt-get install libnvinfer8=8.5.2-1+cuda11.8 libnvinfer-plugin8=8.5.2-1+cuda11.8 libnvparsers8=8.5.2-1+cuda11.8 libnvonnxparsers8=8.5.2-1+cuda11.8 libnvinfer-bin=8.5.2-1+cuda11.8 libnvinfer-dev=8.5.2-1+cuda11.8 libnvinfer-plugin-dev=8.5.2-1+cuda11.8 libnvparsers-dev=8.5.2-1+cuda11.8 libnvonnxparsers-dev=8.5.2-1+cuda11.8 libnvinfer-samples=8.5.2-1+cuda11.8 libcudnn8=8.7.0.84-1+cuda11.8 libcudnn8-dev=8.7.0.84-1+cuda11.8 python3-libnvinfer=8.5.2-1+cuda11.8 python3-libnvinfer-dev=8.5.2-1+cuda11.8 sudo apt-mark hold libnvinfer* libnvparsers* libnvonnxparsers* libcudnn8* python3-libnvinfer* ``` -------------------------------- ### Install Meson and Ninja for GLib Migration Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/README.md Install Meson and Ninja build tools, which are prerequisites for migrating GLib to a newer version. It is recommended to use a Python virtual environment. ```bash pip3 install meson pip3 install ninja ``` -------------------------------- ### Build and Install GLib 2.76.6 Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/README.md Clone the GLib repository, checkout version 2.76.6, and build/install it using Meson and Ninja. This resolves issues with older GLib versions. ```bash git clone https://github.com/GNOME/glib.git cd glib git checkout 2.76.6 Meson build --prefix=/usr ninja -C build/ cd build/ ninja install ``` -------------------------------- ### Install DeepStream 8.0 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs GStreamer, SSL, and other libraries required for DeepStream 8.0. ```bash sudo apt-get install dkms sudo apt-get install libssl3 libssl-dev libgles2-mesa-dev libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev libjsoncpp-dev protobuf-compiler libmosquitto1 ``` -------------------------------- ### Download NVIDIA Driver for TITAN, GeForce, RTX, Quadro Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download the NVIDIA driver run file for desktop GPUs. ```bash wget https://us.download.nvidia.com/XFree86/Linux-x86_64/560.35.03/NVIDIA-Linux-x86_64-560.35.03.run ``` -------------------------------- ### YoloLayer TensorRT Plugin Build Instructions Source: https://context7.com/marcoslucianops/deepstream-yolo/llms.txt Instructions for building the YoloLayer TensorRT plugin for Darknet models. Demonstrates how to handle multiple simultaneous YOLO GIEs by assigning unique plugin versions and rebuilding. ```bash # Plugin is registered automatically when the .so is loaded. # Plugin name / version used internally: # YOLOLAYER_PLUGIN_NAME = "YoloLayer_TRT" # YOLOLAYER_PLUGIN_VERSION = "1" (increment for multiple GIEs) # For multiple simultaneous YOLO GIEs, each GIE's nvdsinfer_custom_impl_Yolo # must have a unique plugin version to avoid TensorRT registry conflicts. # Edit nvdsinfer_custom_impl_Yolo/yoloPlugins.h line 43: # gie1: const char* YOLOLAYER_PLUGIN_VERSION {"1"}; # gie2: const char* YOLOLAYER_PLUGIN_VERSION {"2"}; # gie3: const char* YOLOLAYER_PLUGIN_VERSION {"3"}; # Then rebuild each GIE independently: export CUDA_VER=12.8 make -C gie1/nvdsinfer_custom_impl_Yolo clean && make -C gie1/nvdsinfer_custom_impl_Yolo make -C gie2/nvdsinfer_custom_impl_Yolo clean && make -C gie2/nvdsinfer_custom_impl_Yolo ``` -------------------------------- ### Add CUDA Keyring and Update Repositories Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads and installs the CUDA GPG key and updates the package list to include CUDA repositories. ```bash wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.0-1_all.deb sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update ``` -------------------------------- ### Install DKMS Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs the Dynamic Kernel Module Support package, which is required if using the default Ubuntu kernel. ```bash sudo apt-get install dkms ``` -------------------------------- ### Add CUDA Keyring and Update Repositories Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads and installs the CUDA GPG key and updates the package list to include CUDA repositories. ```bash wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update ``` -------------------------------- ### Install DeepStream Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install necessary dependencies for DeepStream, including dkms, OpenSSL, GStreamer components, and other libraries. ```bash sudo apt-get install dkms sudo apt-get install libssl1.1 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev ``` -------------------------------- ### Install YOLO-NAS Requirements Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLONAS.md Clone the YOLO-NAS repository and install its dependencies. It is recommended to use a Python virtual environment. ```bash git clone https://github.com/Deci-AI/super-gradients.git cd super-gradients pip3 install -r requirements.txt python3 setup.py install pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Install DeepStream 5.1 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install necessary dependencies for DeepStream 5.1, including dkms and various gstreamer plugins. ```bash sudo apt-get install dkms sudo apt-get install libssl1.0.0 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 libjansson4=2.11-1 ``` -------------------------------- ### Install DeepStream Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Installs essential libraries for DeepStream, including SSL, GStreamer components, RTSP server, and Jansson. ```bash sudo apt-get install libssl1.0.0 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstrtspserver-1.0-0 libjansson4 ``` -------------------------------- ### Download NVIDIA Driver (TITAN, GeForce, RTX/Quadro) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads the NVIDIA driver runfile for compatible GPU series. ```bash wget https://us.download.nvidia.com/XFree86/Linux-x86_64/570.195.03/NVIDIA-Linux-x86_64-570.195.03.run ``` -------------------------------- ### Install DeepStream 6.1.1 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install essential dependencies for DeepStream 6.1.1, including dkms and various gstreamer plugins and libraries. ```bash sudo apt-get install dkms sudo apt-get install libssl1.1 libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev ``` -------------------------------- ### Download YOLOv12 Model Weights Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOv12.md Download the pre-trained YOLOv12 model weights in .pt format. This example uses yolov12s.pt, but custom models can also be used. ```bash wget https://github.com/sunsmarterjie/yolov12/releases/download/turbo/yolov12s.pt ``` -------------------------------- ### Install DeepStream 7.0 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install essential dependencies for DeepStream 7.0, including GStreamer, SSL libraries, and JSON/YAML parsers. ```bash sudo apt-get install dkms sudo apt-get install libssl3 libssl-dev libgles2-mesa-dev libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev libjsoncpp-dev protobuf-compiler ``` -------------------------------- ### Install NVIDIA Driver (Desktop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on a desktop, disabling nouveau, using DKMS, and running nvidia-xconfig. Remove --dkms if using kernel 5.11.0. ```bash sudo sh NVIDIA-Linux-x86_64-470.129.06.run --silent --disable-nouveau --dkms --install-libglvnd --run-nvidia-xconfig ``` -------------------------------- ### Install DeepStream 7.1 Dependencies Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install essential packages required for DeepStream 7.1, including dkms and various GStreamer libraries. ```bash sudo apt-get install dkms sudo apt-get install libssl3 libssl-dev libgles2-mesa-dev libgstreamer1.0-0 gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav libgstreamer-plugins-base1.0-dev libgstrtspserver-1.0-0 libjansson4 libyaml-cpp-dev libjsoncpp-dev protobuf-compiler ``` -------------------------------- ### Download YOLOv7 Model Weights Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOv7.md Download pre-trained YOLOv7 model weights from the official releases. This example downloads the default YOLOv7 weights. ```bash wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt ``` -------------------------------- ### Download NVIDIA Driver Installer (Tesla) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Downloads the NVIDIA driver installer for Tesla series GPUs. Use the appropriate version for your hardware. ```bash wget https://us.download.nvidia.com/tesla/525.125.06/NVIDIA-Linux-x86_64-525.125.06.run ``` -------------------------------- ### Download YOLO-Master Model Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOMaster.md Download a pre-trained YOLO-Master model in .pt format from the official releases. This example downloads the YOLO-Master-N model. ```bash wget https://github.com/Tencent/YOLO-Master/releases/download/v0.0.0/yolo-master-v0.1-n.pt ``` -------------------------------- ### Install DeepStream 8.0 Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Download and install the DeepStream 8.0 deb package. This also includes steps to set the CUDA symbolic link. ```bash wget --content-disposition 'https://api.ngc.nvidia.com/v2/resources/org/nvidia/deepstream/8.0/files?redirect=true&path=deepstream-8.0_8.0.0-1_amd64.deb' -O deepstream-8.0_8.0.0-1_amd64.deb sudo apt-get install ./deepstream-8.0_8.0.0-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-12.8 /usr/local/cuda ``` -------------------------------- ### Install Python Dependencies for YOLOR Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/YOLOR.md Installs necessary Python packages for YOLOR model conversion. It's recommended to use a virtual environment. ```bash git clone https://github.com/WongKinYiu/yolor.git cd yolor pip3 install -r requirements.txt pip3 install onnx onnxslim onnxruntime ``` -------------------------------- ### Set Model Engine File (Batch Size 2, Network Mode 0) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/customModels.md Example for specifying the model engine file when batch size is 2 and network mode is 0 (FP32). ```properties model-engine-file=model_b2_gpu0_fp32.engine ``` -------------------------------- ### Set Model Engine File (Batch Size 1, Network Mode 2) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/customModels.md Example for specifying the model engine file when batch size is 1 and network mode is 2 (FP16). ```properties model-engine-file=model_b1_gpu0_fp16.engine ``` -------------------------------- ### Download PP-YOLOE Model Weights Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/PPYOLOE.md Download the pre-trained model weights in .pdparams format from the PaddleDetection releases. This is an example for PP-YOLOE+_s. ```bash wget https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_s_80e_coco.pdparams ``` -------------------------------- ### Install NVIDIA Driver (Laptop) Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Silently install the NVIDIA driver on a laptop, disabling nouveau and enabling DKMS. This step will disable the nouveau drivers. ```bash sudo sh NVIDIA-Linux-x86_64-460.32.03.run --silent --disable-nouveau --dkms --install-libglvnd ``` -------------------------------- ### Install DeepStream SDK 6.2 Source: https://github.com/marcoslucianops/deepstream-yolo/blob/master/docs/dGPUInstalation.md Install DeepStream SDK 6.2 from a local .deb package. This command also creates a symbolic link for CUDA. ```bash sudo apt-get install ./deepstream-6.2_6.2.0-1_amd64.deb rm ${HOME}/.cache/gstreamer-1.0/registry.x86_64.bin sudo ln -snf /usr/local/cuda-11.8 /usr/local/cuda ```