dpctl.utils

dpctl.utils.onetrace_enabled()[source]

Enable onetrace collection for kernels executed in this context.

Note

Proper working of this utility assumes that Python interpreter has been launched by onetrace or unitrace tool from project intel/pti-gpu.

Example:

Launch the Python interpreter using onetrace tool:

$ onetrace --conditional-collection -v -t --demangle python app.py

Now using the context manager in the Python sessions enables data collection and its output for every offloaded kernel:

import use_kernel as eg

import dpctl.memory as dpmem
from dpctl.utils import onetrace_enabled

x_dev = dpmem.MemoryUSMDevice(1024)

# onetrace output reporting on execution of the kernel
# should be seen, starting with "Device Timeline"
with onetrace_enabled():
    eg.run_kernel(x_dev)
dpctl.utils.intel_device_info(sycl_device)[source]

For Intel(R) GPU devices returns a dictionary with device architectural details, and an empty dictionary otherwise. The dictionary contains the following keys:

device_id:

32-bits device PCI identifier

gpu_eu_count:

Total number of execution units

gpu_hw_threads_per_eu:

Number of thread contexts in EU

gpu_eu_simd_width:

Physical SIMD width of EU

gpu_slices:

Total number of slices

gpu_subslices_per_slice:

Number of sub-slices per slice

gpu_eu_count_per_subslice:

Number of EUs in subslice

max_mem_bandwidth:

Maximum memory bandwidth in bytes/second

free_memory:

Global memory available on the device in units of bytes

Unsupported descriptors are omitted from the dictionary.

Descriptors other than the PCI identifier are supported only for SyclDevices with Level-Zero backend.

Note

Environment variable ZES_ENABLE_SYSMAN may need to be set to 1 for the "free_memory" key to be reported.