ubuntu tensorrt 설치

HeungJun Kim·2022년 6월 9일
1

CUDA 설치

cuda 설치 참조 link

TensorRT 설치

cuda만 정상적으로 설치되었으면 tensorrt 설치는 어렵지 않다.
쉽다!

  1. pycuda 설치

    $ pip install pycuda==2020.1

  2. tensorrt 다운로드
    tensorrt 다운로드 link
    tar 형식으로 다운로드 받는다.

$ tar xzvf TensorRT-5.1.x.x.Ubuntu-1x.04.x.x86_64-gnu.cuda-x.x.cudnn7.x.tar.gz

환경변수에 tensorrt lib 경로 추가

$ gedit ~/.bashrc

export LD_LIBRARY_PATH=/workspace/TensorRT-8.4.0.6/lib:/usr/local/cuda-11.0/lib64:

$ source ~/.bashrc

  1. tensorrt 파이썬 패키지 설치

    $ cd TensorRT-8.4.0.6/python
    $ pip install tensorrt-8.4.0.6-cp38-none-linux_x86_64.whl
    $ cd ../uff
    $ pip install tensorrt-8.4.0.6-cp38-none-linux_x86_64.whl
    $ which convert-to-uff
    $ cd ../graphsurgeon
    $ pip install graphsurgeon-0.4.5-py2.py3-none-any.whl

  2. 설치확인

    $ python

    import tensorrt as trt
  3. 참고사항
    cmake 빌드시 include path는 {$workspace}/TensorRT-8.4.0.6/include" 경로를 추가해 준다.
    tensorrt 의 lib / header 파일 이름이 NvIner인 것을 알아두자!

profile
Computer Vision / ADAS / DMS / 얼굴인식

0개의 댓글