安装miniconda
Login to Ibex using your KAUST credentials.
ssh $USERNAME@ilogin.ibex.kaust.edu.sa # use glogin.kaust.edu.sa if you need GPU nodes
Clone this git repository in your Ibex home directory.
cd ~/
git clone https://github.com/kaust-rccl/ibex-miniconda-install.git
Change into the newly cloned repository directory and source the install script. Sourcing the install script runs each of the commands in the script as if you had entered them manually at the prompt and insures that changes made to your ~./bashrc take effect without your having to logout of Ibex.
cd ibex-miniconda-install/
source install-miniconda.sh
The script will present several prompts that allow you to customize the Miniconda install. We generally recommend that you accept the default settings. However, when prompted with the following…
Do you wish the installer to initialize Miniconda3
by running conda init?
…we recommend that you type yes to avoid having to manually initialize Conda for Bash later.
If you accidentally type no, don’t worry. When the script finishes you simply need to type the following commands.
conda init bash
source ~/.bashrc
By default, the Conda base environment is deactivated when you login to Ibex. If you would prefer that the Conda base environment be activated on login then you can run the following command to set the auto_activate_base configuration parameter to true.
conda config --set auto_activate_base true
If you are still a little unsure about the whole process, we have created a tutorial on our YouTube channel that will walk you through the above steps in detail.
Updating Conda Conda is a rapidly developing tool and it is important that you keep your versions on Ibex updated to the most recent version available. We have included an update-conda.sh script that will update Conda for you. Change into the ibex-miniconda-install directory and source the update script.
cd ~/ibex-miniconda-install
source update-conda.sh
Uninstalling Miniconda
Login to Ibex using your KAUST credentials.
ssh $USERNAME@ilogin.ibex.kaust.edu.sa # use glogin.kaust.edu.sa if you need GPU nodes
Change into the ibex-miniconda-install directory and source the uninstall script. Sourcing the install script insures that you don’t need to logout of Ibex in order for the changes made by the uninstaller script to take effect.
cd ~/ibex-miniconda-install/
source uninstall-miniconda.sh
Running uninstall-miniconda.sh will delete all Conda environments stored in the ~/miniconda3/envs directory.
安装pytorch环境
构建新路径放环境
mkdir pytorch_project_path
激活conda
conda activate
3.用nano构建环境配置
nano enviroment.yml
在yml文件中写如下配置
name: pytorch-env
channels:
- pytorch
- conda-forge
- defaults
dependencies:
- cudatoolkit=11.3
- pip
- python
- pytorch
- torchaudio
- torchvision
其中toolkit的版本通过nvidia-smi查看,需要和自己的cuda版本保持一致
4.从头创建新环境
conda env create --prefix ./env --file environment.yml --force
5.激活新环境
conda activate ./env
参考: 1:https://www.youtube.com/watch?v=X-W7aVXH3_w 2.https://github.com/kaust-rccl/ibex-miniconda-install 3.https://www.youtube.com/watch?v=cTaKR0qunZ0
精彩链接
发表评论