Linux 调试命令记录

查看CPU信息

cat /proc/cpuinfo

在这里插入图片描述

显示当前电源功耗

  1. top 命令能够清晰的展现出系统的状态,而且它是实时的监控,按 q 退出。
    在这里插入图片描述
  2. uptimew
    在这里插入图片描述
    这两个命令只是单纯的反映出负载,所表示的是过去的1分钟、5分钟和15分钟内进程队列中的平均进程数量

dmesg 命令

Linux dmesg(英文全称:display message)命令用于显示开机信息

kernel 会将开机信息存储在 ring buffer 中。您若是开机时来不及查看信息,可利用 dmesg 来查看。开机信息亦保存在 /var/log 目录中,名称为 dmesg 的文件里。

dmesg [-cn][-s <缓冲区大小>]

查看系统崩溃日志

  1. journalctl:用于查看systemd日志,可以通过以下命令查看崩溃相关的日志: “journalctl -b -1″,这会显示最后一次系统启动到崩溃之间的所有日志。
    journalctl 用来查询 systemd-journald 服务收集到的日志。systemd-journald 服务是 systemd init 系统提供的收集系统日志的服务。
    命令格式为:journalctl [OPTIONS…] [MATCHES…]
    最近日志sudo journalctl -b -1
    linux journalctl 命令

  2. /var/log/syslog:这是存储系统日志的主要文件,可以使用”cat /var/log/syslog | grep -i “error” “来过滤出包含错误信息的日志。

  3. /var/log/kern.log:这是Linux内核日志文件,也可以使用”cat /var/log/kern.log | grep -i “error” “来找到崩溃相关的错误信息。

su - 认证失败

原因:报这个错误的原因是root用户默认锁定的,只要使用 passwd 命令重新设置下 root 密码即可

sudo passwd

显卡驱动安装

找到显卡对应版本驱动https://www.nvidia.cn/geforce/drivers/

给驱动 run 文件赋予执行权限:

sudo chmod 777 NVIDIA-linux-x86_64-xxx.xxx.run
sudo ./NVIDIA-linux-x86_64-xxx.xx.run -no-opengl-files

ERROR: The nvidia kernel module was not created.
ERROR: Installation has failed. Please see the file ‘/var/log/nvidia-installer.log’ for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

GCC11 升级为GCC12

1.Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?NO

2.Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.YES

3.是否安装 32 位驱动 【首选Yes
https://blog.csdn.net/weixin_42711071/article/details/90637706

在这里插入图片描述

挂载硬盘

如果新的挂载点不存在,需要新建目录,在终端输入(挂载点以‘/media/disk’为例)

sudo mkdir /media/disk
sudo mount /dev/sda0 /media/disk

/dev/sda0 为硬盘

Unsupported gpu architecture ‘compute_89’

原因:显卡太新

vi ~/.bashrc

# 在配置文件中添加如下一行
export TORCH_CUDA_ARCH_LIST="8.0"  # 因为是CUDA11.0,对应的算力为8.0 
source ~/.bashrc

安装好以后再将bashrc中的那行代码注释掉

查看CPU、GPU温度

watch -n 1 sensors

在这里插入图片描述

watch -n 1 nvidia-smi -q -i 0,1 -d TEMPERATURE

在这里插入图片描述

  • 28
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞大圣

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值