Hoffman2:JupyterNotebook: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
No edit summary
 
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Use Jupyter Notebook==
=Use Jupyter Notebook/Lab=


Methord 1:
==Connecting to Hoffman2==
Run on Hoffman2
Download h2jupynb from [https://raw.githubusercontent.com/rdauria/jupyter-notebook/main/h2jupynb | git] to your local drive


Download h2jupynb from https://gitlab.idre.ucla.edu/dauria/jupyter-notebook to local
(A copy is under /u/project/CCN/apps/scripts/idre_scripts/ in Hoffman but it might not be the newest version)


Make it excutable
  chmod u+x h2jupynb
  chmod u+x h2jupynb


from your laptop, run (Using Python 3.7)
From your laptop, run  


  ./h2jupynb -u userid -v 3.7.0
  ./h2jupynb -u userid -t 2 -m 8 -p 9394


(You'll find more details [[https://www.hoffman2.idre.ucla.edu/access/jupyter-notebook/]])
(You'll find more details [https://www.hoffman2.idre.ucla.edu/Using-H2/Connecting/Connecting.html#connecting-via-jupyter-notebook-lab here])


Without specifying the version, it will use the default Python version chosen by the script, currently 3.9.6.


Methord 2:
You can specify Python version you want to use
 
./h2jupynb -u userid -v 3.7.3 -t 2 -m 8 -p 9394
 
==Install on Local Device==
Install to your laptop using Anaconda:
Install to your laptop using Anaconda:


https://jupyter.org/install
[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
 
===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


Download Anaconda version 3.7, install to your Macbook, then run "jupyter notebook"
Using h2jupynb:
./h2jupynb -v anaconda3 -g yes -c P4 -l 10.0

Latest revision as of 21:50, 28 May 2022

Use Jupyter Notebook/Lab

Connecting to Hoffman2

Download h2jupynb from | git to your local drive

(A copy is under /u/project/CCN/apps/scripts/idre_scripts/ in Hoffman but it might not be the newest version)

Make it excutable

chmod u+x h2jupynb

From your laptop, run

./h2jupynb -u userid -t 2 -m 8 -p 9394

(You'll find more details here)

Without specifying the version, it will use the default Python version chosen by the script, currently 3.9.6.

You can specify Python version you want to use

./h2jupynb -u userid -v 3.7.3 -t 2 -m 8 -p 9394

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

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