The tool developed to collect the gpus info of the linux cluster in my lab and display them in wechat mini-program "考研备忘录"
- hostname
- ram_available
- gpu_name, gpu_memory_total, gpu_memory_free, gpu_memory_used
hostname
cat /proc/meminfo | grep MemAvailable | tr -cd "[0-9]"
nvidia-smi --query-gpu=name,memory.total,memory.free,memory.used --format=csv,noheader,nounits
The info listed above are collected using the project.
Check the code for more details
About nvidia-smi
- hostname
- ram_available
- gpu_name, gpu_memory_total, gpu_memory_free, gpu_memory_used
The info listed above are displayed in mini-program "考研备忘录", which is not an open-source project yet.
numpy
requests
git clone https://github.com/2812427914/ServerTool.git
or
git clone https://github.com.cnpmjs.org/2812427914/ServerTool.git
(faster, mirror)
cd ServerTool
before run bash wgpu.sh
- set the
python_path
inwgpu.sh
. (The python version contains the packages required) - set the
cron_freq
inwgpu.sh
.(Optional; the time in crontab tasks, in minutes; default 3 minutes and recommended) - set the
group_name = "bdaa_edu"
inmain_v1.py
.(Later feature; "bdaa_edu" supported only currently)
bash wgpu.sh
sis cluster python_path=~/anaconda3/envs/learn/bin/python3.6
pangpang clusterpython_path=/usr/bin/python3.6
huzx clusterpython_path=/usr/bin/python3.7
git clean -f -d
git fetch --all
git reset --hard origin/master
Then do not forget to:
- set the
python_path
inwgpu.sh
(!!!). - set the
cron_freq
inwgpu.sh
. - set the
group_name
inmain_v1.py
.
rm access_token.txt record_id.txt cron ; rm -r gpustat_v1/ __pycache__/
git add -A
git commit -m 'fix bugs'
git pull origin master
git push -u origin master
- Add linux group feature. (one can set the group_name and check the gpus info in the "考研备忘录" according to group_name)
- Change the way of setting the python_path to the level of naive
- Support setting the variables (cron_freq, alive_servers) of a linux cluster through logining in one of the them.