I have a project that I’m building myself using a nix shell for its environment. I’m running nixos.
When I run it on Nvidia, the line r->rdr = SDL_CreateRenderer(r->win, -1, SDL_RENDERER_PRESENTVSYNC| SDL_RENDERER_ACCELERATED);
fails and SDL_Error readout is “Couldn’t find matching render driver”. This issue goes away when I set the renderer flags to 0, but I want to use vsync for my particular project so that won’t suffice.
When I run the app with steam-run, it works correctly. When I run it on Intel, it works properly. Only proprietary Nvidia seems to be failing.
i haven’t got time right now to go deep dive on this, but when i was having GL type problems with some things on my nixos machine,
it fixed my problem, and i learnt quite a lot about how drivers, opengl and all the low level gfx plumbing works. And the fact that graphics drivers are impure!!! they have to be! :-).
might not be related…
the only thing i can suggest in my time limited response, is anything else in nixpkgs using this code, if so it might help you.
Now this is strange. I got NixGL repository working, but the only packages it shows are nixGLIntel and NixVulkanIntel. It seems unable to detect my nvidia GPU, or something?
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
[ 27.455545] nvidia-nvlink: Nvlink Core is being initialized, major device number 242
[ 27.456086] nvidia 0000:05:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[ 27.826516] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 470.63.01 Tue Aug 3 20:30:55 UTC 2021
[ 27.835375] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[ 27.848609] nvidia-uvm: Loaded the UVM driver, major device number 240.
[ 27.855059] [drm] [nvidia-drm] [GPU ID 0x00000500] Loading driver
[ 27.855062] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:05:00.0 on minor 0
[ 60.829805] caller _nv000722rm+0x1ad/0x200 [nvidia] mapping multiple BARs
so must be a combination of your hardware / kernel / nvidia driver. or maybe something else!