How can I specify which GPU glium will use?

66 views Asked by At

I am trying the gl-interop example from https://github.com/vulkano-rs/vulkano/blob/master/examples/gl-interop/main.rs .

It uses glium to create some GL contexts that will share resources allocated by Vulkan. Unfortunately, it always picks the integrated GPU of my laptop instead of the dedicated GPU. It does this because the vulkan code is filtering the vulkan devices according to the glium driver UUID and the device UUIDs to ensure the ability to share resources, and glium seems to have chosen the integrated GPU.

It creates the glium display with

    let hrb_vk = glutin::ContextBuilder::new()
        .with_gl_debug_flag(true)
        .with_gl(glutin::GlRequest::Latest)
        .build_surfaceless(&event_loop_gl)
        .unwrap();

    // Used for checking device and driver UUIDs.
    let display = glium::HeadlessRenderer::with_debug(
        hrb_vk,
        glium::debug::DebugCallbackBehavior::PrintAll,
    )
    .unwrap();

Is there a way to tell glium to use the dedicated GPU instead of the integrated GPU?

0

There are 0 answers