nzinfo / gpuocelot

Automatically exported from code.google.com/p/gpuocelot
0 stars 0 forks source link

Detect Global Memory Access Violations #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the New Feature:
Instrument all LD/ST/TEX instructions to verify that there is a valid
device memory region allocated before doing the access.

Which milestone does the feature belong to?
0.5.0

Which branch does the new feature go in?
Trunk

Original issue reported on code.google.com by gregory....@gatech.edu on 9 Jul 2009 at 8:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Added a hook from the executive class to the emulated kernel class.  This 
allows the
emulated kernel to inspect all registered memory allocations.  Added checks to 
all
global memory accesses to determine whether an access falls within an allocated
region.  Throws an exception if the area has not been allocated.

Most of the SDK examples pass with this modification.  However, some do not.  I 
need
to add better debugging information and step through these examples to 
determine if
they are really memory violations, or if there is some problem with not all 
allocated
regions appearing in the allocation table.  A big problem here could be regions 
that
are mapped from OpenGL buffers...

Original comment by gregory....@gatech.edu on 10 Jul 2009 at 3:11

GoogleCodeExporter commented 9 years ago
Made the following changes:

1) Added hooks into openGL buffers to register sizes as well as the base of the 
buffer.  

2) Added debugging messages that show the nearby regions to an access that does 
not
fall within any mapped region.

3) Added macro to disable memory checking if required to avoid any performance 
overhead.

4) Added tracking of statically allocated global variables as well as regions 
created
via device memory allocation (cudaMalloc).

This should fix this issue...

Original comment by gregory....@gatech.edu on 11 Jul 2009 at 9:35