Fix Windows 64 bit gpu crash

Fix #2301 ,thanks @raven02
Merge pull request #5116 from sum2012/patch-3

Fix Windows 64 bit gpu crash