nvidia-patch icon indicating copy to clipboard operation
nvidia-patch copied to clipboard

Add `patch-vk` for vulkan limit bypass support

Open Amjad50 opened this issue 1 year ago • 1 comments

Purpose of proposed changes

Vulkan recently added Video Encoding API Nvidia, and AMD started implementing support for this.

And for Nvidia cards, similar to NVENC API, there is a limit to consumer grade cards.

This PR adds a new patch script patch-vk to patch libnvidia-eglcore.so which contain the functionality controlling the encoding session and its restrictions.

In this PR as well I added patch support for versions from 555.42.02 to 565.57.01 (all use the same patch, so other versions might also be patched).

Essential steps taken

Check 35d33fb0 for details on the patch itself, but to summarize.

The function doing the restriction is 0xD7E780 (address in version 555.58.02). The function signature is like this

// This is C++, but for `C` translation it will be something like this
bool auth_release(void* this, bool is_auth);

It will take either is_auth==true if in auth or false when releasing.

It will return either true for success or false for failure.

What we changed here is that we replaced this function implementation with just return true;.

So it won't do increment or decrement the "usage" counters

Amjad50 avatar Dec 03 '24 09:12 Amjad50

Hello @jailuthra , can this be reviewed?

Amjad50 avatar Jan 01 '25 15:01 Amjad50