Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
habrok:examples:python [2023/04/11 15:01] – admin | habrok:examples:python [2024/01/29 10:16] (current) – [GPU] pedro | ||
---|---|---|---|
Line 36: | Line 36: | ||
which is what we wanted. | which is what we wanted. | ||
- | Now, we need to decide where to save the folder that contains the Python Virtual Environment we're going to build. There is no restriction on this, as long as you have the permissions, | + | Now, we need to decide where to save the folder that contains the Python Virtual Environment we're going to build. There is no restriction on this, as long as you have the permissions, |
It is easy to build a Python Virtual Environment: | It is easy to build a Python Virtual Environment: | ||
<code bash> | <code bash> | ||
- | python3 -m venv $HOME/.envs/first_env | + | python3 -m venv $HOME/venvs/first_env |
</ | </ | ||
Line 49: | Line 49: | ||
The Python Virtual Environment is now built, but we can't use it yet, first we need to // | The Python Virtual Environment is now built, but we can't use it yet, first we need to // | ||
<code bash> | <code bash> | ||
- | source $HOME/.envs/ | + | source $HOME/venvs/ |
</ | </ | ||
Line 67: | Line 67: | ||
</ | </ | ||
- | where '' | + | where '' |
It is considered good practice to save the names of all the packages you wish to install in a text file (usually called '' | It is considered good practice to save the names of all the packages you wish to install in a text file (usually called '' | ||
Line 91: | Line 91: | ||
module load Python/ | module load Python/ | ||
- | source $HOME/.envs/ | + | source $HOME/venvs/ |
python3 --version | python3 --version | ||
Line 103: | Line 103: | ||
</ | </ | ||
- | This jobscript will first purge your module environment, | + | This jobscript will first purge your module environment, |
Deactivating the Python Virtual Environment isn't strictly necessary, since the job ends after that in any case. | Deactivating the Python Virtual Environment isn't strictly necessary, since the job ends after that in any case. | ||
Line 320: | Line 320: | ||
<code bash> | <code bash> | ||
- | module load Python/3.6.4-foss-2018a | + | module load Python/3.10.4-GCCcore-11.3.0 |
- | module load CUDA/9.1.85 | + | module load CUDA/11.7.0 |
- | module load Boost/1.66.0-foss-2018a-Python-3.6.4 | + | module load Boost/1.79.0-GCC-11.3.0 |
pip install pycuda --user | pip install pycuda --user | ||
</ | </ | ||
Line 335: | Line 335: | ||
#SBATCH --gres=gpu: | #SBATCH --gres=gpu: | ||
#SBATCH --mem=8000 | #SBATCH --mem=8000 | ||
- | module load Python/3.6.4-foss-2018a | + | module load Python/3.10.4-GCCcore-11.3.0 |
+ | module load CUDA/ | ||
+ | module load Boost/ | ||
python ./ | python ./ | ||
</ | </ |