A new round of racist incidents made public has forced the N.H.L. to confront its culture while the sport’s popularity — especially among diverse youth — continues to dive.

Credit...Jeff Mcintosh/CP, via Associated Press

Akim Aliu figures he was 12 or 13 years old the first time he heard a racial slur directed toward him at a hockey rink.

“It starts really early,” he said. “With parents I had a couple of incidents where people would yell racial swears while I was playing. I was old enough to understand exactly what was being said.”

Insults would soon come from opponents and opposing fans.

“You notice really quickly that you stand out when you’re a minority player,” said Aliu, a Nigerian-Ukrainian who went on to become a second-round selection of the Chicago Blackhawks in the 2007 N.H.L. draft.

In early December, over a dozen years after those incidents in his youth career and eight days after he accused Calgary Flames Coach Bill Peters of using a racial slur toward him in 2009, Aliu exited a meeting with N.H.L. Commissioner Gary Bettman in Toronto and said he thought there “was some big change coming.”

A few days later, Bettman unveiled the latest step the sport will take to ensure it addresses notable recent revelations of racial and verbal abuse. At the N.H.L.’s Board of Governors meetings in Pebble Beach, Calif., the commissioner announced that all N.H.L. coaches and personnel would participate in a mandatory annual program on diversity and inclusion.

“This is an opportunity, and a moment, for positive change and this evolution should be expedited — for the benefit of everyone associated with the game we love,” Bettman said in a statement. “And even while change is taking effect, we still must acknowledge things that were wrong in the past.”

The effort comes during a fractious season in the N.H.L. that has so far been roiled by examples of public displays of racism and allegations of abuse. Two months into this season, the “Hockey Night in Canada” broadcaster Don Cherry was fired over xenophobic comments, which attacked the patriotism of the country’s immigrants. In an interview with The Wall Street Journal, Aliu revealed that in 2011 the equipment manager of the Colorado Eagles, the East Coast Hockey League he was with at the time, wore blackface and dressed in Aliu’s jersey at a team Halloween party. The manager, Tony Deynzer, was placed on administrative leave by the team last week. Peters resigned as the Flames’ coach days after Aliu made his accusation about him on Twitter.

This is not the N.H.L.’s first effort at confronting its homogeneous culture. In 2017, the league launched its “Hockey Is for Everyone” initiative, a campaign rolled out each February which aims to make the sport more inclusive, generally. Ahead of the 2016 Winter Classic at Gillette Stadium in Foxborough, Mass., the N.H.L. teamed with the Ross Initiative in Sports for Equality, or RISE, to combat racism. RISE, a nonprofit group founded by Stephen M. Ross, the Miami Dolphins owner, drew criticism after Ross held a re-election fund-raiser for President Trump in August.

Those efforts came a year after P.K. Subban, who is black, had a water bottle thrown at him on the ice and was bombarded by racist threats on social media after he scored an overtime goal for the Montreal Canadiens to beat the Boston Bruins in Game 1 of the 2014 Eastern Conference semifinals. In 2012, Washington Capitals defenseman Joel Ward, who is black, had a racist epithet repeated to him when he scored a goal to knock Boston out of those N.H.L. playoffs.

Bettman’s latest initiative comes at a time when the sport is grappling with both its culture and a decline in popularity in Canada, the country of its birth.

At all levels, concerns about ice hockey’s head injuries, scant diversity and costs are rankling parents and prospective players, and Canadians are now investing their time and money in other sports. Demographic and socioeconomic trends in the country and the sport suggest a reversal to the decline is not coming.

That shift came into focus over the summer.

A million people in Toronto celebrated Canada’s first N.B.A. championship at the Raptors’ victory parade, drawn to how the team’s racial, cultural and socioeconomic diversity reflected the country as a whole. Two months later, 7.4 million Canadians watched on TV as Bianca Andreescu defeated Serena Williams to win the United States Open and become Canada’s first Grand Slam singles champion in tennis.

In this N.H.L. season, the Canadiens are on a pace to record their lowest attendance in more than 15 seasons; the Ottawa Senators are selling just 60 percent of their tickets; and the Flames, the Edmonton Oilers and the Winnipeg Jets frequently play in front of hundreds of empty seats. Only the Toronto Maple Leafs and the Vancouver Canucks have seen attendance increases this season. (Not unrelated: A Canadian team has not won the Stanley Cup since 1993.)

At the N.H.L. draft in June, only 69 of the 217 selected players, or 32 percent, were Canadian, the lowest total since the league expanded the event in 1969. Last season, the percentage of N.H.L. players who were Canadian was 43 percent, down from 59.6 percent in 2011-12. The N.H.L. continues to be almost exclusively white: Of the 999 players who played in at least one game last season, 5 percent were members of minority groups. According to Statistics Canada, 22.3 percent of the country’s population in 2016 were people of color.

Even though more than 500,000 boys registered for minor hockey last year, enrollment in the Ontario Hockey Federation, the largest minor hockey league in the country, has dropped 8.5 percent since the 2012-13 season. Hockey Québec, the second largest league, has seen a decrease of 6.7 percent over that same span. According to Statistics Canada, the populations of both provinces increased over that same period.

Many new Canadians do not take up hockey. According to a 2014 report by the Institute for Canadian Citizenship, just 2 percent of immigrants played ice hockey within their first three years of living in the country. To Canadian newcomers, sports like tennis (15 percent), basketball (10 percent) and skiing (12 percent) have been significantly more appealing. Most of the top Canadian tennis players, including Andreescu, are immigrants or children of immigrants.

The city of Toronto considered the changing sports demographics when it recently announced a 20-year plan to expand its recreation facilities that would create 45 new soccer and multiuse fields, 30 outdoor basketball courts and five cricket pitches by 2038. The recommendations included just one indoor ice hockey facility and five artificial ice rinks.

“Newcomers to Canada are increasingly calling Toronto home and more than 50 percent of our population was born outside of the country,” the city said in a statement. “People wish to play the sports that they are most familiar with and our plan responds to the diverse cultural needs of our residents.”

Wayne Simmonds of the Devils, one of 50 players of color who suited up in the N.H.L. last season, grew up in Scarborough, a section of Toronto where 60 percent of residents were first-generation immigrants and the median household income was roughly $63,000 in 2015, according to city data.

“I think that if you get a lot of kids of other ethnicities playing hockey, they’ll become stars,” Simmonds said. “And I think that would relate to a lot of the population, and that’s where you see the growth.”