DMatrix OOM with sparse Pandas DataFrame

I want to do training on a sparse matrix.

If I create a DMatrix directly out of a sparse scipy matrix, then it works fine.

However, if I convert the scipy matrix to a sparse pandas dataframe (pd.DataFrame.sparse.from_spmatrix) and then create a DMatrix out of the DataFrame, this uses up a ton of RAM and ultimately OOMs.

Any help would be appreciated!

Full reproduction: