Grid size and number of SM

If the grid size (the number of thread blocks) in a CUDA kernel is less than the number of streaming multiprocessors (SMs) on the GPU, will some SMs remain idle?

yes.