1. 安装显卡驱动
参考链接:Ubuntu 安装NVIDIA显卡驱动和CUDA
2. 安装cuda
sudo apt-get update
sudo apt upgrade
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
sudo sh cuda_11.8.0_520.61.05_linux.run
# 添加环境变量
vim ~/.bashrc
# 加入如下两行
export PATH=$PATH:/usr/local/cuda-11.8/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.8/lib64
# 生效
source ~/.bashrc
# 查看版本
nvcc -V
3. 安装cryosparc
# 添加环境变量
vim ~/.bashrc
# 这个ID要去申请,后面都得跟随更改
export LICENSE_ID="*******"
# 安装curl工具
sudo apt install curl
# 创建安装目录
mkdir ~/cryosparc && cd ~/cryosparc
# 下载安装包
curl -L https://get.cryosparc.com/download/master-latest/LICENSE_ID -o cryosparc_master.tar.gz
curl -L https://get.cryosparc.com/download/worker-latest/LICENSE_ID -o cryosparc_worker.tar.gz
# 解压安装包
tar -xf cryosparc_master.tar.gz cryosparc_master
tar -xf cryosparc_worker.tar.gz cryosparc_worker
# 创建缓存目录
mkdir cryosparc_cache
# 进入cryosparc_master安装
cd cryosparc_master
./install.sh --standalone --license LICENSE_ID --worker_path /home/ce04/cryosparc/cryosparc_worker --ssdpath /home/ce04/cryosparc/cryosparc_cache --initial_email "exmple@mail.ccnu.edu.cn" --initial_password "*******" --initial_username "zengshgun" --initial_firstname "Shun" --initial_lastname "Zeng"
# 添加环境变量
vim ~/.bashrc
export PATH=$PATH:/home/ce04/cryosparc/cryosparc_master/bin
source ~/.bashrc
# 启动cryosparcm
cryosparcm start
4. 安装Anaconda3
# 下载并安装Anaconda3
sh Anaconda3-2023.09-0-Linux-x86_64.sh
# 添加环境变量
vim ~/.bashrc
# 直接加环境变量conda activate 会报找不到命令
# export PATH=$PATH:/home/ce04/anaconda3/bin
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/ce04/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/ce04/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/ce04/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ce04/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
source ~/.bashrc
5. 安装topaz
conda env list
conda create -n topaz python=3.8
conda activate topaz
conda install topaz=0.2.5 cudatoolkit=11.8 -c tbepler -c pytorch -c conda-forge
conda deactivate
# Create a topaz.sh wrapper script
cd ~/cryosparc
touch topaz.sh
vim topaz.sh
#!/usr/bin/env bash
if command -v conda > /dev/null 2>&1; then
conda deactivate > /dev/null 2>&1 || true # ignore any errors
conda deactivate > /dev/null 2>&1 || true # ignore any errors
fi
unset _CE_CONDA
unset CONDA_DEFAULT_ENV
unset CONDA_EXE
unset CONDA_PREFIX
unset CONDA_PROMPT_MODIFIER
unset CONDA_PYTHON_EXE
unset CONDA_SHLVL
unset PYTHONPATH
unset LD_PRELOAD
unset LD_LIBRARY_PATH
source /home/ce04/anaconda3/etc/profile.d/conda.sh
conda activate topaz
exec topaz $@
chmod +x topaz.sh
6. 安装常用工具
sudo apt install htop
sudo apt install pbzip2
- **记:**所有安装包均已下载至本地电脑 F:\Software\cryosparc install