I have seen similar stuff - with, just to put icing on the cake, two consecutive cards. In both instances it was due to RAM on the cards failing just a little.
If you can accept the performance penalty, try running the same code with Mesa3D in software mode. If that also fails, it’s more likely a bug in your code. If it works… it’s time to dig deeper (where bad RAM is but one of many possible sources).
ram failing a little?
ive rebooted the computer 6/7x since the initial problem, + it seems to happen always for the first few test runs of the app, + then its like the card ‘wakes up’ + starts to work
i will test it ith mesa though (been a while since ive run that so im curious)
ta