MethanePowered / MethaneAsteroids

:ringed_planet: Asteroids sample demonstrating multi-threaded rendering of large number random-generated asteroids with Methane Kit framework using DirectX 12, Vulkan and Metal
https://github.com/MethanePowered/MethaneKit
Apache License 2.0
16 stars 1 forks source link

Vulkan sample crashes on NVIDIA Optimus laptop #8

Open StefanG3D opened 1 year ago

StefanG3D commented 1 year ago

Describe the bug Released Vulkan sample fails to start

Steps To Reproduce Launch in IDA using an NVIDIA Optimus laptop

7FF8E767D230: The instruction at 0x7FF8E767D230 referenced memory at 0x1C2A3FFE050. The memory could not be read -> 000001C2A3FFE050 (exc.code c0000005, tid 18596)

RIP in IDA nvoglv64.dll:00007FF8E767D230 loc_7FF8E767D230: ; CODE XREF: nvoglv64.dll:nvoglv64_vk_optimusGetInstanceProcAddr+205B3↓j

Expected behavior Should work like the DX sample (which also is not Optimus aware and runs on iGPU, unless you force the dGPU in the Windows control panel)

Desktop (please complete the following information):

Probably this helps? "Trick to tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU" https://gist.github.com/statico/6809850727c708f08458

egorodet commented 1 year ago

Hello @StefanG3D, unfortunately I do not have NVidia Optimus laptop to reproduce this issue. Maybe the problem could be related to the drivers version or incompatible Vulkan runtime. Could you try to update your drivers and install latest Vulkan Runtime? Also it would be nice if you provide more information about your configuration:

DX sample (which also is not Optimus aware and runs on iGPU, unless you force the dGPU in the Windows control panel)

DirectX sample uses default GPU provided by OS for rendering and you can switch it to the other available GPUs with CTRL+X shortcut.

StefanG3D commented 1 year ago

I have updated VK runtime and both drivers to the latest Vulkan betas. Crash at the same location in NVIDIA driver.

iGPU: AMD Radeon(TM) Graphics (Cezanne) / Adrenaline 23.1.2 dGPU: NVIDIA GeForce RTX 3080 Laptop GPU / GeForce 528.50

Vulkan info https://raw.githubusercontent.com/StefanG3D/Log-files/main/VULKANINFO.TXT

MSinfo (in german, sorry)

Betriebsystemname Microsoft Windows 11 Home Version 10.0.22623 Build 22623 Weitere Betriebsystembeschreibung Nicht verfügbar Betriebsystemhersteller Microsoft Corporation Systemname NITRO-AN515-45 Systemhersteller Acer Systemmodell Nitro AN515-45 Systemtyp x64-basierter PC System-SKU 0000000000000000 Prozessor AMD Ryzen 9 5900HX with Radeon Graphics, 3301 MHz, 8 Kern(e), 16 logische(r) Prozessor(en) BIOS-Version/-Datum Insyde Corp. V1.10, 02.08.2022 SMBIOS-Version 3.3 Version des eingebetteten Controllers 1.06 BIOS-Modus UEFI BaseBoard-Hersteller CZ BaseBoard-Produkt Scala_CAS BaseBoard-Version V1.10 Plattformrolle Mobil Sicherer Startzustand Ein PCR7-Konfiguration Erweiterung zum Anzeigen erforderlich Windows-Verzeichnis C:\WINDOWS Systemverzeichnis C:\WINDOWS\system32 Startgerät \Device\HarddiskVolume1 Gebietsschema Deutschland Hardwareabstraktionsebene Version = "10.0.22621.891" Benutzername NITRO-AN515-45\stefa Zeitzone Mitteleuropäische Zeit Installierter physischer Speicher (RAM) 32,0 GB Gesamter physischer Speicher 31,4 GB Verfügbarer physischer Speicher 26,3 GB Gesamter virtueller Speicher 36,1 GB Verfügbarer virtueller Speicher 27,6 GB Größe der Auslagerungsdatei 4,75 GB Auslagerungsdatei C:\pagefile.sys Kernel-DMA-Schutz Ein Virtualisierungsbasierte Sicherheit Nicht aktiviert Windows Defender-Anwendungssteuerungsrichtlinie Erzwungen Windows Defender-Anwendungssteuerungs-Richtlinie für den Benutzermodus Aus Unterstützung der Geräteverschlüsselung Erweiterung zum Anzeigen erforderlich Hyper-V - VM-Monitormoduserweiterungen Ja Hyper-V - SLAT-Erweiterungen (Second Level Address Translation) Ja Hyper-V - Virtualisierung in Firmware aktiviert Ja Hyper-V - Datenausführungsverhinderung Ja

StefanG3D commented 1 year ago

double post, sorry

StefanG3D commented 1 year ago

I made some progress: i build the sample myself from the source code It starts on iGPU, on pressing ctrl+x it crashes Forced dGPU in Windows control panel It starts on dGPU, on pressing ctrl+x it crashes

If i only use Windows control panel, i can run 2 instances on both GPU's

EDIT: screenshot in PNG https://raw.githubusercontent.com/StefanG3D/Log-files/main/methan01.png

egorodet commented 1 year ago

Thank you for providing detailed information about your system configuration and trying the local build. Great to hear that it finally worked, but I still do not fully understand what release version you've been initially testing and found it crashing. Did you initially download binaries for v0.7.0 or for v0.7.1 release? Did you use Vulkan Win64 or Win32 build?

StefanG3D commented 1 year ago

I tried all variations VK 64 bit 0.7.0 and 0.7.1 crash in nvoglv64.dll VK 32 bit 0.7.0 and 0.7.1 crash in kernelbase.dll

I will dust another laptop with Intel iGPU and report back later...