Skip to content

Commit

Permalink
[Doc] 更新RKNPU2文档以及修改FastDeploy环境变量的脚本 (PaddlePaddle#1102)
Browse files Browse the repository at this point in the history
* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* 更新交叉编译

* Update issues.md

* Update fastdeploy_init.sh

* 更新交叉编译

Co-authored-by: Jason <[email protected]>
  • Loading branch information
Zheng-Bicheng and jiangjiajun authored Jan 10, 2023
1 parent 1039540 commit 3a32024
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/cn/build_and_install/rknpu2.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ RKNPU2指的是Rockchip推出的RK356X以及RK3588系列芯片的NPU。
* [编译FastDeploy](../faq/rknpu2/build.md)
* [RKNN模型导出建议](../faq/rknpu2/export.md)
* [RKNPU2模型部署demo](../faq/rknpu2/rknpu2.md)
* [RKNPU2 常见问题合集](../faq/rknpu2/issues.md)
44 changes: 44 additions & 0 deletions docs/cn/faq/rknpu2/issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# RKNPU2常见问题合集

在使用FastDeploy的过程中大家可能会碰到很多的问题,这个文档用来记录已经解决的共性问题,方便大家查阅。

## 导航

- [动态链接库链接问题](#动态链接库链接问题)

## 动态链接库链接问题

### 关联issue

- [Issue 870](https://github.com/PaddlePaddle/FastDeploy/issues/870)

### 问题描述

在编译的过程中没有出现问题,但是运行程序时出现以下报错
```text
error while loading shared libraries: libfastdeploy.so.0.0.0: cannot open shared object file: No such file or directory
```

### 分析原因

链接器ld提示找不到库文件。ld默认的目录是/lib和/usr/lib,如果放在其他路径也可以,需要让ld知道库文件所在的路径。

### 解决方案

**临时解决方法**

临时解决方法对系统没有影响,但是仅在当前打开的终端时生效,关闭终端后,这个配置会失效。

```bash
source PathToFastDeploySDK/fastdeploy_init.sh
```

**永久解决方案**

临时解决方法解决方案在开关终端后会失效,因为每一次重新打开终端运行程序时,都需要重新输入命令。如果您不想每一次运行程序都需要运行一次代码,可以执行以下代码:
```bash
source PathToFastDeploySDK/fastdeploy_init.sh
sudo cp PathToFastDeploySDK/fastdeploy_libs.conf /etc/ld.so.conf.d/
sudo ldconfig
```
执行后配置文件将写入系统,刷新后即可让系统找到库的位置。
4 changes: 4 additions & 0 deletions scripts/fastdeploy_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ done
# Remove the dumplicate directories
LIBS_DIRECOTRIES=($(awk -v RS=' ' '!a[$1]++' <<< ${LIBS_DIRECOTRIES[@]}))

# Print the dynamic library location and output the configuration file
IMPORT_PATH=""
output_file=${FASTDEPLOY_LIBRARY_PATH}/fastdeploy_libs.conf
rm -rf $output_file
for LIB_DIR in ${LIBS_DIRECOTRIES[@]};do
echo "Find Library Directory: $LIB_DIR"
echo "$LIB_DIR" >> $output_file
IMPORT_PATH=${LIB_DIR}":"$IMPORT_PATH
done

Expand Down

0 comments on commit 3a32024

Please sign in to comment.