Nvidia : driver crash with compute shader

Hi, I’m trying to use compute shader for raytracing.
void main() {
vec4 pixel = vec4(1.0, 0.0, 0.0, 1.0);
ivec2 pixel_coords = ivec2(gl_GlobalInvocationID.xy);
Ray ray;
float max_x = resolution.x * 0.5;
float max_y = resolution.y * 0.5;
ivec2 dims = imageSize(img_output);
float x = (float(pixel_coords.x * 2 - dims.x) / dims.x);
float y = (float(pixel_coords.y * 2 - dims.y) / dims.y);
ray.origin = vec3(x * max_x, y * max_y, 0.0);
ray.dir = vec3(0, 0, -10);
int count = 0;
Pixel depthPixels[MAX_FRAGMENTS];
Pixel currentPixel;
for (uint i = 0; i < nbTriangles; i++) {
for (uint j = 0; j < 3; j++) {
triangles[i].position[j] = (projMatrix * viewMatrix * triangles[i].transform * vec4(triangles[i].position[j], 1)).xyz;
}
vec3 intersection;
if (intersects(ray, triangles[i], intersection)) {
currentPixel = interpolate(triangles[i], pixel_coords);
//vec4 shadowLightColor = computeLightAndShadow (currentPixel, triangles[i].normal, i);
vec4 reflectRefractColor=vec4(1, 1, 1, 1);
/if (triangles[i].refractReflect == 1) {
reflectRefractColor = castReflectionRay(currentPixel, i);
}
if (triangles[i].refractReflect == 2) {
reflectRefractColor = castRefractionRay(currentPixel, i);
}
if (triangles[i].refractReflect == 3) {
vec4 reflectColor = castReflectionRay(currentPixel, i);
vec4 refractColor = castRefractionRay(currentPixel, i);
reflectRefractColor = reflectColor * refractColor;
}
/
currentPixel.color = currentPixel.color * reflectRefractColor /** shadowLightColor*/;
depthPixels[count] = currentPixel;
if (count < MAX_FRAGMENTS)
count++;
}
}
vec4 color = blendAlpha (depthPixels, count);
imageStore(img_output, pixel_coords, currentPixel.color);
}
The driver crash here :
depthPixels[count] = currentPixel;
when count is > 0
Her is what the debuger shows :