mltk.utils.gpu

GPU utilities

See the source code on Github: mltk/utils/gpu.py

Functions

check_tensorflow_cuda_compatibility_error(...)

deinitialize([force])

De-initialize the GPU

disable()

Disable the GPU from being used by Tensorflow

get_tensorflow_version_with_cudnn_version(...)

initialize([logger])

Initialize the GPU for usage with Tensorflow

class TensorflowCudaVersions
__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

__match_args__ = ('tensorflow', 'cudnn', 'cuda', 'python_min', 'python_max')
__module__ = 'mltk.utils.gpu'
static __new__(_cls, tensorflow, cudnn, cuda, python_min, python_max)

Create new instance of TensorflowCudaVersions(tensorflow, cudnn, cuda, python_min, python_max)

__repr__()

Return a nicely formatted representation string

__slots__ = ()
cuda

Alias for field number 2

cudnn

Alias for field number 1

python_max

Alias for field number 4

python_min

Alias for field number 3

tensorflow

Alias for field number 0

disable()[source]

Disable the GPU from being used by Tensorflow

initialize(logger=None)[source]

Initialize the GPU for usage with Tensorflow

NOTE: The deinitialize() API will automatically be called when the script exits

deinitialize(force=False)[source]

De-initialize the GPU

NOTE: This is automatically called when the script exits

get_tensorflow_version_with_cudnn_version(cudnn_ver)[source]
Return type:

TensorflowCudaVersions

Parameters:

cudnn_ver (str) –

check_tensorflow_cuda_compatibility_error(log_file_path)[source]
Return type:

str

Parameters:

log_file_path (str) –