GPU coherence problem

Does GPU has the coherence protocol which like CPU use Directory or Snooping ?

How to guarantee the coherence for different SMs use same variable If GPU hasn’t coherence protocol?

L1 caches on a GPU are not in any way guaranteed to be coherent with each other, and there is no coherence mechanism to make it so.

A simple mechanism to “guarantee coherence” is to avoid use of the L1. This can be done in a variety of ways. This topic is covered extensively in other questions on the web. Here is a recent one.

https://devtalk.nvidia.com/default/topic/1063246/cuda-programming-and-performance/gpu-cache-coherence-problem/

Note that some GPUs have L1 disabled by default for global loads anyway, including certain kepler and maxwell variants.

https://docs.nvidia.com/cuda/maxwell-tuning-guide/index.html#l1-cache