mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxvk] Rework Nvidia HVV option
This commit is contained in:
parent
8912c7adb0
commit
778aee0372
12
dxvk.conf
12
dxvk.conf
@ -227,18 +227,18 @@
|
||||
# dxvk.useRawSsbo = Auto
|
||||
|
||||
|
||||
# Controls workaround for NVIDIA HVV Heap bug.
|
||||
# Controls Nvidia HVV behaviour.
|
||||
#
|
||||
# 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.
|
||||
# Disables the host-visible, device-local heap on Nvidia drivers. This
|
||||
# is used to avoid NVIDIA driver bug 3114283 on affected drivers, as
|
||||
# well as in specific games on newer drivers.being enabled on all
|
||||
# affected drivers.
|
||||
#
|
||||
# Supported values:
|
||||
# - Auto: Don't change the default
|
||||
# - True, False: Always enable / disable
|
||||
|
||||
# dxvk.halveNvidiaHVVHeap = Auto
|
||||
# dxvk.disableNvidiaHvvHeap = Auto
|
||||
|
||||
|
||||
# Sets enabled HUD elements
|
||||
|
@ -178,27 +178,22 @@ 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 */
|
||||
bool nvidiaBug3114283Active = false;
|
||||
* device_local | host_visible heap can cause crashes or slowdowns */
|
||||
if (m_device->properties().core.properties.vendorID == uint16_t(DxvkGpuVendor::Nvidia)) {
|
||||
bool shrinkNvidiaHvvHeap = device->adapter()->matchesDriver(DxvkGpuVendor::Nvidia,
|
||||
VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, VK_MAKE_VERSION(465, 0, 0));
|
||||
|
||||
// Fix is available in mainline drivers starting with the 465 driver series.
|
||||
if (device->adapter()->matchesDriver(DxvkGpuVendor::Nvidia,
|
||||
VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR,
|
||||
0,
|
||||
VK_MAKE_VERSION(465, 0, 0))) {
|
||||
nvidiaBug3114283Active = true;
|
||||
}
|
||||
applyTristate(shrinkNvidiaHvvHeap, device->config().shrinkNvidiaHvvHeap);
|
||||
|
||||
applyTristate(nvidiaBug3114283Active, device->config().halveNvidiaHVVHeap);
|
||||
if (shrinkNvidiaHvvHeap) {
|
||||
for (uint32_t i = 0; i < m_memProps.memoryTypeCount; i++) {
|
||||
VkMemoryPropertyFlags flags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
|
||||
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;
|
||||
|
||||
if ((m_memTypes[i].memType.propertyFlags & flags) == flags)
|
||||
m_memTypes[i].heap->budget = m_memTypes[i].heap->properties.size / 2;
|
||||
if ((m_memTypes[i].memType.propertyFlags & flags) == flags) {
|
||||
m_memTypes[i].heap->budget = 32 << 20;
|
||||
m_memTypes[i].chunkSize = 1 << 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ namespace dxvk {
|
||||
enableOpenXR = config.getOption<bool> ("dxvk.enableOpenXR", true);
|
||||
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0);
|
||||
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto);
|
||||
halveNvidiaHVVHeap = config.getOption<Tristate>("dxvk.halveNvidiaHVVHeap", Tristate::Auto);
|
||||
shrinkNvidiaHvvHeap = config.getOption<Tristate>("dxvk.shrinkNvidiaHvvHeap", Tristate::Auto);
|
||||
hud = config.getOption<std::string>("dxvk.hud", "");
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,8 @@ namespace dxvk {
|
||||
/// Shader-related options
|
||||
Tristate useRawSsbo;
|
||||
|
||||
/// Workaround for NVIDIA driver
|
||||
/// bug 3114283. Cut usable HVV
|
||||
/// (Host-Visible Vidmem) heap
|
||||
/// in half to avoid crash
|
||||
Tristate halveNvidiaHVVHeap;
|
||||
/// Workaround for NVIDIA driver bug 3114283
|
||||
Tristate shrinkNvidiaHvvHeap;
|
||||
|
||||
/// HUD elements
|
||||
std::string hud;
|
||||
|
Loading…
x
Reference in New Issue
Block a user