12 篇文章带有标签 “troubleshooting”

NVIDIA Driver 安装

困难重重 😭

服务器是 NVIDIA Tesla T4,系统是 Ubuntu 20.04,从 Kubernetes 集群中分离出来的,因 Tabby 请求 CUDA >= 11.7,需要重新安装新版本的驱动。

下载 NVIDIA Driver

安装 NVIDIA Driver

sudo sh NVIDIA-Linux-x86_64-535.129.03.run

就两步就完成了,简单吧 😄

实际安装过程 😭

安装驱动

sudo sh NVIDIA-Linux-x86_64-535.129.03.run

日志查看错误信息

GPU 服务器不能访问

13 号 上午 GPU 服务器突然不能访问了,可以通过 CPU 服务器访问 GPU 服务器。这一周一直在查找问题,这里记录一下过程。

traceroute 路由追踪

  • GPU 服务器
traceroute gpu1
traceroute to gpu1 (172.16.33.66), 64 hops max, 52 byte packets
 1  * * *
 2  172.16.136.2 (172.16.136.2)  7.462 ms  3.820 ms  3.014 ms
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
  • CPU 服务器
traceroute cpu1
traceroute to cpu1 (172.16.33.157), 64 hops max, 52 byte packets
 1  * * *
 2  172.16.136.2 (172.16.136.2)  7.827 ms  4.712 ms  3.162 ms
 3  * * *
 4  cpu1 (172.16.33.157)  8.619 ms  4.205 ms  4.982 ms

tcpdump 抓包

在GPU服务器上抓取 22 端口的数据包

macOS 能连上 WiFi 但无法上网

问题描述

我的 MacBook Pro M2 Max 能够连接上 WiFi,但是无法上网,我进行了以下尝试:

  1. 路由器(没有问题);
  2. 重启电脑;
  3. 断开 WiFi 重新连接;

解决方案

最后,我在抖音上看到了一个解决方案,我尝试了一下,果然解决了问题。

打开访达,按下Command + Shift + G,输入/Library/Preferences/SystemConfiguration/,除com.apple.Boot.plist文件外,删除其他所有文件,然后重启电脑。

macOS Docker

今天用 Docker 构建镜像,突然就挂了。重启 Docker,发现 Docker 无法启动了。

出现的错误

🐳 Building platen-switch:arm64
[+] Building 0.0s (2/2) FINISHED                                                                                                                                                            
 => [internal] load build definition from Dockerfile                                                                                                                                   0.0s
 => => transferring dockerfile: 69B                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                        0.0s
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: failed to create temp dir: mkdir /var/lib/docker/tmp/buildkit-mount1477620899: no space left on device

分析问题 运行诊断工具 com.docker.

macOS 上删除登录项中允许在后台的项目

launchd

一个统一的开源服务管理框架,用于启动、停止和管理守护进程、应用程序、进程和脚本。由 Apple 的 Dave Zarzycki 编写和设计,它随 Mac OS X Tiger 引入并获得许可Apache 许可证。

Daemon vs Agent

launchd 区分代理和守护进程。主要区别在于,代理代表登录用户运行,而守护进程代表根用户或您使用 UserName 键指定的任何用户运行。只有代理可以访问 macOS GUI。

Job

根据它的存储位置,它将被视为守护进程或代理。

对操作系统操作至关重要的作业定义存储在 /System/Library 下。您永远不需要在这些目录中创建守护进程或代理。与每个用户相关的第三方定义存储在 /Library 下。特定用户的作业定义存储在相应用户的 Library 目录下。

Ubuntu 上将 NVIDIA GPU 切换为 Intel 集成显卡 IGD

IGD(Integrated Graphics Device)

操作系统:Ubuntu 18.04,主机有一张 NVIDIA 的独立显卡 GP106 [GeForce GTX 1060 6GB],还有 Intel 酷睿处理器 i5 8500 自带的集成显卡(Intel UHD Graphics 630)。为了更充分的使用独立显卡用于深度学习计算,需要把集成显卡用于显示。在这个过程中遇到了各种各样的问题:

  • 鼠标和键盘失灵。
  • 登录 X Window 时,输入正确的密码不能登录。

BIOS 设置

显卡设置

  • IGD 内置图形显示集成显卡
  • PEG 独立PCI Express接口图形显卡

选择 IGD,保存退出。

配置 X Window 显示显卡设备信息 lspci lspci -k | grep -EA3 'VGA|3D|Display' | | | | | - Only VGA is not good enough, | | | | | because Nvidia mobile adapters | | | | | are shown as 3D and some AMD | | | | | adapters are shown as Display. | | | | --------- Print 3 lines after the regexp match.

Linux 性能优化

CPU

概念

平均负载

单位时间内,系统处于可运行状态和不可中断状态的平均进程数,也就是平均活跃进程数,它和 CPU 使用率并没有直接关系。

当平均负载高于 CPU 数量 70% 的时候,你就应该分析排查负载高的问题了。一旦负载过高,就可能导致进程响应变慢,进而影响服务的正常功能。 70% 这个数字并不是绝对的,最推荐的方法,还是把系统的平均负载监控起来,然后根据更多的历史数据,判断负载的变化趋势。当发现负载有明显升高趋势时,比如说负载翻倍了,你再去做分析和调查。

工具

查看 cpu核数

nproc
lscpu
grep 'model name' /proc/cpuinfo | wc -l

显示平均负载 uptime

uptime、top,显示的顺序是最近1分钟、5分钟、15分钟,从此可以看出平均负载的趋势

$ uptime
 12:51:13 up 754 days,  2:02,  3 users,  load average: 0.41, 0.65, 2.63

持续自动运行命令 watch

watch -d uptime: -d会高亮显示变化的区域

系统压力测试工具 stress

安装

yum install stress -y

strees: --cpu cpu压测选项,-i io压测选项,-c 进程数压测选项,--timeout 执行时间

阿里云 yum 安装应用报 404 错误

今天登录阿里云安装应用出现 404

问题

yum install install httpd-tools -y
CentOS-8 - AppStream                                                                                                                                                                      9.6 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'AppStream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
错误:为 repo 'AppStream' 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

解决方案 cd /etc/yum.repos.d/ find . -name '.repo' -exec sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' {} + find . -name '.

Kubernetes集群证书过期

证书一年过期了

kubectl get nodes
Unable to connect to the server: x509: certificate has expired or is not yet valid

查看API服务器的证书日期

  • 方法1
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text|grep -A2 'Validity'
        Validity
            Not Before: Jun 16 06:09:07 2020 GMT
            Not After : Jun 16 06:09:07 2021 GMT
  • 方法2
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -text|grep ' Not '
            Not Before: Jun 16 06:09:07 2020 GMT
            Not After : Jun 16 06:09:07 2021 GMT

重新配置证书 sudo kubeadm alpha certs renew all [renew] Reading configuration from the cluster...

命令brew

安装

brew install putty

FAQ

1、Updating Homebrew... 卡住

$ brew install putty
Updating Homebrew...
  • 方法1:直接关闭brew每次执行命令时的自动更新
$ vim ~/.bash_profile
export HOMEBREW_NO_AUTO_UPDATE=true
$ source ~/.bash_profile
  • 方法2:替换brew源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew-core.git
brew update

2、`initialize': Version value must be a string; got a NilClass () (TypeError) $ brew install putty /usr/local/Homebr

VS Code远程开发 - SSH

架构图

安装

Remote

Local

连接远程主机

  1. 在VS Code中, 按F1,选择Remote-SSH: Connect to Host...输入user@hostname。
  1. VS Code将连接到SSH服务器并进行设置。 VS Code将使用进度通知使您保持最新状态。

  1. 连接后,您将进入一个空窗口。 您始终可以参考状态栏来查看连接到的主机。

  1. 选择菜单:File > Open...

关闭远程连接

  • 选择菜单:File > Close Remote Connection。
  • 您可以简单地退出VS Code,也可以关闭远程连接。

Remote Explorer

管理您的远程连接

在远程主机上打开终端

选择菜单:Terminal > New Terminal

在远程主机调试

在Extensions窗口中选择要在远程主机上安装的调试器,按F5。

FAQ "Visual Studio Code is unable to watch for file changes in this large workspace" (error