attempt fix nvidia multithread pipeline

This commit is contained in:
Niko 2022-08-27 14:04:35 -04:00
parent 01c58555f3
commit 239c458a14
3 changed files with 22 additions and 4 deletions

View file

@ -45,10 +45,13 @@ uint32 VulkanPipelineStableCache::BeginLoading(uint64 cacheTitleId)
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 (g_renderer->GetVendor() == GfxVendor::Nvidia)
{
if (VulkanRenderer::GetInstance()->GetDriverVersion() < 515.0f)
{ {
forceLog_printf("Disable multi-threaded pipeline loading due to an issue with Nvidia drivers"); 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);

View file

@ -194,10 +194,22 @@ 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);
// needed for multithreaded pipelines on nvidia (requires 515.0 or higher)
sscanf(driverProperties.driverInfo, "%f", &driverVersion);
}
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);
// disables multithreaded pipeline loading on nvidia (requires 515.0 or higher)
driverVersion = 0.0f;
}
} }
void VulkanRenderer::GetDeviceFeatures() void VulkanRenderer::GetDeviceFeatures()

View file

@ -1012,7 +1012,8 @@ private:
public: public:
bool useTFViaSSBO() { return m_featureControl.mode.useTFEmulationViaSSBO; }; float GetDriverVersion() { return driverVersion; }
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;
@ -1020,6 +1021,8 @@ public:
private: private:
float driverVersion;
// debug // debug
void debug_genericBarrier(); void debug_genericBarrier();