In a large skillet, heat the olive oil and butter over medium heat until melted and bubbling.
Add the thinly sliced onions to the skillet. Sauté for about 10 minutes, stirring occasionally, until the onions begin to soften and turn translucent.
Once softened, sprinkle the granulated sugar over the onions and continue cooking for an additional 15-20 minutes, stirring frequently. Cook until the onions are deeply caramelized, rich in color, and meltingly soft. Once done, remove the skillet from the heat and allow the onions to cool slightly.
In a mixing bowl, combine the softened cream cheese, sour cream, and mayonnaise. Mix well until the mixture is creamy and smooth.
Season the creamy mixture with garlic powder, salt, and freshly ground black pepper. Stir until evenly combined.
Gently fold in the caramelized onions along with half of the shredded Gruyere cheese, blending until well mixed.
Transfer the creamy onion mixture into an oven-safe baking dish, smoothing out the top evenly, and sprinkle the remaining shredded Gruyere cheese generously over the surface.
Preheat your oven to 350°F (175°C). Once heated, bake the dip for 25-30 minutes, or until it is hot, bubbly, and the cheese on top is golden brown and slightly crispy.
After baking, remove the dish from the oven and let it cool for a few minutes to set before serving.
Notes
Serve warm with toasted baguette slices or pita chips.