Golfsmith International, America’s largest specialty golf retailer, struggling under a pile of debt, appears to have failed in an attempt to sell itself and could be forced to file for bankruptcy within days, The Post has learned.

The retailer, which is also battling an overall downturn in sales of golf equipment, could end up in the arms of Dick’s Sporting Goods if it files for Chapter 11 protection, sources said.

Dick’s puts a great emphasis on golf equipment sales.

Private equity investor Ontario Municipal Employees Retirement System owns Golfsmith and shanked the 2012 investment by acquiring it in a $97 million leveraged buyout, which put the company in deep debt at the same time interest in golf waned.

OMERS combined Canada golf retailer Golf Town with Golfsmith, and now the company’s stores are almost evenly split between US and Canada.

“There’s just too much debt,” a source said, adding that the company would be profitable if it did not have interest payments on roughly $200 million in loans.

OMERS recently decided not to invest more capital to save Golfsmith, a source close to the situation said.

Golfsmith owns more than 150 stores, including two in Manhattan — at 420 Fifth Ave. and 641 Lexington Ave.

The Austin, Texas-based chain is caught in the middle of a downdraft in the sport: Roughly 6 million people, or 20 percent of those who regularly play golf, have walked away since 2000.

Nike last month said it was exiting the golf hardware business, its worst-performing division.

Golfsmith declined comment.

OMERS and Dick’s Sporting Goods did not return calls seeking comment.