Ubuntu 22.04安装Cuda Toolkit

Nvidia现在要求安装CuDNN和NICC都得登录Nvidia Developer网站,国内巨慢。药丸。

CUDA

1
2
3
4
sudo -i # 切换root权限
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
dpkg -i cuda-keyring_1.0-1_all.deb
apt update && apt install cuda -y

NICC

1
apt install libnccl2=2.15.5-1+cuda11.8 libnccl-dev=2.15.5-1+cuda11.8

Read More

修复MongoDB设置导致mongod无法启动

缘起

为了解决使用Arctic[1] MongoDB的日志里出现

1
SASL SCRAM-SHA-1 authentication failed for myAdminUser on admin from client 192.168.3.100:9560 ; UserNotFound: Could not find user "myAdminUser" for db "admin"

错误的问题,参考了数个连接(包括StackOverflow[2]),都提示要将authSchema.currentVersion5改成3。照做以后就杯具了,mongod服务完全打不开了,提示错误

1
This server is using MONGODB-CR, an authentication mechanism which has been removed from MongoDB 4.0. In order to upgrade the auth schema, first downgrade MongoDB binaries to version 3.6 and then run the authSchemaUpgrade command. See http://dochub.mongodb.org/core/3.0-upgrade-to-scram-sha-1

Read More

消除<frozen importlib._bootstrap>:228: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility.

问题

import scipy.stats的时候报警告:

1
2
3
4
5
6
Python 3.9.12 (main, Apr  5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy.stats import percentileofscore
<frozen importlib._bootstrap>:228: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject
>>> exit()

解决

这个的原因之一是pip在升级numpy,scipy的时候(pip install -U numpy scipy),对旧的package的删除可能不干净的问题。需要多次用uninstall直至无残留:

Read More

Ubuntu 22.04安装MongoDB 4.2

问题在于Ubuntu 22.04开始移除了libssl1.1的支持。所以需要先安装libssl1.1

1
2
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.

然后将18.04 boinic的source加入source list

1
2
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

更新apt并安装

Read More

AVS合并视频文件

常用的视频压制软件,如MeGUI、小丸工具箱等都不支持直接合并视频。所以只能通过AVS脚本实现。但直接用工具生成的脚本压制后会有音画不同步问题。这里分享一种网上找到的办法,可以基本保证合并并压制出没有明显瑕疵的视频。
  基本思路就是音画分别压制,视频部分用MeGUI自带的Avs Script Creator,生成后合并到一个文件里:

1
2
3
4
5
6
7
8
9
10
11
12
LoadPlugin("E:\MediaTools\MeGUI-2715-32\tools\lsmash\LSMASHSource.dll")
LoadPlugin("E:\MediaTools\MeGUI-2715-32\tools\ffms\ffms2.dll")
A=FFVideoSource("F:\JDownloader\Downloads\A.wmv", fpsnum=30, fpsden=1, threads=1)
B=FFVideoSource("F:\JDownloader\Downloads\B.wmv", fpsnum=30, fpsden=1, threads=1)
C=FFVideoSource("F:\JDownloader\Downloads\C.wmv", fpsnum=30, fpsden=1, threads=1)
D=FFVideoSource("F:\JDownloader\Downloads\D.wmv", fpsnum=30, fpsden=1, threads=1)
A+B+C+D
#deinterlace
#crop

LanczosResize(848,480) # Lanczos (Sharp)
#denoise

音频部分直接用DirectShowSource,并强制帧率,

1
2
3
4
5
A = DirectShowSource("F:\JDownloader\Downloads\A.wmv", fps=30.000, audio=true, convertfps=true)
B = DirectShowSource("F:\JDownloader\Downloads\B.wmv", fps=30.000, audio=true, convertfps=true)
C = DirectShowSource("F:\JDownloader\Downloads\C.wmv", fps=30.000, audio=true, convertfps=true)
D = DirectShowSource("F:\JDownloader\Downloads\D.wmv", fps=30.000, audio=true, convertfps=true)
A+B+C+D

Read More

Linux Mint 19安装Cuda 9.2以及cuDNN、NCCL

CUDA

系统升级到了Mint 19需要重新安装配置Cuda,同时升级到Cuda 9.2。Cuda 9.2需要Nvidia的驱动版本至少是396.37,但不幸的是apt仓库里的396版本驱动有问题,安装后无法被内核加载从而导致系统运行在软解状态。因此只好用bin文件安装。步骤如下:

  1. 去官网下载Cuda 9.2的bin安装文件,注意里面自带驱动所以不需要单独安装驱动。

Read More