Skip to content

Instantly share code, notes, and snippets.

View 1duo's full-sized avatar
:octocat:

Yuduo Wu 1duo

:octocat:
  • San Fransisco Bay Area
View GitHub Profile
@1duo
1duo / centos.install.cmake.from.source.md
Last active April 23, 2024 15:58
Install CMake on CentOS 7.

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*
@1duo
1duo / centos.install.boost.md
Last active April 4, 2024 18:39
Install Boost library from source on CentOS 7.

Download Boost Library: http://www.boost.org (Choose the expected version)

wget https://cfhcable.dl.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
wget https://phoenixnap.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
@1duo
1duo / centos.install.nccl.md
Last active March 30, 2024 06:41
Install NCCL for GPU communications on CentOS 7.

NCCL1

git clone https://github.com/NVIDIA/nccl.git
cd nccl
make -j$(nproc) install

NCCL2

@1duo
1duo / centos.install.openmpi.md
Last active December 18, 2023 17:09
Install OpenMPI from source on CentOS7 with CUDA support.

Download OpenMPI from https://www.open-mpi.org

wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.0.tar.gz
wget https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.2.tar.gz

Unzip and run configurations with CUDA

@1duo
1duo / ubuntu.install.protobuf.md
Created June 25, 2018 18:09
Install Protocol Buffers on Linux Ubuntu.

Protocol Buffers 2.6.1

sudo apt-get install build-essential
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar -zxvf protobuf-2.6.1.tar.gz && cd protobuf-2.6.1/
@1duo
1duo / openmpi.use.gpudirect.rdma.md
Last active May 13, 2022 08:33
Use OpenMPI + GPUDirect RDMA for better performance.
  • Install OpenMPI, make sure enable CUDA support by adding --with-cuda flag.

  • Verify GPU Direct RDMA Information

$ ompi_info --all | grep btl_openib_have_cuda_gdr
   MCA btl: informational "btl_openib_have_cuda_gdr" (current value: "true", data source: default, level: 4 tuner/basic, type: bool)
  • Add flag to mpirun
@1duo
1duo / opencv.center.crop.cpp.md
Created July 16, 2018 22:27
Center crop using OpenCV.

C++ main.cpp:

#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <string>

using namespace cv;
@1duo
1duo / postgres.md
Created October 4, 2018 21:37
Adding a new table to Postgres database.
  • Start a new Postgres docker container (with or without mount Postgres data):
$ docker run --name pg1 -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
$ docker run --name pg1 -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d -v postgres-data:/var/lib/postgresql/data postgres
  • Step into the Postgres database docker container:
@1duo
1duo / docker.in.docker.md
Last active October 4, 2018 23:48
Some notes for docker in docker.

Docker in docker implementation:

https://github.com/jpetazzo/dind

Issue:

docker pull consume tremendous amount of storage until no space left on device.

Check backing file system host docker is using with command docker info:

  • Remove all stopped containers.
docker rm $(docker ps -a -q)
  • Remove all exited containers