public virtual async Task DoTaskWork()
        {
            try
            {
                var commandOutput = await _smiExecutor.ExecuteCommandAsync();

                if (_smiExecutor.HasErrored)
                {
                    throw new ArgumentOutOfRangeException("unable to exeute smi program.  commandOutput:  " + commandOutput);
                }

                _smiProcessor.CheckGpuOutput(commandOutput);
            }
            catch (Exception e)
            {
                _logger.LogError(e, "{methodName} {message}", "ExecuteAsync", "uncaught exception in executeAsync loop");
            }
        }
Ejemplo n.º 2
0
        public virtual async Task <bool> IsGpuUnderLoadAsync()
        {
            var commandOutput = await _smiExecutor.ExecuteCommandAsync();

            if (_smiExecutor.HasErrored)
            {
                throw new ArgumentOutOfRangeException("unable to exeute smi program.  commandOutput:  " + commandOutput);
            }

            foreach (var parser in _outputParsers)
            {
                if (parser.IsGpuUnderLoad(commandOutput))
                {
                    return(true);
                }
            }

            return(false);
        }