-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenable-cuda-env.sh
More file actions
28 lines (28 loc) · 852 Bytes
/
enable-cuda-env.sh
File metadata and controls
28 lines (28 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#
echo '========================================'
echo ' Enabling CUDA environment (Conda)'
echo '========================================'
echo ' Please run this script on a GPU Node!'
#
echo 'Load Anaconda and GCC modules'
module purge
module load anaconda3/5.3.0 gcc/9.1.0
#
echo 'Activate Anaconda hook'
source /opt/sw/x86_64/glibc-2.17/ivybridge-ep/anaconda3/5.3.0/etc/profile.d/conda.sh
#
echo 'Activate conda env cuda'
conda deactivate
conda activate cuda
#
echo 'Adding path to env modules'
export PATH=$PATH:~/.conda/envs/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.conda/envs/cuda/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.conda/envs/cuda/lib/stubs
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/.conda/envs/cuda/lib/pkgconfig # for opencv
#
echo 'Making the GPUs visible'
export CUDA_VISIBLE_DEVICES=0,1
#
echo 'Done!'