Logo Ray's Blog
  • Home
  • About
  • News
  • Publications
  • Education
  • More
    Experiences
  • Posts
  • Notes
  • Dark Theme
    Light Theme
Logo Inverted Logo
  • Tags
  • Documentation
Hero Image
Docker/Podman tips

Docker unlimited resources docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm --privileged --detach-keys "ctrl-a,a" -v $(pwd):/workspace <image-name> Map detach-keys to something else The default detach shortcut is ctrl-p, ctrl-q conflicting the previous command ctrl-p. Adding the option --detach-keys "ctrl-a,a" maps it to something else. Port forwarding -p 9999:9999 Use Host DNS --dns-opt=/etc/resolv.conf Podman Container Device Interface (CDI) From NVIDIA ref sudo dnf clean expire-cache \ && sudo dnf install -y nvidia-container-toolkit-base sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml grep " name:" /etc/cdi/nvidia.yaml It should show the GPU device ids (this example is for two gpus):

  • Documentation
Saturday, June 10, 2023 | 1 minute Read
Hero Image
Manage Users in Linux

List Users and Groups cat /etc/passwd The file stores all users in the system in :-seperated column format. It has 7 fields starting from <username>, whether password encrypted, user id <uid>, group id <gid>, comment, home directory and shell. cat /etc/group The file contains group name, password, groud id <gid>, and user names in this group. id <username> Shows the user id, group id and groups the person is in.

  • Documentation
Tuesday, June 6, 2023 | 2 minutes Read
Hero Image
An Intro to a CLI Password Management: Pass

Pass Replace text in <> with your own info. pass Generate a gpg key pair gpg --full-generate-key Enter name and email address To change expire date gpg --edit-key <email>@<address> Once you are in the interactive mode gpg> list gpg> expire gpg> save To change password gpg --passwd <email>@<address> To export public key gpg --export --armor --output public.pgp <email>@<address> To change cache time using gpg agent in secs cd ~/.gnupg echo "default-cache-ttl 86400" > gpg-agent.conf echo "max-cache-ttl 86400" >> gpg-agent.conf Pass Initialize Pass gpg -K # to show key id pass init <key_id> pass git init Add new password pass insert <name> # create a new password pass generate <name> # generate a new password pass list # list passwords pass generate <name>/<sub> # generate a nested password If we replace <name> with github, we will create a password file named github. Each password is stored as a file, like so:

  • Documentation
Monday, May 29, 2023 | 2 minutes Read
Hero Image
Setup Ubuntu 22.04

install packages sudo apt update && sudo apt upgrade -y sudo apt install -y zsh git i3 feh scrot pavucontrol i3blocks tree curl htop picom sudo apt install cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev clang install zsh and oh-my-zsh <!-- sudo apt install zsh-autosuggestions zsh-syntax-highlighting --> sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions install nvim https://github.com/neovim/neovim/releases/tag/v0.7.0 git clone https://github.com/YHRen/nvim_config sudo apt install build-essential llvm xclip follow the instruction in nvim_config.

  • Documentation
Monday, May 2, 2022 | 2 minutes Read
Hero Image
Pytorch Distributed Data Parallel With Model Parallel in an HPC Environment

Distributed Data Parallel with Model Parallel in an HPC environment Objective This tutorial is on : how to separate a model and put it on multiple GPUs. how to train such model in a distributed data parallel fashion. how to use torch.distributed.launch and create a slurm job script for HPC environment. Model Parallel (Pipelining) When a model is too large to fit in one GPU device, we can cut it in half and put each part on different GPU device. To do this, we need to partition the model into “head” and “tail” and specify which device to put them on. In the following toy example, we simply put the first part in to current GPU device and the second part to the next device.

  • Documentation
Thursday, December 12, 2019 | 5 minutes Read
Navigation
  • About
  • News
  • Publications
  • Education
  • Experiences
Contact me:
  • yren@bnl.gov
  • yhren
  • Yihui (Ray) Ren

Liability Notice: This blog is for informational and educational purposes only. The content provided here represents personal opinions and is not intended as professional advice. Readers should not rely solely on this information and are responsible for their own actions and decisions. This blog is not liable for any damages or consequences resulting from the use of its content. The views expressed here are my own and do not reflect those of my employer or any funding agencies. © 2017-2025 Yihui Ren. All rights reserved.


Toha Theme Logo Toha
© 2017-2025 Yihui Ren. All rights reserved.
Powered by Hugo Logo