2021年12月28日火曜日

[Memo] How to build waifu2x-ncnn-vulkan on jetson nano with JetPack 4.5 or 4.6

 How to build waifu2x-ncnn-vulkan on jetson nano with JetPack 4.5 or 4.6


1. First of all, prepared mandatory apt library should be installed as follows


  sudo apt install libvulkan1 libvulkan-dev vulkan-utils nvidia-l4t-libvulkan

  

  

2. Clone source code from GitHub as follows


   git clone https://github.com/nihui/waifu2x-ncnn-vulkan.git

   cd waifu2x-ncnn-vulkan

   git submodule update --init --recursive

   

3. Set Environment variables to use pthread libararies


   export LDFLAGS="-pthread  -lpthread"

   

4. and run CMake as


   mkdir build

   cd build

   cmake  -DVulkan_LIBRARY=/usr/lib/aarch64-linux-gnu/libvulkan.so -DVulkan_INCLUDE_DIR=/usr/include/vulkan -D OpenMP_EXE_LINKER_FLAG=-pthread ../src


5.  Probably you stay at build directory, So patch ../src/CMakeLists.txt as manually

      to comment out first 2 lines of the file

      

       #cmake_policy(SET CMP0091 NEW)

       #set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)

       

 6. Finally, run make 

 

       make -j 4