European Union leaders have met for the first time since the Western troop withdrawal from Afghanistan and France's loss of a multibillion-dollar submarine deal with Australia, events they argue have exposed Europe's need for more autonomy on defence.

With the 27-nation trade bloc's tense relationship with China and rising energy prices also on the agenda, leaders had much to discuss at their dinner at Brdo Castle in Slovenia on Tuesday. A summit with leaders from neighbouring Balkans countries is scheduled for Wednesday.

The informal talks were intended to prepare the ground for an EU summit later this month in Brussels and a March meeting focusing on European defence.

According to an EU official with direct knowledge of discussions, the dinner focused on the role of the European Union on the international scene in light of recent geopolitical developments, including the situation in Afghanistan and the AUKUS submarine deal. The official spoke anonymously in accordance with EU practice.

French President Emmanuel Macron, who has for years pushed for a greater strategic autonomy for the bloc, was set to plead for a reinforced and enhanced EU role in the region during the dinner discussions on the Indo-Pacific defence deal between the US, Australia and Britain that led Australia to cancel the contract for diesel-electric French submarines.

Australia is acquiring US nuclear-powered vessels instead of the French submarines. The Australian government's move has infuriated France, which is seeking clarification from Washington about its commitment to European allies. Several EU member countries have expressed solidarity with France.

Mr Macron and US president Joe Biden have discussed the rift over the phone to ease tensions, and US Secretary of State Antony Blinken met with Mr Macron in Paris on Tuesday to try to restore the French government's trust.

The chief of the EU's executive branch, European Commission President Ursula von der Leyen spoke with Mr Biden by phone on the eve of the summit. Ms Von der Leyen said they discussed climate change, defence, trade, the western Balkans and other geopolitical issues.

Mr Macron is now calling on France's EU allies to use the bloc's shortcomings in Afghanistan and the fallout of AUKUS as a springboard for developing European capabilities while at the same time strengthening ties with the US.

"On the technological and industrial, economic, financial, but also military levels, we must build the terms of a stronger Europe," Mr Macron said.

"You know that this is what I deeply believe. A Europe that can take its share (of responsibilities) for itself and which can choose its partners and work closely with its historical allies. And I think it's important that we can discuss this tonight in a geopolitical context that is increasingly in turmoil."