Skip to content

Instantly share code, notes, and snippets.

View yunqu's full-sized avatar
🏠
Working from home

Yun Rock Qu yunqu

🏠
Working from home
View GitHub Profile

1. download bitstream

echo 0 > /sys/class/fpga_manager/fpga0/flags
cp ultra_wrapper.bit /lib/firmware/
echo ultra_wrapper.bit > /sys/class/fpga_manager/fpga0/firmware

2. apply device tree blob

mkdir -p /sys/kernel/config/device-tree/overlays/pl
@yunqu
yunqu / dtbo_led_demo.ipynb
Last active May 10, 2019 22:07
LED demo using device tree overlay
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yunqu
yunqu / pynq-on-debian.md
Last active April 11, 2020 23:21
Installation steps for PYNQ on Debian Stretch

Install PYNQ on Debian Stretch

We will detail the steps for PYNQ installation on Debian Stretch. We will use the Debian Stretch released along with DNNDK, on ZCU104 board. For other Debian-based OS, the flow will be similar.

Step 1. Set up the image

This step is to configure the image, which is specific to ZCU104 Debian Stretch released. It is not

@yunqu
yunqu / CMakeLists.txt
Created May 1, 2019 17:12
CMake for PYNQ package
PROJECT(PYNQ)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
SET(PROJECT_DESCRIPTION "https://github.com/Xilinx/PYNQ")
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
MESSAGE("-- Target system processor: ${CMAKE_SYSTEM_PROCESSOR}")
SET(PYNQ_VERSION_MAJOR 2)
SET(PYNQ_VERSION_MINOR 5)
SET(PYNQ_VERSION_STRING ${PYNQ_VERSION_MAJOR}.${PYNQ_VERSION_MINOR})
MESSAGE("-- PYNQ version: ${PYNQ_VERSION_STRING}")
@yunqu
yunqu / check_os_package.py
Created April 22, 2019 20:42
Code to check OS package in Python
import re
import shutil
import subprocess
rootfs_packages = {
'jupyter': '4.4',
'python3-opencv': '3.2.0',
'lm-sensors': '1'
}
@yunqu
yunqu / redis-warnings.md
Last active April 17, 2019 17:30
Resolve redis server warnings when booting up ray

Go to your log folder as instructed when you start ray.

cat redis-shard_0.out

You may see the following warnings.

875:C 17 Apr 2019 16:32:39.561 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
5875:C 17 Apr 2019 16:32:39.561 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=5875, just started
@yunqu
yunqu / build-ray.md
Last active October 12, 2022 07:54
Building Ray for aarch64

Building Ray for aarch64

There are multiple ways to build ray on aarch64 processors. We will use the PYNQ image v2.4 with Ubuntu 18.04 OS as an example. In this document, we will introduce 2 approaches to build ray; we will always prefer the second approach (building on Amazon A1) since it is faster, cleaner, and easy to reproduce.

Building from Source on the Target

@yunqu
yunqu / build-bazel.md
Last active May 25, 2022 02:43
Building the bazel package for aarch64 on Amazon A1

Building Bazel for aarch64

I am building bazel for aarch64 on Amazon A1 platform. This flow is pretty nice and much easier than the QEMU flow which is prone to QEMU bugs.

Requirement

  • An Amazon A1 platform running Ubuntu 18.04.
@yunqu
yunqu / build-bazel-qemu-arm.md
Last active February 19, 2022 01:49
Build Bazel on QEMU for Pynq-Z1/Pynq-Z2

Building Bazel on armv7l QEMU

Here you'll learn how to build Bazel for Pynq-Z1 (image v2.4). A similar flow can be run directly on the board (native build). However, this guide is based on QEMU flow, which is running faster and cleaner than a native build on the board.

The same flow can also target aarch64 (ZCU104). You just have to work with the correct image (instead of Pynq-Z1-2.4.img, work with ZCU104-2.4.img).

@yunqu
yunqu / common.cmake
Created March 8, 2019 00:42
Install opencv 3.1.0
# This file is included from a subdirectory
set(PYTHON_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../")
ocv_add_module(${MODULE_NAME} BINDINGS)
ocv_module_include_directories(
"${PYTHON_INCLUDE_PATH}"
${PYTHON_NUMPY_INCLUDE_DIRS}
"${PYTHON_SOURCE_DIR}/src2"
)