Backto DL Index
Linux 环境下
NVIDIA GPU 相关
# to check the version of CUDA
$ nvcc --version
## *nix - only
$ cat /usr/local/cuda/version.txt
# to check the version of CUDNN
## *nix - only
$ cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
# to list all nvidia GPUs available
## *nix - only
$ lspci | grep -i nvidia
# to show GPU usage
$ nvidia-smi
nvidia-smi 的含义
每一列代表的含义:
第1列:GPU是GPU的编号,从0开始。Fan表示GPU风扇的转速。
第2列:Name是GPU的型号。Temp是温度,单位为摄氏度。
第3列:Pref是性能状态,P0代表最大性能。
第4列:Persistence-M显示GPU持续模式的状态。Pwr代表能耗。
第5列:Bus-Id。
第6列:Disp.A显示GPU是否Active。Memory-Usage是显存的使用情况。
第7列:GPU利用情况。
第8列:Uncorr. ECC表示Uncorrectable ECC Errors。Compute M表示计算模式。
如果输入nvidia-smi显示NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.,说明CUDA或显卡驱动没有配置好,需要重新安装或进行配置。
CPU相关
# 查看CPU信息,包括CPU型号、核数等,输出内容比较详细:
$ cat /proc/cpuinfo
# 查看CPU物理核心数量:
$ cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
内存状况
# 查看内存占用情况和进程:
top
(命令输出内容很多)
# 简单查看内存总量和使用情况,可以使用free命令:
free -m #以Mb为单位输出
free -g #以Gb为单位输出
硬盘空间
# 查看各分区使用情况:
$ df -h
# 查看指定目录的大小:
$ du -sh