WASHINGTON — The United States is running out of a rare gas that is crucial for detecting smuggled nuclear weapons materials because one arm of the Energy Department was selling the gas six times as fast as another arm could accumulate it, and the two sides failed to communicate for years, according to a new Congressional audit.

The gas, helium-3, is a byproduct of the nuclear weapons program, but as the number of nuclear weapons has declined, so has the supply of the gas. Yet, as the supply was shrinking, the government was investing more than $200 million to develop detection technology that required helium-3.

As a result, government scientists and contractors are now racing to find or develop a new detection technology.

According to the Government Accountability Office report, the Energy Department’s National Nuclear Security Administration, which gathers the gas from old nuclear weapons, never told the department’s Isotope Program about the slowing rate of helium-3 production. That is in part because it was secret information that could be used to calculate the size of weapon stockpiles.