Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install with plugins #315

Open
liguoyu666 opened this issue May 13, 2020 · 7 comments
Open

install with plugins #315

liguoyu666 opened this issue May 13, 2020 · 7 comments

Comments

@liguoyu666
Copy link

It worked well without plugins, but when I installed with plugins, It reported an error:

python setup.py install --plugins running install Building in plugin support [2/3] g++ -c -fPIC torch2trt/converters/inte... -std=c++11 -I/usr/include/aarch64-linux-gnu FAILED: g++ -c -fPIC torch2trt/converters/interpolate/interpolate.pb.cc -I/usr/local/cuda/include -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I. -std=c++11 -I/usr/include/aarch64-linux-gnu In file included from torch2trt/converters/interpolate/interpolate.pb.cc:4:0: ./torch2trt/converters/interpolate/interpolate.pb.h:10:40: fatal error: google/protobuf/port_def.inc: 没有那个文件或目录 compilation terminated. [2/3] g++ -c -fPIC torch2trt/converters/inte... -std=c++11 -I/usr/include/aarch64-linux-gnu FAILED: g++ -c -fPIC torch2trt/converters/interpolate/interpolate.cpp -I/usr/local/cuda/include -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I. -std=c++11 -I/usr/include/aarch64-linux-gnu torch2trt/converters/interpolate/interpolate.cpp:2:21: fatal error: NvInfer.h: 没有那个文件或目录 compilation terminated. ninja: build stopped: subcommand failed. running build running build_py running install_lib running install_egg_info running egg_info writing torch2trt.egg-info/PKG-INFO writing dependency_links to torch2trt.egg-info/dependency_links.txt writing top-level names to torch2trt.egg-info/top_level.txt reading manifest file 'torch2trt.egg-info/SOURCES.txt' writing manifest file 'torch2trt.egg-info/SOURCES.txt' removing '/home/lgy/anaconda3/lib/python3.7/site-packages/torch2trt-0.0.3-py3.7.egg-info' (and everything under it) Copying torch2trt.egg-info to /home/lgy/anaconda3/lib/python3.7/site-packages/torch2trt-0.0.3-py3.7.egg-info running install_scripts
and I installed libprotobuf* protobuf-compiler ninja-build sucessfuly, I updated protoc from 2.x to 3.11.4.
could you hep me?

@jaybdub
Copy link
Contributor

jaybdub commented May 13, 2020

Hi liguoyu666,

Thanks for reaching out!

Can you try the branch in this pull request?

#307

This has refactored the plugins, and the build should be more stable. For this, plugins are enabled by default (no need to pass --plugins).

Please let me know if this works for you.

Best,
John

@liguoyu666
Copy link
Author

liguoyu666 commented May 14, 2020

Hi liguoyu666,

Thanks for reaching out!

Can you try the branch in this pull request?

#307

This has refactored the plugins, and the build should be more stable. For this, plugins are enabled by default (no need to pass --plugins).

Please let me know if this works for you.

Best,
John

Thank you , but there is another problem:

(base) lgy@lgy:/PycharmProjects/torch2trt$ git checkout plugin_serialization_torch
分支 plugin_serialization_torch 设置为跟踪来自 origin 的远程分支 plugin_serialization_torch。
切换到一个新分支 'plugin_serialization_torch'
(base) lgy@lgy:
/PycharmProjects/torch2trt$ python3 setup.py build_ext --inplace
running build_ext
building 'plugins' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/torch2trt
creating build/temp.linux-x86_64-3.7/torch2trt/plugins
gcc -pthread -B /home/lgy/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/aarch64-linux-gnu -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include/TH -I/home/lgy/anaconda3/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda-10.0/include -I/home/lgy/anaconda3/include/python3.7m -c torch2trt/plugins/interpolate.cpp -o build/temp.linux-x86_64-3.7/torch2trt/plugins/interpolate.o -DUSE_DEPRECATED_INTLIST -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=plugins -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
torch2trt/plugins/interpolate.cpp:6:21: fatal error: NvInfer.h: 没有那个文件或目录
compilation terminated.
error: command 'gcc' failed with exit status 1

@shaominghe
Copy link

Thank you , I miss the same problem
this is my build.py
the path of NvInfer.h,I think it is no problem
image

running build_ext
building 'plugins' extension
gcc -pthread -B /home/titan/anaconda3/envs/mganprior/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/aarch64-linux-gnu -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include/TH -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-10.0/include -I/home/titan/anaconda3/envs/mganprior/include/python3.6m -c torch2trt/plugins/interpolate.cpp -o build/temp.linux-x86_64-3.6/torch2trt/plugins/interpolate.o -DUSE_DEPRECATED_INTLIST -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=plugins -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
torch2trt/plugins/interpolate.cpp:6:21: fatal error: NvInfer.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

@shaominghe
Copy link

@jaybdub
Thank you , I miss the same problem
this is my build.py
the path of NvInfer.h,I think it is no problem
image

running build_ext
building 'plugins' extension
gcc -pthread -B /home/titan/anaconda3/envs/mganprior/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/aarch64-linux-gnu -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include/TH -I/home/titan/anaconda3/envs/mganprior/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-10.0/include -I/home/titan/anaconda3/envs/mganprior/include/python3.6m -c torch2trt/plugins/interpolate.cpp -o build/temp.linux-x86_64-3.6/torch2trt/plugins/interpolate.o -DUSE_DEPRECATED_INTLIST -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=plugins -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
torch2trt/plugins/interpolate.cpp:6:21: fatal error: NvInfer.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

@prathik-naidu
Copy link

@shaominghe @liguoyu666 Were you able to figure out this issue?

@liguoyu666
Copy link
Author

@shaominghe @liguoyu666 Were you able to figure out this issue?

I've given up the method, and I change the model to onnx and then tensorrt.

@nicken
Copy link

nicken commented Dec 22, 2021

I solved it;
you must modify thesetup.py file, let it known where is you tensorRT path of include and lib

I modified it to look like this

def trt_inc_dir():
    return "/usr/local/TensorRT/include"

def trt_lib_dir():
    return "/usr/local/TensorRT/lib"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants