We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description Simply requesting a device results in 334MB of memory usage.
Repro steps
use winit::{ event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder, }; use pollster::{self, FutureExt}; use wgpu::{ Backends, DeviceDescriptor, Features, Instance, InstanceDescriptor, Limits, PowerPreference, RequestAdapterOptions, Surface, }; use winit::window::Window; pub struct Device<'a> { window: &'a Window, instance: Instance, surface: Surface, } impl<'a> Device<'a> { pub fn new(window: &'a Window) -> Self { let size = window.inner_size(); // Create the wgpu instance. let inst_desc = InstanceDescriptor { backends: Backends::DX12, dx12_shader_compiler: Default::default(), }; let instance = Instance::new(inst_desc); // Create the surface. let surface = unsafe { instance.create_surface(window) }.expect("Unable to create surface."); // Request the adapter. let adapter_request = RequestAdapterOptions { power_preference: PowerPreference::default(), // Should default to integrated GPU. compatible_surface: Some(&surface), force_fallback_adapter: false, }; let adapter = instance .request_adapter(&adapter_request) .block_on() .expect("Unable to find device matching request."); dbg!(adapter.get_info()); // Request device and queue. let device_descriptor = DeviceDescriptor { features: Features::empty(), limits: Limits::default(), label: None, }; let (device, queue) = adapter .request_device( &device_descriptor, None, // Trace path ) .block_on() .unwrap(); Device { window, instance, surface, } } } fn main() { let event_loop = EventLoop::new(); let window = WindowBuilder::new().build(&event_loop).unwrap(); let _device = Device::new(&window); event_loop.run(move |event, _, control_flow| { *control_flow = ControlFlow::Wait; match event { Event::WindowEvent { window_id: _, event, } => match event { WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit, _ => {} }, _ => {} } }); }
Expected vs observed behavior Expected: <10MB RAM. Actual: nearly 350MB RAM.
Platform Windows, targeting DX12 backend, using integrated GPU. AdapterInfo { name: "Intel(R) UHD Graphics", vendor: 32902, device: 39876, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Dx12, }
The text was updated successfully, but these errors were encountered:
Maybe related to the initial block of memory allocated through gpu-allocator (see #3498 (comment))
gpu-allocator
Sorry, something went wrong.
That is definitely it. 256 MB seems like a lot of memory to allocate ahead of time. Is there a way to configure that to be substantially less?
This has been addressed by #5875. You can now request a device with the MemoryHints::MemoryUsage option.
MemoryHints::MemoryUsage
No branches or pull requests
Description
Simply requesting a device results in 334MB of memory usage.
Repro steps
Expected vs observed behavior
Expected: <10MB RAM. Actual: nearly 350MB RAM.
Platform
Windows, targeting DX12 backend, using integrated GPU.
AdapterInfo {
name: "Intel(R) UHD Graphics",
vendor: 32902,
device: 39876,
device_type: IntegratedGpu,
driver: "",
driver_info: "",
backend: Dx12,
}
The text was updated successfully, but these errors were encountered: