diff --git a/python/paddle/fluid/optimizer.py b/python/paddle/fluid/optimizer.py
index 24ffe8b4ae480db6176a9bb4e7ce813b45cd2dd1..d9c2cb702f60e235f93155f1735418c71f89e5ba 100644
--- a/python/paddle/fluid/optimizer.py
+++ b/python/paddle/fluid/optimizer.py
@@ -1084,6 +1084,10 @@ class DGCMomentumOptimizer(Optimizer):
                  name=None):
         if framework.in_dygraph_mode():
             raise Exception("In dygraph, don't support DGCMomentumOptimizer.")
+
+        assert core.is_compiled_with_cuda(), \
+            "Paddle is not compiled with CUDA. DGC is only support GPU for now."
+
         assert learning_rate is not None
         assert momentum is not None
         super(DGCMomentumOptimizer, self).__init__(
diff --git a/tools/sampcd_processor.py b/tools/sampcd_processor.py
index 82002495e1b92c08a698ac976e5568cf31e2fa78..f089e424bb88f5e2aa558c5875538ba4702d9bf1 100644
--- a/tools/sampcd_processor.py
+++ b/tools/sampcd_processor.py
@@ -601,12 +601,13 @@ wlist_ignore = [
     'PRelu.forward', 'Recall.update', 'start_gperf_profiler',
     'TreeConv.forward', 'Conv2D.forward', 'Switch.default', 'elementwise_mod',
     'Precision.update', 'WeightedAverage.eval', 'Conv3D.forward',
-    'Embedding.forward', 'Recall.eval', 'FC.forward', 'While.block'
+    'Embedding.forward', 'Recall.eval', 'FC.forward', 'While.block',
+    'DGCMomentumOptimizer'
 ]
 # only white on CPU
 gpu_not_white = [
     "deformable_conv", "cuda_places", "CUDAPinnedPlace", "CUDAPlace",
-    "cuda_profiler"
+    "cuda_profiler", 'DGCMomentumOptimizer'
 ]
 wlist = wlist_temp + wlist_inneed + wlist_ignore