An open source tool to assist in the debugging of CUDA applications and teaching about CUDA
MemViewer is an open source application that allows users to take snapshots of the state of memory within a CUDA application both in the host code and in the device code when running in emulation mode. Once these snapshots have been taken, it is possible to both examine them while the program is still executing, and to compare them to other snapshots taken at different times. A screen shot of this can be seen at the bottom of this page.
It is hoped that this can speed up both the checking that the correct data is being loaded from the host to the device, and from the device into shared memory. Further more it is hoped that when the correct data is not being loaded or computed because of an error, this tool will assist in the identification of such bugs.
The tool consists of a static library and a header file that provided a number of functions to the user to both capture and display the contents of the memory. To use this tool the user is just required to include the header file in the file they wish to capture data from, and add a function calls for each piece of data they wish to capture. These calls take a pointer to the piece of memory, and the size in bytes that should be captured.
A version of the matrix multiplication example from the Nvidia SDK is distributed with the tool demonstrating how to use these calls. This example will capture the 48 x 80 matrix that is generated on the host, and the 16 x 16 matrices that are loaded onto shared memory. The different snapshots can then be examined and compared.
The code can be down loaded as binaries for 32bit and 64bit Windows and Linux. As the source is available, this can also be compiled for Mac. The manual for MemVeiwer can be found here.
Information about bugs should be sent to firstname.lastname@example.org