Skip to content

Add Missing Encoder Check on Startup/Profile load - #11340

Open
derrod wants to merge 1 commit into
obsproject:masterfrom
derrod:startup-nvenc-check
Open

Add Missing Encoder Check on Startup/Profile load#11340
derrod wants to merge 1 commit into
obsproject:masterfrom
derrod:startup-nvenc-check

Conversation

@derrod

@derrod derrod commented Oct 3, 2024

Copy link
Copy Markdown
Member

Description

Adds additional checks to the nvenc test binary, and uses it to show a descriptive error message on startup if NVENC was selected and is now missing.

Example:
Example Warning Screenshot

Motivation and Context

Want to make it more obvious to users why NVENC has gone missing, especially those with Kepler GPUs.

How Has This Been Tested?

Tested with modifications to the nvenc test binary to produce various error codes.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Comment thread UI/window-basic-main-profiles.cpp Outdated
Comment thread UI/window-basic-main-profiles.cpp Outdated
Comment thread UI/window-basic-main-profiles.cpp Outdated
Comment thread UI/window-basic-main-profiles.cpp Outdated
@derrod
derrod force-pushed the startup-nvenc-check branch 3 times, most recently from 67244b2 to 75b14b1 Compare October 5, 2024 00:33
@WizardCM WizardCM added the kind/feature Functionality or other elements that the project doesn't currently have. label Oct 5, 2024
@derrod
derrod force-pushed the startup-nvenc-check branch from 75b14b1 to 4a66a47 Compare October 5, 2024 22:20
@derrod derrod changed the title WIP: Encoder Missing Warning Add Missing Encoder Check on Startup/Profile load Oct 5, 2024
@derrod
derrod marked this pull request as ready for review October 5, 2024 22:21
@derrod
derrod force-pushed the startup-nvenc-check branch from 4a66a47 to c25ecb2 Compare October 5, 2024 22:40
@WizardCM WizardCM added Seeking Testers Build artifacts on CI area/ui-ux Anything to do with changes or additions to UI/UX elements. labels Oct 5, 2024
@RytoEX
RytoEX requested review from Warchamp7 and notr1ch October 7, 2024 17:53
@derrod
derrod force-pushed the startup-nvenc-check branch 3 times, most recently from e97f60f to ecfc615 Compare October 7, 2024 22:31
@Warchamp7

Warchamp7 commented Oct 21, 2024

Copy link
Copy Markdown
Member

I'd like to adjust the formatting of this a little bit to group the errors with the encoder it's for


There were errors with one or more encoders:

obs_nvenc_hevc_tex

NVENC check failed with reason: Outdated driver (code: outdated_driver)

obs_nvenc_another

Miscellaneous probme (code: bad_nibbles)

See the Knowledge Base Article for further information


<li>
<h3></h3>
<code><code>
</li>

@derrod

derrod commented Nov 1, 2024

Copy link
Copy Markdown
Member Author

Updated it based on that, looks like this now:

screenshot revised

@derrod
derrod force-pushed the startup-nvenc-check branch 2 times, most recently from 5fbc505 to 042ffc6 Compare November 1, 2024 00:53
@Warchamp7

Copy link
Copy Markdown
Member

Updated it based on that, looks like this now:

screenshot revised

Looks good aside from the code: outdated_driver getting double reported on the NVENC entries. Is NVENC including that as part of their error message?

@derrod

derrod commented Nov 18, 2024

Copy link
Copy Markdown
Member Author

Yeah the error string for NVENC originally included the code as well and I forgot to remove that.

See https://github.com/obsproject/obs-studio/pull/11340/files#diff-cd50d66da1e02db4fa473b80d6109b5799b4e619d09ac4e4487e4492ded51fc8R1604

@derrod
derrod force-pushed the startup-nvenc-check branch 2 times, most recently from e176e85 to f7603ef Compare November 18, 2024 22:37
@derrod
derrod force-pushed the startup-nvenc-check branch from f7603ef to 5fe1aa3 Compare January 17, 2025 23:08
@derrod
derrod force-pushed the startup-nvenc-check branch from 5fe1aa3 to 4f9732a Compare March 17, 2025 12:39
@derrod derrod added this to the OBS Studio 32.0 milestone Jul 18, 2025
@RytoEX RytoEX self-assigned this Jul 28, 2025
@derrod
derrod force-pushed the startup-nvenc-check branch from 4f9732a to 53619d4 Compare August 11, 2025 17:15
@derrod
derrod force-pushed the startup-nvenc-check branch 2 times, most recently from dda0e4e to 41708e6 Compare August 21, 2025 22:39
@RytoEX

RytoEX commented Aug 28, 2025

Copy link
Copy Markdown
Member

This has a merge conflict.

@derrod
derrod force-pushed the startup-nvenc-check branch from 9d88fdf to 508fdd8 Compare July 8, 2026 14:59
@RytoEX
RytoEX requested review from Fenrirthviti and RytoEX July 10, 2026 19:03
@github-project-automation github-project-automation Bot moved this to Ready For Review in 33.0 Release Tracker Jul 14, 2026
@github-project-automation github-project-automation Bot moved this from Ready For Review to Requires Changes in 33.0 Release Tracker Jul 14, 2026
Comment on lines +921 to +923
static auto args_deleter = [](os_process_args_t *args) {
os_process_args_destroy(args);
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why use a lambda instead of a simple function here?

using CheckResult = std::optional<std::pair<QString, QString>>;

#ifndef __APPLE__
static CheckResult CheckNVENCInternal(std::unordered_set<std::string_view> &missing_encoders)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

static is superfluous for functions in an anonymous namespace (functions have no storage and the namespace gives them local visibility already).

}
}

/* All other specific failures of the test binary */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/* All other specific failures of the test binary */
// All other specific failures of the test binary

Comment on lines +1021 to +1022
/* Finally, if everything else looks good but the encoder missing is AV1, and AV1 is not supported on any GPUs,
* that's probably the issue the user is having (for example, when copying a profile from another machine). */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/* Finally, if everything else looks good but the encoder missing is AV1, and AV1 is not supported on any GPUs,
* that's probably the issue the user is having (for example, when copying a profile from another machine). */
// Finally, if everything else looks good but the encoder missing is AV1, and AV1 is not supported on any GPUs,
// that's probably the issue the user is having (for example, when copying a profile from another machine).

static CheckResult CheckX264()
{
static const bool module_loaded = obs_get_module("obs-x264") != nullptr;
/* This should be the only failure mode possible here. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/* This should be the only failure mode possible here. */
// This should be the only failure mode possible here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-ux Anything to do with changes or additions to UI/UX elements. kind/feature Functionality or other elements that the project doesn't currently have. Seeking Testers Build artifacts on CI

Projects

Status: Requires Changes

Development

Successfully merging this pull request may close these issues.

7 participants