Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(win/nvenc): dynamic sdk version selection at runtime #3040

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ns6089
Copy link
Contributor

@ns6089 ns6089 commented Aug 17, 2024

Description

Notes

  • submodules moved from nv-codec-headers to nvenc-headers to avoid conflicts during branch switching
  • 1202 tracks master because there is no branch for this version yet

Todo

  • update doxygen comments
  • add some automatic regression tests for older sdk's

Screenshot

if (max_version >= 1202) {
  return std::make_shared<nvenc_dynamic_factory_1202>(dll);
}
else if (max_version >= 1200) {
  return std::make_shared<nvenc_dynamic_factory_1200>(dll);
}
else if (max_version >= 1100) {
  return std::make_shared<nvenc_dynamic_factory_1100>(dll);
}
else {
  BOOST_LOG(error) << "NvEnc: minimum required driver version is 456.71";
}

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

.gitmodules Outdated Show resolved Hide resolved
"${CMAKE_SOURCE_DIR}/src/nvenc/*.h"
"${CMAKE_SOURCE_DIR}/src/nvenc/*.cpp")

include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nvenc-headers/12.0/include")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nvenc-headers/12.0/include")
include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nvenc-headers/1200/include")

Unless I'm missing something, this path doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it used what we ship with ffmpeg in this case. I will think about how to handle this best, either remove these particular headers from windows ffmpeg, or somehow use them (not trivial and may have drawbacks).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to drop this "default version" logic to minimize potential problems.
One extra version of some classes will be compiled with ffmpeg version of nvenc sdk, but then discarded by the linker.

.gitmodules Outdated Show resolved Hide resolved
@ns6089
Copy link
Contributor Author

ns6089 commented Aug 22, 2024

Ready. Split-frame encoding will be done in a separate PR since it's a separate feature and we're now auto-squashing commits.

@ns6089 ns6089 marked this pull request as ready for review August 22, 2024 09:31
Copy link

sonarcloud bot commented Aug 23, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@ns6089
Copy link
Contributor Author

ns6089 commented Aug 25, 2024

The code in this pull request is Not a Contribution under LizardByte Individual Contributor License Agreement.
The code in this pull request is shared under GNU GENERAL PUBLIC LICENSE Version 3.

@ReenigneArcher ReenigneArcher marked this pull request as draft August 25, 2024 04:23
@cgutman
Copy link
Collaborator

cgutman commented Aug 28, 2024

Reopening now that the CLA has been revoked and this can now be accepted under the GPLv3 terms alone.

@cgutman cgutman reopened this Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants