ubuntu下 vulkan + ncnn环境搭建

1.下载安装vulkan sdk

#ubuntu16  vulkan版本1.126
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.1.126-xenial.list http://packages.lunarg.com/vulkan/1.1.126/lunarg-vulkan-1.1.126-xenial.list
sudo apt update
sudo apt install vulkan-sdk


#ubuntu18  vulkan版本1.126
wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.1.126-bionic.list http://packages.lunarg.com/vulkan/1.1.126/lunarg-vulkan-1.1.126-bionic.list
sudo apt update
sudo apt install vulkan-sdk


3.编译ncnn

 

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/host.gcc.toolchain.cmake -DNCNN_VULKAN=ON ..
make -j8
make install

4.测试

将ncnn/benchmark目录下的所有param文件拷贝到 build/benchmark下面,执行命令 ./benchncnn 1 1 0 0

ubuntu下 vulkan + ncnn环境搭建_第1张图片

你可能感兴趣的:(Linux)