diff --git a/doc.zih.tu-dresden.de/docs/jobs_and_resources/alpha_centauri.md b/doc.zih.tu-dresden.de/docs/jobs_and_resources/alpha_centauri.md index 1e4d6cced1982365a2a3b7c13b605124f9a006e5..4cfccc786620a9ec70258f7eee0243bd413d9281 100644 --- a/doc.zih.tu-dresden.de/docs/jobs_and_resources/alpha_centauri.md +++ b/doc.zih.tu-dresden.de/docs/jobs_and_resources/alpha_centauri.md @@ -68,7 +68,7 @@ To check the available modules for `Alpha`, use the command marie@login.alpha$ module spider <module_name> ``` -??? example "Searching and loading PyTorch" +??? example "Example: Searching and loading PyTorch" For example, to check which `PyTorch` versions are available you can invoke @@ -124,35 +124,37 @@ marie@login.alpha$ module spider <module_name> ### Python Virtual Environments -[Virtual environments](../software/python_virtual_environments.md) allow users to install -additional python packages and create an isolated -runtime environment. We recommend using `virtualenv` for this purpose. +[Virtual environments](../software/python_virtual_environments.md) allow you to install +additional Python packages and create an isolated runtime environment. We recommend using +`virtualenv` for this purpose. -```console -marie@login.alpha$ srun --nodes=1 --cpus-per-task=1 --gres=gpu:1 --time=01:00:00 --pty bash -l -marie@alpha$ mkdir python-environments # please use workspaces -marie@alpha$ module load modenv/hiera GCC/10.2.0 CUDA/11.1.1 OpenMPI/4.0.5 PyTorch -Module GCC/10.2.0, CUDA/11.1.1, OpenMPI/4.0.5, PyTorch/1.9.0 and 54 dependencies loaded. -marie@alpha$ which python -/sw/installed/Python/3.8.6-GCCcore-10.2.0/bin/python -marie@alpha$ pip list -[...] -marie@alpha$ virtualenv --system-site-packages python-environments/my-torch-env -created virtual environment CPython3.8.6.final.0-64 in 42960ms - creator CPython3Posix(dest=~/python-environments/my-torch-env, clear=False, global=True) - seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=~/.local/share/virtualenv) - added seed packages: pip==21.1.3, setuptools==57.2.0, wheel==0.36.2 - activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator -marie@alpha$ source python-environments/my-torch-env/bin/activate -(my-torch-env) marie@alpha$ pip install torchvision -[...] -Installing collected packages: torchvision -Successfully installed torchvision-0.10.0 -[...] -(my-torch-env) marie@alpha$ python -c "import torchvision; print(torchvision.__version__)" -0.10.0+cu102 -(my-torch-env) marie@alpha$ deactivate -``` +??? example "Example: Creating virtual environment and installing `torchvision` package" + + ```console + marie@login.alpha$ srun --nodes=1 --cpus-per-task=1 --gres=gpu:1 --time=01:00:00 --pty bash -l + marie@alpha$ mkdir python-environments # please use workspaces + marie@alpha$ module load modenv/hiera GCC/10.2.0 CUDA/11.1.1 OpenMPI/4.0.5 PyTorch + Module GCC/10.2.0, CUDA/11.1.1, OpenMPI/4.0.5, PyTorch/1.9.0 and 54 dependencies loaded. + marie@alpha$ which python + /sw/installed/Python/3.8.6-GCCcore-10.2.0/bin/python + marie@alpha$ pip list + [...] + marie@alpha$ virtualenv --system-site-packages python-environments/my-torch-env + created virtual environment CPython3.8.6.final.0-64 in 42960ms + creator CPython3Posix(dest=~/python-environments/my-torch-env, clear=False, global=True) + seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=~/.local/share/virtualenv) + added seed packages: pip==21.1.3, setuptools==57.2.0, wheel==0.36.2 + activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator + marie@alpha$ source python-environments/my-torch-env/bin/activate + (my-torch-env) marie@alpha$ pip install torchvision + [...] + Installing collected packages: torchvision + Successfully installed torchvision-0.10.0 + [...] + (my-torch-env) marie@alpha$ python -c "import torchvision; print(torchvision.__version__)" + 0.10.0+cu102 + (my-torch-env) marie@alpha$ deactivate + ``` ### JupyterHub