JupyterNotebook Custom kernel
Python VENV
To install a custom kernel with whatever python modules you prefer please run the following, either via an ssh session to an hpc system or via the terminal application within jupyterhub:
python3 -m venv ~/venvs/mytorch
. ~/venvs/mytorch/bin/activate
pip install torch torchvision torchaudio ipykernel
python -m ipykernel install --user --name=mytorch --display-name "My PyTorch"
(note that mytorch and "My PyTorch" are placeholders and can be changed to whatever you prefer)
Once completed you will see your custom kernel in jupyterhub every time you launch it:
you can also change your kernel at any time by selecting the Kernel dropdown menu:
Anaconda
conda create -n mytorch python=3.10 -y
conda activate mytorch
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia ipykernel -y
python -m ipykernel install --user --name=mytorch --display-name "My PyTorch (Conda)"
(note that mytorch and "My PyTorch" are placeholders and can be changed to whatever you prefer)
Once completed you will see your custom kernel in jupyterhub every time you launch it:
you can also change your kernel at any time by selecting the Kernel dropdown menu: