miniconda

Reference:

1
2
3
4
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh

安装后,初始化新安装的 Miniconda。以下命令针对 bash 和 zsh shell 进行初始化:

1
2
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh

cuda toolkit(可选)

Reference:

如果需要编译 CUDA 程序那么这一步是必选

1
2
3
cd /tmp
wget https://developer.download.nvidia.com/compute/cuda/12.2.2/local_installers/cuda_12.2.2_535.104.05_linux.run
sudo sh cuda_12.2.2_535.104.05_linux.run

pdm

Reference:

确保 conda 已经激活

1
2
3
4
5
echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.zshrc
echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc

python3 -m pip install --user pipx
pipx install pdm[all]

pytorch

Reference:

1
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

kaggle cli

Reference:

1
2
3
4
5
6
pip install kaggle

# 打开 https://www.kaggle.com/settings
# 下载 kaggle.json,上传到 ~/.kaggle/kaggle.json

chmod 0644 ~/.kaggle/kaggle.json