Add patch-vk for vulkan limit bypass support#872
Open
Amjad50 wants to merge 2 commits intokeylase:masterfrom
Open
Add patch-vk for vulkan limit bypass support#872Amjad50 wants to merge 2 commits intokeylase:masterfrom
patch-vk for vulkan limit bypass support#872Amjad50 wants to merge 2 commits intokeylase:masterfrom
Conversation
This bypasses the limit for vulkan drivers. Whenever an encoder session is created, it will call a function that does "authorization", and then before it exit or when the session is closed, it will "release" it. This happens at the function 0xD7E780 (address in version 555.58.02). The function signature is like this ```C // 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 `return true;`. And it seems to be working as expected, and we can bypass the limit by not even registering and checking for it. Part of this commit, I checked the other surrounding versions, and they all seem to use the exact same function which is good for us. I actually didn't test any version beside 555.58.02, so it could need some testing. Signed-off-by: Amjad Alsharafi <amjadsharafi10@gmail.com>
Updated the README template, as well as `drivers.json` to include this new patch category Signed-off-by: Amjad Alsharafi <amjadsharafi10@gmail.com>
Author
|
Hello @jailuthra , can this be reviewed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-vkto patchlibnvidia-eglcore.sowhich contain the functionality controlling the encoding session and its restrictions.In this PR as well I added patch support for versions from
555.42.02to565.57.01(all use the same patch, so other versions might also be patched).Essential steps taken
Check 35d33fb 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
It will take either
is_auth==trueif inauthorfalsewhen releasing.It will return either
truefor success orfalsefor 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