mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 17:19:18 +01:00
Renable Nvidia Multithreaded Pipeline compile after driver 515 (#91)
This commit is contained in:
parent
60074c440d
commit
584938d8f3
@ -34,26 +34,29 @@ uint32 VulkanPipelineStableCache::BeginLoading(uint64 cacheTitleId)
|
|||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
fs::create_directories(ActiveSettings::GetPath("shaderCache/transferable"), ec);
|
fs::create_directories(ActiveSettings::GetPath("shaderCache/transferable"), ec);
|
||||||
const auto pathCacheFile = ActiveSettings::GetPath("shaderCache/transferable/{:016x}_vkpipeline.bin", cacheTitleId);
|
const auto pathCacheFile = ActiveSettings::GetPath("shaderCache/transferable/{:016x}_vkpipeline.bin", cacheTitleId);
|
||||||
|
|
||||||
// init cache loader state
|
// init cache loader state
|
||||||
g_vkCacheState.pipelineLoadIndex = 0;
|
g_vkCacheState.pipelineLoadIndex = 0;
|
||||||
g_vkCacheState.pipelineMaxFileIndex = 0;
|
g_vkCacheState.pipelineMaxFileIndex = 0;
|
||||||
g_vkCacheState.pipelinesLoaded = 0;
|
g_vkCacheState.pipelinesLoaded = 0;
|
||||||
g_vkCacheState.pipelinesQueued = 0;
|
g_vkCacheState.pipelinesQueued = 0;
|
||||||
|
|
||||||
// start async compilation threads
|
// start async compilation threads
|
||||||
m_compilationCount.store(0);
|
m_compilationCount.store(0);
|
||||||
m_compilationQueue.clear();
|
m_compilationQueue.clear();
|
||||||
|
|
||||||
|
// get core count
|
||||||
uint32 cpuCoreCount = GetPhysicalCoreCount();
|
uint32 cpuCoreCount = GetPhysicalCoreCount();
|
||||||
m_numCompilationThreads = std::clamp(cpuCoreCount, 1u, 8u);
|
m_numCompilationThreads = std::clamp(cpuCoreCount, 1u, 8u);
|
||||||
if (g_renderer->GetVendor() == GfxVendor::Nvidia)
|
if (VulkanRenderer::GetInstance()->GetDisableMultithreadedCompilation())
|
||||||
{
|
|
||||||
forceLog_printf("Disable multi-threaded pipeline loading due to an issue with Nvidia drivers");
|
|
||||||
m_numCompilationThreads = 1;
|
m_numCompilationThreads = 1;
|
||||||
}
|
|
||||||
for (uint32 i = 0; i < m_numCompilationThreads; i++)
|
for (uint32 i = 0; i < m_numCompilationThreads; i++)
|
||||||
{
|
{
|
||||||
std::thread compileThread(&VulkanPipelineStableCache::CompilerThread, this);
|
std::thread compileThread(&VulkanPipelineStableCache::CompilerThread, this);
|
||||||
compileThread.detach();
|
compileThread.detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
// open cache file or create it
|
// open cache file or create it
|
||||||
cemu_assert_debug(s_cache == nullptr);
|
cemu_assert_debug(s_cache == nullptr);
|
||||||
const uint32 cacheFileVersion = 1;
|
const uint32 cacheFileVersion = 1;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "Cafe/CafeSystem.h"
|
#include "Cafe/CafeSystem.h"
|
||||||
|
|
||||||
#include "util/helpers/helpers.h"
|
#include "util/helpers/helpers.h"
|
||||||
|
#include "util/helpers/StringHelpers.h"
|
||||||
|
|
||||||
#include "config/ActiveSettings.h"
|
#include "config/ActiveSettings.h"
|
||||||
#include "config/CemuConfig.h"
|
#include "config/CemuConfig.h"
|
||||||
@ -194,10 +195,29 @@ void VulkanRenderer::DetermineVendor()
|
|||||||
m_vendor = GfxVendor::Mesa;
|
m_vendor = GfxVendor::Mesa;
|
||||||
|
|
||||||
forceLog_printf("Using GPU: %s", properties.properties.deviceName);
|
forceLog_printf("Using GPU: %s", properties.properties.deviceName);
|
||||||
|
|
||||||
if (m_featureControl.deviceExtensions.driver_properties)
|
if (m_featureControl.deviceExtensions.driver_properties)
|
||||||
forceLog_printf("Driver version: %s", driverProperties.driverInfo)
|
{
|
||||||
|
forceLog_printf("Driver version: %s", driverProperties.driverInfo);
|
||||||
|
|
||||||
|
if(m_vendor == GfxVendor::Nvidia)
|
||||||
|
{
|
||||||
|
// multithreaded pipelines on nvidia (requires 515 or higher)
|
||||||
|
m_featureControl.disableMultithreadedCompilation = (StringHelpers::ToInt(std::string(driverProperties.driverInfo)) < 515);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
{
|
||||||
forceLog_printf("Driver version (as stored in device info): %08X", properties.properties.driverVersion);
|
forceLog_printf("Driver version (as stored in device info): %08X", properties.properties.driverVersion);
|
||||||
|
|
||||||
|
if(m_vendor == GfxVendor::Nvidia)
|
||||||
|
{
|
||||||
|
// if the driver does not support the extension,
|
||||||
|
// it is assumed the driver is under version 515
|
||||||
|
m_featureControl.disableMultithreadedCompilation = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanRenderer::GetDeviceFeatures()
|
void VulkanRenderer::GetDeviceFeatures()
|
||||||
|
@ -548,6 +548,7 @@ private:
|
|||||||
}limits;
|
}limits;
|
||||||
|
|
||||||
bool debugMarkersSupported = false; // frame debugger is attached
|
bool debugMarkersSupported = false; // frame debugger is attached
|
||||||
|
bool disableMultithreadedCompilation = false; // for old nvidia drivers
|
||||||
|
|
||||||
}m_featureControl{};
|
}m_featureControl{};
|
||||||
static bool CheckDeviceExtensionSupport(const VkPhysicalDevice device, FeatureControl& info);
|
static bool CheckDeviceExtensionSupport(const VkPhysicalDevice device, FeatureControl& info);
|
||||||
@ -1012,7 +1013,8 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool useTFViaSSBO() { return m_featureControl.mode.useTFEmulationViaSSBO; };
|
bool GetDisableMultithreadedCompilation() { return m_featureControl.disableMultithreadedCompilation; }
|
||||||
|
bool useTFViaSSBO() { return m_featureControl.mode.useTFEmulationViaSSBO; }
|
||||||
bool IsDebugUtilsEnabled() const
|
bool IsDebugUtilsEnabled() const
|
||||||
{
|
{
|
||||||
return m_featureControl.debugMarkersSupported && m_featureControl.instanceExtensions.debug_utils;
|
return m_featureControl.debugMarkersSupported && m_featureControl.instanceExtensions.debug_utils;
|
||||||
|
Loading…
Reference in New Issue
Block a user