Sunday, 31 July 2022

how to setup tritonserver and kubernetes for jetson?

 https://developer.nvidia.com/blog/deploying-nvidia-triton-at-scale-with-mig-and-kubernetes/

Thursday, 28 July 2022

How to build opencv in ubuntu20, rtx3050, nvidia-driver-515?

tar -xvf opencv-4.4.0.tar.gz
tar -xvf opencv_contrib-4.4.0.tar.gz
cd /data/opencv-4.4.0/build
cmake -DCMAKE_BUILD_TYPE=RELEASE \
        -DCMAKE_INSTALL_PREFIX=/usr/local/opencv4 \
        -DINSTALL_C_EXAMPLES=ON \
        -DOPENCV_GENERATE_PKGCONFIG=ON \
        -DINSTALL_PYTHON_EXAMPLES=ON \
        -DBUILD_SHARED_LIBS=ON \
        -DWITH_TBB=ON \
        -DWITH_V4L=ON \
        -DBUILD_opencv_world=OFF \
        -DOPENCV_PYTHON3_INSTALL_PATH=/usr/local/opencv4/python3 \
        -DWITH_QT=ON \
        -DWITH_OPENGL=ON \
        -DWITH_FFMPEG=ON \
        -DHAVE_FFMPEG=OFF \
        -DWITH_CUDA=ON \
        -DHAVE_CUDNN=ON \
        -DCUDNN_INCLUDE_DIRS=/data/cuda/include \
        -DCUDNN_LIBRARY=/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.4 \
        -DWITH_CUFFT=ON \
        -DWITH_CUBLAS=ON \
        -DWITH_NVCUVID=OFF \
        -DHAVE_NVCUVID=OFF\
        -DWITH_NVCUVENC=ON \
        -DHAVE_NVCUVENC=ON \
        -DBUILD_CUDA_STUBS=ON \
        -DBUILD_opencv_cudalegacy=ON \
        -DBUILD_opencv_cudacodec=ON \
        -DCUDA_FAST_MATH=ON \
        -DCUDA_ARCH_BIN="8.6" \
        -DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-11.1" \
        -DOPENCV_EXTRA_MODULES_PATH="/data/opencv_contrib-4.4.0/modules" \
        -DBUILD_NEW_PYTHON_SUPPORT=ON \
        -DBUILD_opencv_python3=ON \
        -DHAVE_opencv_python3=ON \
        -DPYTHON3_EXECUTABLE=/usr/bin/python3 \
        -DPYTHON3_DEFAULT_EXECUTABLE=/usr/bin/python3 \
        -DPYTHON3_INCLUDE_PATH=/usr/include/python3.6 \
        -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/x86_64-linux-gnu/python3.6/site-packages/numpy/core/include \
        -DPYTHON3_PACKAGES_PATH=/usr/lib/x86_64-linux-gnu/python3.6/site-packages \
        -DPYTHON3_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.6.so \
        -DPYTHON3_LIBRARIES_PATH=/usr/lib/x86_64-linux-gnu \
    -D OpenGL_GL_PREFERENCE=GLVND \
    -D BUILD_opencv_rgbd=OFF \
        -D WITH_QT=ON \
        -D WITH_OPENGL=ON \
        -D WITH_GTK_2_X=ON \
        -DBUILD_EXAMPLES=OFF ..
make -j32
make install

how to make a tritonserver dockerfile?

 ~/temp/server$ cat Dockerfile
FROM nvcr.io/nvidia/tritonserver:22.05-py3
RUN nvcc -V
WORKDIR /data
COPY ./model_repository /data/model_repository
WORKDIR /data/model_repository
RUN /usr/src/tensorrt/bin/trtexec --onnx=./helloworld/1/model.onnx --saveEngine='./helloworld/1/model.plan' --workspace=1024 --minShapes=input1:1x3x640x640 --optShapes=input1:2x3x640x640 --maxShapes=input1:4x3x640x640
RUN rm -rf ./*/1/model.onnx
RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6  -y
RUN pip install opencv-python
RUN pip install scikit-image

Wednesday, 27 July 2022

docker compose trtexec returned a non-zero code: 139, Code: 139 nvidia triton server docker

 peseyes@peseyes-police-logistic:~/temp$ cat /etc/docker/daemon.json
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },
    "default-runtime": "nvidia"
}