H.P.C.

Jupyterlab HPC Guide

1. Step1. Login with user Mobaxter.

 ssh –X username@10.3.0.4 

2. Step2. qsub
qsub jupyterlab-dgx.sh  

Note- this will submit for resource from HPC and walltime

Jupyter Script Demo
How to Create the Script:

1. Run the command -
vim jupyterlab-dgx.sh 

2. Copy and paste the lines below into the script.

3. Adjust the required ncpus and ngpus.

Select the walltime to set a time limit for your work.

Save the script by typing :wq!.


Note – please user minimum ncpus and ngpus as requirement


**************Jypyter Script****************************************


Step3 -- Copy and paste below details in jupyterlab-dgx.sh file
#!/bin/bash  
#PBS -N jupyter_lab  
#PBS -l select=1:ncpus=20:ngpus=1  
#PBS -q dgx  
#PBS -l walltime=12:00:00  
#PBS -o $PBS_O_WORKDIR/jupyterlab.log  
#PBS -e $PBS_O_WORKDIR/jupyterlab_error.log  
# Change to the directory where you want to run Jupyter Lab  cd $PBS_O_WORKDIR  
# Load the Singularity module (if needed)  
# module load singularity  
# Run Jupyter Lab using Singularity with GPU support  
singularity exec --nv /opt/apps/sif/tensorflow_21.12-tf2-py3.sif jupyter lab --no browser --ip=0.0.0.0 --allow-root &> jupyterlab.log  

Step -4 Save the script by typing
:wq!

Step-5 run command
qstat –aw  

(this command help you to see where your job is running –verify you node )


Step-6 now ssh on job node after verify this. Using command
  ssh –X dgx
or
 ssh –X (node name after verify “qstat –aw” command)  
Step -7 find the “jupytherlab.log” file using command
 ls 
or
 ls –a

Step-8 if Available Now Run Command
tail –f jupyterlab.log

Step-9 There you will find a link started with file:///home

Step 10 Copy this link

Step 11 run command
firefox

Step 12 firefox open automatically , now paste this link in search box and wait for your code.
########################################################
Screen Command -

screen command in Linux provides the ability to launch and use multiple shell sessions from a single ssh session. When a process is started with ‘screen’, the process can be detached from session & then can reattach the session at a later time. When the session is detached, the process that was originally started from the screen is still running and managed by the screen itself. The process can then re-attach the session at a later time, and the terminals are still there, the way it was left. Syntax:

screen [-opts] [cmd [args]]

screen -ls    ( to check screen is created or not)

screen -S   ( to created screen file for save screen status)

Note - after this step run your script job

screen (to create screen ) 

screen -ls (to check)

If job screen on attached mode you need to do this on detached

screen -d   
or you can use
 screen -d 

exit from terminal using exit command must check screen -ls job status detached


exit

########################

If you want to again same screen on terminal

screen -ls 

screen -a 
or u can use
screen -a
Now you can work on the same screen………………….
  • screen: It will start a new window within the screen.

  • screen
  • -S: It will start a new window within the screen and also gives a name to the window. It creates a session which is identified by that name. The name can be used to reattach screen at a later stage.
  • ● screen -S file

  • -ls: It is used to display the currently opened screens including those running in the background. It will list all the attached as well as detached screen sessions.
  • ● screen -ls

  • -d: It is used to detach a screen session so that it can be reattached in future. It can also be done with the help of shortcut key Ctrl-a + d
  • ● screen -d 1643

    Here 1643 is the screen id we want to detach.
  • ●-r: It is used to reattach a screen session which was detached in past.
  • ● screen -r 1643
Note:
  • To check for the manual page of screen command, use the following command:

    man screen

  • To check the help page of screen command, use the following command:

  • screen --hel

  • Central Computting Facilities MANIT Bhopal