Setting r.graphicsAdapter=1 causes exception

I am using a Github source build version 4.12.3. I have two NVidia graphics cards in my system. I placed r.graphicsAdapter=1 in my ConsoleVariables.ini file of my packaged build, and when I run an array index out of bounds exception is thrown near line 371 of engine source file WindowsD3D11Device.cpp. The problem is that the AdapterDescription array is not always populated with a description for every adapter index, yet the code assumes so and attempts to reference the array by an index beyond the array size. This file appears to have been modified in 4.12.3 for changes related to HMD adapters, but it clearly was never tested to verify it could select adapter 1. A simple solution is to populate the array with the description of every adapter encountered just after the adapter description is read.

Hello,

  • Could you provide the logs from your project’s Saved->Logs folder after the crash occurs?
  • Could you please cause the crash again and provide your Machine ID from the Crash Reporter window and ensure to hit Send & Close on the report?

I have attached a zip of the saved/logs folder. Opening the mini dump in VS will take you right to the line of the 4.12.3 code I indicated in my first post (accessing the array of adapter descriptions beyond the size of the array). No Crash Reporter window appears when this problem occurs. In fact no windows come up at all. I provided an image of the call stack from the mini dump also.

alt text

Hello,

After investigating this issue further, it appears that this is a known issue, UE-17513. However, the issue is not on our end. Other users who have experienced this crash had to update their DisplayLink drivers in order to fix this crash.

Here is some more information regarding this issue:

Let me know if that helps.

Have a great day

Thank you for your research on this problem. I am afraid the issue you referred to is not related. I would like to see the UE-17513 JIRA if that would be possible, but I suspect it is a different issue (not to mention quite old). My issue does not occur in 4.12.2, but does occur in 4.12.3 and there were changes to the file I referred to in 4.12.3 to support HMD adapters. This is a basic problem unrelated to drivers. There is a loop that enumerates the graphics adapters and tries to determine which adapter to use. The code attempts to take into account which adapters are integrated, which are not, and also if the user specified to use a particular adapter (via an ini file entry r.graphicsAdapter). The code uses an array to hold the adapter descriptions of the cards it encounters, however in some cases this array does not get populated with every card in the system. Near the end of the function, an adapter index is used to reference this array, and in the case I describe, this index is beyond the size of the array. This is a very basic problem and easily reproduced. I have fixed the problem myself in my code base and I am just trying to report to you so you can do the same. And just to be clear, I don’t believe engine code should experience an array index out of bounds exception even if a driver need updating or whatever. I hope I have made the problem clear so someone there at Epic can address it. Thank you for your time.