ubuntu2204
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo gedit /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
sudo apt update sudo apt upgrade
sudo apt-get install build-essential
sudo apt-get remove --purge nvidia* sudo apt autoremove sudo gedit /etc/modprobe.d/blacklist.conf blacklist nouveau options nouveau modeset=0 sudo update-initramfs -u sudo reboot
#cuda
https://developer.nvidia.com/cuda-toolkit-archive
wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda_11.7.1_515.65.01_linux.run
sudo sh cuda_11.7.1_515.65.01_linux.run
#cudnnsudo dpkg -i cudnn-local-repo-ubuntu2204-8.5.0.96_1.0-1_amd64
The public CUDA GPG key does not appear to be installed.
sudo cp /var/cudnn-local-repo-ubuntu2204-8.5.0.96/cudnn-local-7ED72349-keyring.gpg /usr/share/keyrings/cuda-archive-keyring.gpg
sudo apt update
sudo apt install openssh-server
sudo apt upgrade
sudo apt install nvidia-driver-550
sudo apt install python3.10-venv python3-pip
cd /usr/local
mkdir gpu
python3 -m venv gpu
source gpu/bin/activate
vim /etc/bash.bashrc #alias gpu='source /usr/local/gpu/bin/activate'
pip install -i https://mirrors.bfsu.edu.cn/pypi/web/simple numpy pandas scipy matplotlib jupyter notebook scikit-learn scikit-image librosa seaborn opencv-python
pip install -i https://mirrors.bfsu.edu.cn/pypi/web/simple torch torchvision torchaudio
pip install -i https://mirrors.bfsu.edu.cn/pypi/web/simple tensorflow wfdb tqdm dill
apt install libopencv-dev python3-opencv
vim /etc/inputrc #history-search
vim /etc/sudoers #Cmnd_Alias SHUTDOWN_CMDS = /sbin/poweroff, /sbin/reboot, /sbin/halt, /sbin/shutdown
#ALL ALL=(ALL) NOPASSWD:SHUTDOWN_CMDS
crontab -e #20 1,6 * * 1,4,6,0 /usr/bin/python3 /home/XX/Documents/check.py
mkdir ~/.pip cd ~/.pip sudo gedit ~/.pip/pip.conf
[global]
index-url=https://mirrors.bfsu.edu.cn/pypi/web/simple
extra-index-url=
https://pypi.tuna.tsinghua.edu.cn/simple
https://pypi.mirrors.ustc.edu.cn/simple
[install]
trusted-host=mirrors.bfsu.edu.cn
pypi.tuna.tsinghua.edu.cn
pypi.mirrors.ustc.edu.cn
Could not load dynamic library 'libnvinfer.so.7'
cd /usr/lib/x86_64-linux-gnu ln -s libnvinfer.so.8 libnvinfer.so.7 ln -s libnvinfer_plugin.so.8 libnvinfer_plugin.so.7 ln -s libnvonnxparser.so.8 libnvonnxparser.so.7 ln -s libnvparsers.so.8 libnvparsers.so.7 cd /usr/local/cuda-12.0/lib64 ln -s libcufft.so.11 libcufft.so.10 ln -s libcusparse.so.12 libcusparse.so.11 cd env/lib/python3.10/site-packages/tensorrt $ export LD_LIBRARY_PATH = $LD_LIBRARY_PATH:~env/lib/python3.10/site-packages/tensorrt
no module named '_tkinter'
sudo apt-get install python3-tk
jupyter nbconvert --to notebook --execute --inplace filter.ipynb
nvidia drivers not working
Remove all the nvidia packages... then update the kernel...
sudo apt-get remove --purge nvidia*
dkms status
sudo update-initramfs -u
reboot...
install the driver again:
sudo apt install nvidia-driver-525
(do not add anything else)