BUDAPEST, Hungary -- Formula One champion Lewis Hamilton again showed his speed in topping both practices at the Hungarian Grand Prix on Friday.

Daniel Ricciardo's promising session for Red Bull ended with engine trouble, however.

In a largely encouraging afternoon for Red Bull, Daniil Kvyat posted the second quickest time ahead of Ricciardo, who went off the track with smoke billowing from his car with about 20 minutes remaining, bringing out the red flag for the third time on the day.

It came out twice in the morning practice, first when Sergio Perez emerged unscathed from a crash and when veteran Finnish driver Kimi Raikkonen lost his Ferrari front wing.

Sebastian Vettel twice lost control of his Ferrari in spinouts, but managed seventh best.

Hamilton's led Kvyat by .351 seconds, and Ricciardo, the winner here last year, by .502.

With the sun beating down in searing early afternoon heat, some drivers struggled for control. Marcus Ericsson lamented that his Sauber car was "sliding everywhere," and Romain Grosjean also lost control of his Lotus.

Nico Rosberg, who has never secured a podium finish in Hungary, set the early pace but finished .719 behind Mercedes teammate Hamilton in fourth.

Many drivers wore tributes to Jules Bianchi, with race stickers such as "Ciao Jules" or "JB 17" on their helmets. Bianchi died last Friday from injuries sustained last October in a crash at the Japanese GP.

F1 tire supplier Pirelli tweeted "sarai sempre con noi" (you will always be with us) in honour of the French driver, who died at the age of 25, and was buried on Tuesday in his hometown of Nice.

Grosjean, a close friend of Bianchi's, had "JB" and "Never Forget" engraved on his helmet.

There was a major scare when the red flag came out one hour into P1 as Perez flipped his Force India car on Turn 11, with the rear skidding out from under him and sending him into the barriers, and the car then toppling slowly over. Force India blamed it on a suspension problem.

Fears for Perez's safety were quickly eased as he waved to fans at the Hungaroring on his walk to the medical centre for a mandatory check.

"Thumbs up, a big relief," his Force India team tweeted.

Force India decided not to start either Perez or Nico Hulkenberg in the afternoon practice because the team was investigating the suspension problem.

"Sergio's car suffered significant damage to the bodywork, wings, and floor, and repairs are ongoing," the team said in a statement. "The team will work hard to fully understand the cause of the failure and find a resolution in order to be ready for Saturday's (third) practice session."

The track temperature was 59 degrees C (138 degrees F), the hottest in F1 in two years, according to Pirelli. But that was little deterrent to Hamilton, who loves racing on the tight and sinewy 4.4-kilometre (3-mile) Hungaroring, winning four times.

The two-time F1 champion needed little time to shoot up the morning leaderboard, and then went even faster, finishing .109 seconds quicker than Rosberg, and .671 ahead of Ferrari driver Kimi Raikkonen.

Overall, Hamilton leads Rosberg by 17 points, and Vettel of Ferrari by 59.