VRAM size autodetection on OS X

Theodore Dubois tblodt at icloud.com
Fri Apr 1 13:41:47 CDT 2016

Sometimes, when I'm playing games on Wine, the game crashes, and then I look in the log and see "Out of adapter memory". Then I run `winetricks videomemorysize=1024`, and it runs fine. My graphics card has 1536 MB of total VRAM. It seems to me that Wine isn't correctly autodetecting the amount of VRAM I have.

(DISCLAIMER: The following analysis is not based on any log output. It's based on my reading of the code, which may well be incorrect. If so, please correct me.)

I just had a look at the code. In dlls/wined3d/directx.c, query_gpu_description uses wglQueryCurrentRendererIntegerWINE to obtain the GPU vendor, device, and available VRAM. wglQueryCurrentRendererIntegerWINE is part of the WGL_WINE_QUERY_RENDERER extension, which...is not implemented in winemac.drv. It's only implemented in winex11.drv. I don't use X11 if I can help it. So, with absolutely no information about what the graphics card is, Wine defaults to an Nvidia Riva 128 with WINE_DEFAULT_VIDMEM (64MB) of VRAM. This is not close.

I would like to write a patch to fix this problem. I'm thinking of adding an implementation of WGL_WINE_QUERY_RENDERER to winemac.drv. There are 12 different things that can be queried about the renderer, but only WGL_RENDERER_VENDOR_ID_WINE, WGL_RENDERER_DEVICE_ID_WINE, and WGL_RENDERER_VIDEO_MEMORY_WINE are used to my knowledge, so I’d only implement those.

Does this sound correct?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160401/8971ab94/attachment.html>

More information about the wine-devel mailing list