[dxvk] Add option to disable workaround for NVIDIA HVV bug

Adds a new dxvk.halveNvidiaHVVHeap option.

Reviewed-by: Arthur Huillet <ahuillet@nvidia.com>
This commit is contained in:
Liam Middlebrook 2021-03-03 00:40:19 -08:00 committed by Philip Rebohle
parent 3acdf6e22a
commit b25d6ba615
4 changed files with 29 additions and 4 deletions

View File

@ -206,6 +206,20 @@
# dxvk.useEarlyDiscard = Auto
# Controls workaround for NVIDIA HVV Heap bug.
#
# Limits the budget of NVIDIA's HVV (host-visible,
# device-local) heap to be half of the reported size. This is
# needed to avoid NVIDIA driver bug 3114283, and defaults to
# being enabled on all affected drivers.
#
# Supported values:
# - Auto: Don't change the default
# - True, False: Always enable / disable
# dxvk.halveNvidiaHVVHeap = Auto
# Sets enabled HUD elements
#
# Behaves like the DXVK_HUD environment variable if the

View File

@ -180,7 +180,11 @@ namespace dxvk {
/* Work around an issue on Nvidia drivers where using the entire
* device_local | host_visible heap can cause crashes, presumably
* due to subsequent internal driver allocations failing */
if (m_device->properties().core.properties.vendorID == uint16_t(DxvkGpuVendor::Nvidia)) {
bool nvidiaBug3114283Active = true;
applyTristate(nvidiaBug3114283Active, device->config().halveNvidiaHVVHeap);
if ((m_device->properties().core.properties.vendorID == uint16_t(DxvkGpuVendor::Nvidia))
&& (nvidiaBug3114283Active)) {
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
constexpr VkMemoryPropertyFlags flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
@ -432,4 +436,4 @@ namespace dxvk {
return chunkSize;
}
}
}

View File

@ -9,7 +9,8 @@ namespace dxvk {
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
useEarlyDiscard = config.getOption<Tristate>("dxvk.useEarlyDiscard", Tristate::Auto);
halveNvidiaHVVHeap = config.getOption<Tristate>("dxvk.halveNvidiaHVVHeap", Tristate::Auto);
hud = config.getOption<std::string>("dxvk.hud", "");
}
}
}

View File

@ -25,8 +25,14 @@ namespace dxvk {
Tristate useRawSsbo;
Tristate useEarlyDiscard;
/// Workaround for NVIDIA driver
/// bug 3114283. Cut usable HVV
/// (Host-Visible Vidmem) heap
/// in half to avoid crash
Tristate halveNvidiaHVVHeap;
/// HUD elements
std::string hud;
};
}
}