CUDA cudaMalloc

后端 未结 2 1723
小鲜肉
小鲜肉 2021-01-21 10:16

I\'ve started writing a new CUDA application. However I hit a funny detour along the way. Calling the first cudaMalloc on a variable x, fails the first time. However when I call

2条回答
  •  独厮守ぢ
    2021-01-21 10:19

    The very first call to any of the cuda library functions launches an initialisation subroutine. It can happen that somehow the initialisation fails and not the cudaMalloc itself. (CUDA Programming Guide, section 3.2.1)

    Somehow, later, however it seems it works, despite the initial failure. I don't know your setting and your code so I can't really help you further. Check the Programming Guide!

提交回复
热议问题