Installation
After login, use nano
or vim
to modify ~/.bashrc
. Add the following code to the end of ~/.bashrc
and save the file:
1 2
| . /opt/miniconda/etc/profile.d/conda.sh export PATH="/opt/miniconda/bin:$PATH"
|
Then in shell:
Test if conda is initialized successfully:
if the result is conda 24.11.1
, it means you can access conda.
Rule
When you use conda to build a new environment, please name it as your “**{id}_{env_name}**”, avoid potential collision:
For example, “hat170_tf1.4”.
For those who want to use GPU in tmux:
If you want to use a different CUDA and cuDNN version in your environment, please change the following code according to your own environment.
Open tmux:
- First biuld a activate script dir:
1
| mkdir -p ~/.conda/envs/hat170_tf1.15GPU/etc/conda/activate.d
|
- Biuld a bash file to set environmental variables:
1 2 3 4 5 6
| cat << 'EOF' > ~/.conda/envs/hat170_tf1.15GPU/etc/conda/activate.d/env_vars.sh
export CUDA_HOME=/usr/local/cuda export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7,8,9 export LD_LIBRARY_PATH=/usr/local/amber24/lib:/usr/local/cuda/lib:/usr/local/cuda/lib64 EOF
|
- Add execution permission:
1
| chmod +x ~/.conda/envs/hat170_tf1.15GPU/etc/conda/activate.d/env_vars.sh
|
- Reactivate the environment to apply the settings:
1 2
| conda deactivate conda activate hat170_tf1.15GPU
|
- Test your settings:
1 2 3
| echo "CUDA_HOME: $CUDA_HOME" echo "CUDA_VISIBLE_DEVICES: $CUDA_VISIBLE_DEVICES" echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
|