Jupyterlab: Clearing Gpu Memory
Jupyterlab: Clearing Gpu Memory
Header
(https://www.nvidia.com/dli)
JupyterLab
For this hands-on lab, we use JupyterLab (https://jupyterlab.readthedocs.io/en/stable/) to manage our
environment. The JupyterLab Interface (https://jupyterlab.readthedocs.io/en/stable/user/interface.html) is a
dashboard that provides access to interactive iPython notebooks, as well as the folder structure of our
environment and a terminal window into the Ubuntu operating system. The first view you'll see includes a
menu bar at the top, a file browser in the left sidebar, and a main work area that is initially open to the
"Launcher" page.
The file browser can be navigated just like any other file explorer. A double click on any of the items will open
a new tab with its content.
The main work area includes tabbed views of open files that can be closed, moved, and edited as needed.
The notebooks, including this one, consist of a series of content and code cells. To execute code in a code
cell, press Shift+Enter or the "Run" button in the menu bar above, while a cell is highlighted. Sometimes,
a content cell will get switched to editing mode. Pressing Shift+Enter will switch it back to a readable
form.
At times you will need to clear the GPUs memory, either to reset the GPU state when an experiment goes
wrong, or, in between notebooks when you need a fresh start for a new set of exercises.
There are 3 primary ways to clear the GPU memory. The first is to use the ⟳ button on the menu directly
above the notebook. Click it now, you should see a prompt asking if it is okay to reset the GPU memory.
The second way is via a code cell that we will be providing for you at the end of each notebook. Below is one
of these cells which you can run just to get into the right habit.
1 of 2 12/07/2021, 04:56 pm
00_jupyterlab about:srcdoc
The final way is with the kernel menu on the left, the dark circle with a light square in it. While the previous
two strategies might be considered a "soft" reset, this is more of a force "hard" stop.
Next
Now that you are familiar with the interactive environment, you will, in the next section, perform the "hello
world" of deep learning, training a neural network to perform image classification on handwritten digits. Please
continue to 01_mnsist.ipynb (./01_mnist.ipynb).
Header
(https://www.nvidia.com/dli)
2 of 2 12/07/2021, 04:56 pm