| MIL 10 Board Specific Notes
| Customize Help

Optimizing performance with the Matrox GPU driver



See also
Next

Time consuming processing operations, relating to preprocessing and formatting of data, can be done by the GPU of your display board.

Improving performance

There are several ways to improve the overall performance of your applications using the Matrox GPU driver. Understanding how MIL fully takes advantage of your display board can help you develop optimized applications.

  • Update your graphics drivers. For best results, keep your display board's drivers up to date. For more information, refer to your display board manufacturer's website.

  • Avoid mixing GPU and Host functions. Try to avoid mixing functions that will be executed on the GPU, and functions that will be compensated by the Host. This will minimize data transfers between display memory and Host memory.

  • Avoid in-place processing. The cost of doing in-place processing, including two child buffers sharing the same ancestor buffer, is very high. The entire ancestor buffer has to be cloned. Therefore, try to avoid using the same ancestor buffer as a source and destination in the same function call.

  • Optimize your monochrome buffers. Monochrome buffers will clear, copy, and transfer faster if their X-offset and X-size are multiples of 4. Packed, color BGR buffers (that is, buffers allocated as M_BGR32) are fully optimized for all sizes and offsets; there is no limitation on the size or offset of the buffer.

Using the Matrox GPU driver efficiently

The most efficient way to use the Matrox GPU driver is as follows:

  • Allocate a MIL GPU system, using MsysAlloc() with M_SYSTEM_GPU.

  • Allocate a buffer in display memory (using MbufAlloc...() with the MIL GPU system's identifier and M_VIDEO_MEMORY).

  • Process the buffer on-board.

  • If further processing is required and that processing is only available on the Host, copy the on-board buffer to a Host buffer.

  • Process the Host buffer (if necessary).

The maximum buffer size supported is determined by the capabilities of your GPU, which varies between display boards. Newer GPUs tend to support larger buffers.

Clearing, copying, and transferring buffers

When processing a buffer stored in display memory, the source and destination buffers must be of the same depth and color format. There are, however, exceptions.

For MbufCopy(), and MbufTransfer() with TransferFunction set to M_COPY, the following non-equivalent source and destination formats are supported:

Source data depth and color

Destination data depth and color

Monochrome 8-bit

Monochrome 16-bit

Monochrome 8-bit

M_BGR32 packed

Monochrome 16-bit

Monochrome 8-bit

For MbufTransfer() with M_COMPOSITION, only the following formats are supported:

Source data depth and color

Destination data depth and color

Monochrome 8-bit

Monochrome 16-bit

Monochrome 8-bit

M_BGR32 packed