|
|
|
@ -122,20 +122,27 @@ public class HardwareCapabilitiesFactory : IHardwareCapabilitiesFactory |
|
|
|
return string.Empty; |
|
|
|
return string.Empty; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Option<List<CudaDevice>> maybeDevices = CudaHelper.GetDevices(); |
|
|
|
try |
|
|
|
foreach (List<CudaDevice> devices in maybeDevices.Where(list => list.Count > 0)) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
var sb = new StringBuilder(); |
|
|
|
Option<List<CudaDevice>> maybeDevices = CudaHelper.GetDevices(); |
|
|
|
foreach (CudaDevice device in devices) |
|
|
|
foreach (List<CudaDevice> devices in maybeDevices.Where(list => list.Count > 0)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
sb.AppendLine( |
|
|
|
var sb = new StringBuilder(); |
|
|
|
CultureInfo.InvariantCulture, |
|
|
|
foreach (CudaDevice device in devices) |
|
|
|
$"GPU #{device.Handle} < {device.Model} > has Compute SM {device.Version.Major}.{device.Version.Minor}"); |
|
|
|
{ |
|
|
|
|
|
|
|
sb.AppendLine( |
|
|
|
|
|
|
|
CultureInfo.InvariantCulture, |
|
|
|
|
|
|
|
$"GPU #{device.Handle} < {device.Model} > has Compute SM {device.Version.Major}.{device.Version.Minor}"); |
|
|
|
|
|
|
|
|
|
|
|
sb.AppendLine(CudaHelper.GetDeviceDetails(device)); |
|
|
|
sb.AppendLine(CudaHelper.GetDeviceDetails(device)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return sb.ToString(); |
|
|
|
return sb.ToString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (FileNotFoundException) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// do nothing
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// if we don't have a list of cuda devices, fall back to ffmpeg check
|
|
|
|
// if we don't have a list of cuda devices, fall back to ffmpeg check
|
|
|
|
@ -522,17 +529,24 @@ public class HardwareCapabilitiesFactory : IHardwareCapabilitiesFactory |
|
|
|
return new NvidiaHardwareCapabilities(cudaDevice, ffmpegCapabilities, _logger); |
|
|
|
return new NvidiaHardwareCapabilities(cudaDevice, ffmpegCapabilities, _logger); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Option<List<CudaDevice>> maybeDevices = CudaHelper.GetDevices(); |
|
|
|
try |
|
|
|
foreach (CudaDevice firstDevice in maybeDevices.Map(list => list.HeadOrNone())) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger.LogDebug( |
|
|
|
Option<List<CudaDevice>> maybeDevices = CudaHelper.GetDevices(); |
|
|
|
"Detected NVIDIA GPU model {Model} architecture SM {Major}.{Minor}", |
|
|
|
foreach (CudaDevice firstDevice in maybeDevices.Map(list => list.HeadOrNone())) |
|
|
|
firstDevice.Model, |
|
|
|
{ |
|
|
|
firstDevice.Version.Major, |
|
|
|
_logger.LogDebug( |
|
|
|
firstDevice.Version.Minor); |
|
|
|
"Detected NVIDIA GPU model {Model} architecture SM {Major}.{Minor}", |
|
|
|
|
|
|
|
firstDevice.Model, |
|
|
|
_memoryCache.Set(CudaDeviceKey, firstDevice); |
|
|
|
firstDevice.Version.Major, |
|
|
|
return new NvidiaHardwareCapabilities(firstDevice, ffmpegCapabilities, _logger); |
|
|
|
firstDevice.Version.Minor); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_memoryCache.Set(CudaDeviceKey, firstDevice); |
|
|
|
|
|
|
|
return new NvidiaHardwareCapabilities(firstDevice, ffmpegCapabilities, _logger); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (FileNotFoundException) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// do nothing
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_logger.LogWarning( |
|
|
|
_logger.LogWarning( |
|
|
|
|