  To investigate the evolution of dust in a cosmological volume, we perform
hydrodynamic simulations, in which the enrichment of metals and dust is treated
self-consistently with star formation and stellar feedback. We consider dust
evolution driven by dust production in stellar ejecta, dust destruction by
sputtering, grain growth by accretion and coagulation, and grain disruption by
shattering, and treat small and large grains separately to trace the grain size
distribution. After confirming that our model nicely reproduces the observed
relation between dust-to-gas ratio and metallicity for nearby galaxies, we
concentrate on the dust abundance over the cosmological volume in this paper.
The comoving dust mass density has a peak at redshift $z\sim 1$--2, coincident
with the observationally suggested dustiest epoch in the Universe. {In the
local Universe}, roughly 10 per cent of the dust is contained in the
intergalactic medium (IGM), where only 1/3--1/4 of the dust survives against
dust destruction by sputtering. We also show that the dust mass function is
roughly reproduced at $\lesssim 10^8$ M$_\odot$, while the massive end still
has a discrepancy, which indicates {the necessity of stronger feedback in
massive galaxies}. %%The relation showed that accretion is essential for dusty
galaxies. In addition, our model broadly reproduces the observed radial profile
of dust surface density in the circum-galactic medium (CGM). While our model
satisfies the observational constraints for the dust extinction {on
cosmological scales}, it predicts that the dust in the CGM and IGM is dominated
by large ($> 0.03~\mu$m) grains, which is in tension with the steep reddening
curves {observed} in the CGM.
