diff --git a/CMakeLists.txt b/CMakeLists.txt
index 522820daf7c6aa3d7e906b34dc57837124348338..348ad4ac27dc1a8294201591288660e23a363595 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -183,9 +183,9 @@ if( ${WITH_CUDA} )
         endif()
         set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ;-DHAVE_CUDA)
         # disable false compiler warnings
-        #   reference for the -Xcudafe flag: http://stackoverflow.com/questions/14831051/how-to-disable-compiler-warnings-with-nvcc/17095910#17095910
-        #   list of possible tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg
-        set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function\"")
+        #   reference for the -Xcudafe --diag_suppress and --display_error_number flags: https://stackoverflow.com/a/54142937
+        #   incomplete list of tokens: http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg
+        set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ; -Wno-deprecated-gpu-targets --expt-relaxed-constexpr --expt-extended-lambda -Xcudafe "\"--diag_suppress=code_is_unreachable --diag_suppress=implicit_return_from_non_void_function --diag_suppress=2906 --display_error_number\"")
         set( ALL_CUDA_ARCHS -gencode arch=compute_20,code=sm_20
                             -gencode arch=compute_30,code=sm_30
                             -gencode arch=compute_32,code=sm_32 
diff --git a/src/UnitTests/AssertCudaTest.cu b/src/UnitTests/AssertCudaTest.cu
index 2aa9705c5aa8319aee7ce5ee12c9bd6a26d857f0..cfd4e846b718edf2481e49cec45023a7ef757a81 100644
--- a/src/UnitTests/AssertCudaTest.cu
+++ b/src/UnitTests/AssertCudaTest.cu
@@ -23,6 +23,10 @@ using namespace TNL;
 
 #ifdef HAVE_CUDA
 
+// ignore useless nvcc warning: https://stackoverflow.com/a/49997636
+#pragma push
+#pragma diag_suppress = declared_but_not_referenced
+
 #define WRAP_ASSERT( suffix, statement, not_failing )             \
 __global__                                                        \
 void kernel_##suffix( int* output )                               \
@@ -99,6 +103,8 @@ WRAP_ASSERT( test26, TNL_ASSERT_LT( ten, 2, "ten < 2" );, false );
 WRAP_ASSERT( test27, TNL_ASSERT_TRUE( data_null, "nullptr is true" );, false );
 WRAP_ASSERT( test28, TNL_ASSERT_FALSE( data_full, "non-nullptr is false" );, false );
 
+#pragma pop
+
 #endif
 #endif