Can't use my nvidia GPU - laptop with dual intel/nvidia

Questions about Wine on Linux
Post Reply
parazythum
Newbie
Newbie
Posts: 2
Joined: Sat Sep 14, 2013 10:46 pm

Can't use my nvidia GPU - laptop with dual intel/nvidia

Post by parazythum »

Hi there,

no matter what I tried, it's been a long week, I crawled the forums everywhere, and I found no way to use my nvidia GPU with wine. It comes along the integrated intel GPU on my laptop.

What is particular in my case is that i have deactivated the nvidia GPU for desktop use, using only the intel. It is because I do AI things on the nvidia GPU and I want all the (poor) 2GB nvram free.

My setup :
Ubuntu MATE 24.04
nvidia 550 proprietary drivers with CUDA/CUDNN (from Nvidia Graphics drivers Team ppa:graphics-drivers/ppa) - all works well on this side, I can use CUDA from python or C++
nvidia-smi shows no running processes with the nvidia GPU
glxgears and vkcube work well as is, using the nvidia GPU, so no problem on this side either.
I activated the i386 architecture, of course.
wine version : from the wineHQ ppa

Notice that I can launch and play games like Half-Life, but I noticed the poor support of some functions. I realized that it is my intel GPU that is used.
I tried things like VXDK, setting the renderer to vulkan, etc etc.
I tried some regedit tricks (as indicated on the WineHQ help, in the right Direct3D tree), like setting the manufacturer and model of the nvidia GPU.
When I launch GPU CAPS Viewer with wine, I see the activated GPU as "GL_RENDERER: Mesa Intel(R) UHD Graphics 620" - and I have this error on the command line : "0024:err:vulkan:wine_vkCreateInstance Failed to create instance, res=-9"

I can provide all the traces, confs, etc you need.

I'll start with my xorg.conf, minimum because I don't want to use the nvidia GPU for that :

Code: Select all

Section "Device"
       Identifier     "intel"
       Driver         "modesetting"
       BusID          "PCI:0:2:0"
EndSection
glxgears

Code: Select all

glxgears -info
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
GL_RENDERER   = NVIDIA GeForce GTX 1050/PCIe/SSE2
GL_VERSION    = 4.6.0 NVIDIA 550.144.03
GL_VENDOR     = NVIDIA Corporation
GL_EXTENSIONS = GL_AMD_multi_draw_indirect GL_AMD_seamless_cubemap_per_texture GL_AMD_vertex_shader_viewport_index GL_AMD_vertex_shader_layer GL_ARB_arrays_of_arrays GL_ARB_base_instance GL_ARB_bindless_texture GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_compute_shader GL_ARB_compute_variable_group_size GL_ARB_conditional_render_inverted GL_ARB_copy_buffer [etc]
vkcube

Code: Select all

vkcube
Selected GPU 0: NVIDIA GeForce GTX 1050, type: DiscreteGpu
What else do you want ? How does wine recognize the GPUs ? Is there a way to force the GPU ? Any advice ?
User avatar
morgwai
Level 2
Level 2
Posts: 14
Joined: Sun Jan 26, 2025 7:10 am

Re: Can't use my nvidia GPU - laptop with dual intel/nvidia

Post by morgwai »

AFAIK, Wine does not have mechanisms to switch GPUs: it uses whatever the underlying d3d backend chooses. As you seem to be aware already, there are 2 implementations for d3d <= 11 : `wined3d` based on OpenGL and DXVK based on Vulkan. For d3d-12 there is only VKD3D-proton based on Vulkan. Therefore, what you need to do is to configure Vulkan or OpenGL respectively to offload work to your Nvidia GPU.

For OpenGL it's quite easy: just run your program with additional env vars defined:

Code: Select all

env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia wine mygame.exe
See details on Debian wiki.

I honestly do not know how to do this for Vulkan, but I guess it should be as easy.

Also remember that if you use DXVK, for Nvidia you also need DXVK-NVAPI (as always Debian wiki is your friend).

Hope this helps :)

PS: MATE is da best! \m/
parazythum
Newbie
Newbie
Posts: 2
Joined: Sat Sep 14, 2013 10:46 pm

Re: Can't use my nvidia GPU - laptop with dual intel/nvidia

Post by parazythum »

Thanks for this, I didn't know about DXVK-NVAPI, I tried but it doesn't solve my problem, i.e. using my nvidia GPU, for both gl and vulkan renderer

Is there a wine fork that enables to force the GPU ?

I just came back to wine that I didn't use for years, so I'm surely missing the "new" things (for me !)
Last edited by parazythum on Sat May 31, 2025 11:07 am, edited 1 time in total.
User avatar
morgwai
Level 2
Level 2
Posts: 14
Joined: Sun Jan 26, 2025 7:10 am

Re: Can't use my nvidia GPU - laptop with dual intel/nvidia

Post by morgwai »

parazythum wrote: Sat May 31, 2025 11:05 am Thanks for this, I didn't know about DXVK-NVAPI, I tried but it doesn't solve my problem, i.e. using my nvidia GPU, for both gl and vulkan renderer
As I wrote before, you still need to configure offloading...
Post Reply