r.WarnOfBadDrivers

r.WarnOfBadDrivers

#Overview

name: r.WarnOfBadDrivers

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.WarnOfBadDrivers is to control whether the engine should check for and warn users about potential issues with their GPU drivers on engine startup. This setting is primarily used in the rendering system, specifically for driver compatibility checks.

This setting variable is mainly relied upon by the RHI (Rendering Hardware Interface) module of Unreal Engine. It’s also referenced in the GeForceNOWWrapper plugin, which suggests it has implications for cloud gaming services.

The value of this variable is set through a console variable system. It’s initialized with a default value of 1 (true) in the DynamicRHI.cpp file.

This variable interacts with other systems that check for driver compatibility and version requirements. For example, it’s used in conjunction with checks for specific GPU vendors and their driver versions.

Developers must be aware that:

  1. This variable affects user experience, as it controls whether warning pop-ups about GPU drivers are shown.
  2. It’s automatically disabled (set to 0) when running in cloud environments like GeForce NOW.
  3. It can be used to suppress driver warnings in scenarios where they might not be applicable or desired.

Best practices when using this variable include:

  1. Leave it enabled (set to 1) for most end-user scenarios to ensure they’re informed about potential driver issues.
  2. Consider disabling it (set to 0) in controlled environments where driver updates are managed centrally, or in cloud gaming scenarios.
  3. Be cautious about disabling it in development environments, as it might mask potential driver-related issues.
  4. Use it in conjunction with other driver-related checks and variables for a comprehensive approach to ensuring optimal GPU performance and compatibility.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DynamicRHI.cpp:38

Scope: file

Source code excerpt:

static int32 GWarnOfBadDrivers = true;
static FAutoConsoleVariableRef CVarWarnOfBadDrivers(
	TEXT("r.WarnOfBadDrivers"),
	GWarnOfBadDrivers,
	TEXT("Check the current GPU driver on engine startup, warn the user about issues and suggest a specific version.\n")
	TEXT("The driver denylist is used to check for bad drivers according to their release date and/or driver versions.\n")
	TEXT(" 0: off\n")
	TEXT(" 1: check the driver and display a pop-up message if the driver is denylisted (default)"),
	ECVF_RenderThreadSafe

#Loc: <Workspace>/Engine/Plugins/Runtime/Nvidia/GeForceNOWWrapper/Source/Private/GeForceNOWWrapperModule.cpp:30

Scope (from outer to inner):

file
class        class FGeForceNOWWrapperModule : public IGeForceNOWWrapperModule
function     virtual void StartupModule

Source code excerpt:

			if (bIsRunningInTheCloud)
			{
				if (IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.WarnOfBadDrivers")))
				{
					CVar->Set(TEXT("0"));
				}
				if (IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.D3D12.DXR.MinimumWindowsBuildVersion")))
				{
					CVar->Set(TEXT("0"));

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DynamicRHI.cpp:147

Scope (from outer to inner):

file
function     void RHIDetectAndWarnOfBadDrivers

Source code excerpt:


		// Only alert users who are capable of updating their driver. Assume vendors with an empty list can always update.
		// The warning message can also be suppressed with r.WarnOfBadDrivers=0.
		bool bShowPrompt = bDeviceCanUpdateDriver || !bVendorHasEntries;
		bShowPrompt = bShowPrompt && !FApp::IsUnattended() && GWarnOfBadDrivers != 0;

		if (bShowPrompt)
		{
			// Note: we don't localize the vendor's name.

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DynamicRHI.cpp:248

Scope (from outer to inner):

file
function     void RHIDetectAndWarnOfBadDrivers

Source code excerpt:

	if (FPlatformMisc::MacOSXVersionCompare(12, 0, 0) < 0)
	{
		// this message can be suppressed with r.WarnOfBadDrivers=0
		FPlatformMisc::MessageBoxExt(EAppMsgType::Ok,
								 *NSLOCTEXT("MessageDialog", "UpdateMacOSX_Body", "Please update to the latest version of macOS for best performance and stability.").ToString(),
								 *NSLOCTEXT("MessageDialog", "UpdateMacOSX_Title", "Update macOS").ToString());
		
#if !UE_BUILD_SHIPPING
		if (GBadDriverWarningIsFatal)