Utilizing GPU for accelerated processing#
ImageSdk and Cuda#
ImageSdk can employ graphics cards (GPU) to improve processing speed, typically achieving a performance increase of seven to ten times compared to CPU execution. To enable GPU acceleration, switch the architecture to Cuda.
P1::ImageSdk::SetArchitecture(Cuda)
P1.ImageSdk.Sdk.SetArchitecture(Sdk.Architecture.Cuda);
Cuda compatibility#
ImageSdk is compatible with all GPU models, including those in workstations, laptops, and Jetson cards with minimum requirement:
Compute capability 7.5
Memory 8 GB
You can check if ImageSDK can use Cuda with below function
std::string message;
bool supported = P1::ImageSdk::IsCudaSupported(message)
if(!supported) printf("%s\n", message.c_str());
string message;
bool supported = P1.ImageSdk.Sdk.IsCudaSupported(out message);
if(!supported) Console.WriteLine(message);
Note
ImageSdk requires the most recent version of NVIDIA display driver. Please verify your display driver, as Windows Update may provide a compatible version rather than the latest one. To ensure you have the most up-to-date version, download and install it from the official source at https://www.nvidia.com/en-us/drivers/
Note
ImageSDK prioritizes CUDA architecture, but if no compatible GPU is detected, it automatically defaults to CPU.
Manage Cuda devices#
ImageSDK currently does not support GPU switch and will use the default one.