Terminate called after throwing an instance of 'dmlc::Error'

XGBoost 1.2
Python 3.8

When I use XGBoost to train smaller data around 1 million rows it works perfectly. When I use larger data over 10 million rows then I get the following error. The machine has 250GB memory.

terminate called after throwing an instance of 'dmlc::Error'
  what():  [19:39:19] ../src/tree/updater_histmaker.cc:314: fv=inf, hist.last=inf

Are you using distributed training? Also, can you try setting tree_method to hist?

I am not using distributed training.
I set tree_method to hist and that solved the problem.