Commit ef65e64e authored by liucong's avatar liucong
Browse files

完善工程

parent bf0ad4ec
...@@ -22,10 +22,7 @@ set(LIBRARY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/depend/lib64/ ...@@ -22,10 +22,7 @@ set(LIBRARY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/depend/lib64/
link_directories(${LIBRARY_PATH}) link_directories(${LIBRARY_PATH})
# 添加依赖库 # 添加依赖库
set(LIBRARY migraphx_ref set(LIBRARY migraphx
migraphx
migraphx_c
migraphx_device
migraphx_gpu migraphx_gpu
migraphx_onnx) migraphx_onnx)
link_libraries(${LIBRARY}) link_libraries(${LIBRARY})
......
...@@ -31,7 +31,7 @@ export PYTHONPATH=/opt/dtk/lib:$PYTHONPATH ...@@ -31,7 +31,7 @@ export PYTHONPATH=/opt/dtk/lib:$PYTHONPATH
cd <path_to_gpt2_migraphx> cd <path_to_gpt2_migraphx>
# 进入示例程序目录 # 进入示例程序目录
cd ./Python/ cd Python/
# 安装依赖 # 安装依赖
pip install -r requirements.txt pip install -r requirements.txt
...@@ -45,8 +45,6 @@ export MIGRAPHX_DYNAMIC_SHAPE=1 ...@@ -45,8 +45,6 @@ export MIGRAPHX_DYNAMIC_SHAPE=1
### 运行示例 ### 运行示例
在Python目录下执行如下命令运行该示例程序:
```python ```python
python gpt2.py python gpt2.py
``` ```
...@@ -74,11 +72,6 @@ chatbot:春风吹絮满江南,一片离情酒半酣。记得小桥和雪看, ...@@ -74,11 +72,6 @@ chatbot:春风吹絮满江南,一片离情酒半酣。记得小桥和雪看,
docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:ort1.14.0_migraphx3.0.0-dtk22.10.1 docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:ort1.14.0_migraphx3.0.0-dtk22.10.1
``` ```
### 修改CMakeLists.txt
如果使用ubuntu系统,需要修改CMakeLists.txt中依赖库路径:
将"${CMAKE_CURRENT_SOURCE_DIR}/depend/lib64/"修改为"${CMAKE_CURRENT_SOURCE_DIR}/depend/lib/"
### 构建工程 ### 构建工程
...@@ -90,18 +83,10 @@ rbuild build -d depend ...@@ -90,18 +83,10 @@ rbuild build -d depend
将依赖库依赖加入环境变量LD_LIBRARY_PATH,在~/.bashrc中添加如下语句: 将依赖库依赖加入环境变量LD_LIBRARY_PATH,在~/.bashrc中添加如下语句:
**Centos**:
``` ```
export LD_LIBRARY_PATH=<path_to_gpt2_migraphx>/depend/lib64/:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=<path_to_gpt2_migraphx>/depend/lib64/:$LD_LIBRARY_PATH
``` ```
**Ubuntu**:
```
export LD_LIBRARY_PATH=<path_to_gpt2_migraphx>/depend/lib/:$LD_LIBRARY_PATH
```
然后执行: 然后执行:
``` ```
...@@ -121,7 +106,7 @@ export MIGRAPHX_DYNAMIC_SHAPE=1 ...@@ -121,7 +106,7 @@ export MIGRAPHX_DYNAMIC_SHAPE=1
cd <path_to_gpt2_migraphx> cd <path_to_gpt2_migraphx>
# 进入build目录 # 进入build目录
cd ./build/ cd build/
# 执行示例程序 # 执行示例程序
./GPT2 ./GPT2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment