Hoffman2:JupyterNotebook: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
No edit summary
(→‎Method 1:: fix broken links, restructure content, and add GPU information)
Line 1: Line 1:
==Use Jupyter Notebook==
=Use Jupyter Notebook/Lab=


===Method 1:===
Run on Hoffman2


==Install on Local Device==
Install to your laptop using Anaconda:
[https://jupyter.readthedocs.io/en/latest/install.html Jupyter Official Website]
#Download [https://www.anaconda.com/distribution/ Anaconda] version 3.7
#Install it to your laptop as a regular application
#then run "jupyter notebook" from the terminal
==Connecting to Hoffman2==
Download h2jupynb from [https://gitlab.idre.ucla.edu/dauria/jupyter-notebook git ] to your local drive
Download h2jupynb from [https://gitlab.idre.ucla.edu/dauria/jupyter-notebook git ] to your local drive


Line 12: Line 22:
  ./h2jupynb -u userid -v 3.7.0
  ./h2jupynb -u userid -v 3.7.0


(You'll find more details [https://www.hoffman2.idre.ucla.edu/access/jupyter-notebook/ here])
(You'll find more details [https://www.hoffman2.idre.ucla.edu/Using-H2/Connecting/Connecting.html#connecting-via-jupyter-notebook-lab here])
 
===Method 2:===
Install to your laptop using Anaconda:
 
[https://jupyter.readthedocs.io/en/latest/install.html Jupyter Official Website]


1. Download [https://www.anaconda.com/distribution/ Anaconda] version 3.7
===GPU Access===
To access GPU resources on Hoffman, add the virtual env to ipykernel for the very first time:


2. Install it to your MacBook as a regular application
qrsh -l gpu,P4
module load python/anaconda3
conda activate pytorch-1.3.1-gpu
python -m ipykernel install --user --name=pytorch-1.3.1-gpu


3. then run "jupyter notebook" from the terminal
Using h2jupynb:
./h2jupynb -v anaconda3 -g yes -c P4 -l 10.0

Revision as of 07:21, 26 October 2020

Use Jupyter Notebook/Lab

Install on Local Device

Install to your laptop using Anaconda:

Jupyter Official Website

  1. Download Anaconda version 3.7
  2. Install it to your laptop as a regular application
  3. then run "jupyter notebook" from the terminal


Connecting to Hoffman2

Download h2jupynb from git to your local drive

chmod u+x h2jupynb

From your laptop, run (Using Python 3.7)

./h2jupynb -u userid -v 3.7.0

(You'll find more details here)

GPU Access

To access GPU resources on Hoffman, add the virtual env to ipykernel for the very first time:

qrsh -l gpu,P4
module load python/anaconda3
conda activate pytorch-1.3.1-gpu
python -m ipykernel install --user --name=pytorch-1.3.1-gpu

Using h2jupynb:

./h2jupynb -v anaconda3 -g yes -c P4 -l 10.0