Difference between revisions of "DAIM-Guide/Python"

From HPC
Jump to: navigation , search
(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...")
(No difference)

Revision as of 14:35, 2 July 2025

= 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')]