# GPU Mode Command Line Initialization

There are several command line arguments that can be used with the ViDi GUI on startup for library initialization. The commands are issued using Windows Command Prompt, and navigating to the %ProgramFiles%\Cognex\ViDi Suite\3.3 directory. You issue the commands by first specifying the name of the application ("ViDi Suite GUI" or "ViDi Suite Service.exe" if using the ViDi Client/Server Functionality), followed by the command line arguments.

The following command line arguments can be used to control the GPU Mode, which GPU device to use and the allocation of GPU memory:

Command | Description
--- | ---
--gpu-mode=NoSupport or SingleDevicePerTool or MultipleDevicesPerTool | Specifies the GPU mode to be used by the application.
SingleDevicePerTool | A single GPU is used for the analysis of the tool. When using multiple GPUs, the processing time of a single image remains the same, but multiple images can be processed concurrently on different devices.
MultipleDevicesPerTool | For use with the Red Analyze tool, this mode offers the potential of speed increases (in terms of single-image processing latency). Image analysis will be split among multiple GPUs. Note: If you will be using this mode, consider the following: For multiple GPUs, the following should be the same for all of the GPUs: GPU model GPU memory GPU driver mode If the workspace contains tools other than a Red Analyze tool, their performance may be affected, slowing down their performance. The MultipleDevicesPerTool mode may be slower for the Red Analyze tool when used with smaller images and larger feature sizes.
NoSupport | Specifies that a GPU will not be used. Note: This option conflicts with --gpu-devices and/or --optimized-gpu-memory.
Note: See the Multithreading topic for more information about the GPU modes.
--gpu-devices=comma separated indexed list of GPUs | Specifies the GPUs that will be used on initialization, via an indexed list. For example: --gpu-devices=0,1
--optimized-gpu-memory=memory size, in MB | Specifies the size of the pre-allocated optimized memory buffer. This setting is activated by default, with the default size of ⅔ the available amount of GPU memory. To deactivate the feature, first issue the --optimized-gpu-memory-override=1 command, and then --optimized-gpu-memory=0 command. To use a memory buffer size other than the default setting, first issue the --optimized-gpu-memory-override=1 command, and then the --optimized-gpu-memory=<memory size in MB> command. Note: The GPU Memory Optimization setting is enabled by default. For more information about the functionality, see the GPU Memory Optimization topic.
--optimized-gpu-memory-override=[0 or 1] | If using the --optimized-gpu-memory setting, set to 1. If set to 0, the default amount of memory will be allocated.