DAIM-Guide/Python

From HPC
Revision as of 14:35, 2 July 2025 by Chris.collins (talk | contribs) (Created page with "= DAIM == Installing Packages == <pre> !conda install -y python_package </pre> == Checking for GPU Access == Even if you have requested a Jupyter session on one of the GP...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation , search

= DAIM


Installing Packages

!conda install -y python_package


Checking for GPU Access

Even if you have requested a Jupyter session on one of the GPU resources, it is important to check that you actually have GPU access for your notebook when first setting up your workflow. You can do this as follows:

With Torch:

>>> import torch
>>> torch.cuda.is_available()
True

If this reports 'False' then Torch cannot find a valid GPU device. Or with Tensorflow:

>>> import tensorflow as tf
>>> tf.config.list_physical_devices('GPU')
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]