GPU Compute crashes while rendering but rendered mode works fine
The viewport render is designed to give you an approximation of the scene taking some shortcuts, usually renders using lower samples and using less subdivisions (depending on how the modifiers are set) and ignoring some other features that are only available on the final render. The idea behind this is to give you a more responsive interface.

More on this topic on this link

When you render using F12 you are using a lot more resources. If your scene's complexity exceeds the capabilities of your GPU, the render will fail is that simple.

Memory usage in afterburner might not reflect the real vRAM usage for the scene.

Your options are to simplify your scene (or break in smaller, renderable pieces to be composited together later) or to render using CPU.