dlib icon indicating copy to clipboard operation
dlib copied to clipboard

cudaStreamDestroy() failed. Reason: an illegal memory access was encountered

Open intgogo opened this issue 7 years ago • 4 comments

I use dlib.cuda.set_device(1) to change gpu device.Error:

calling cudaMemcpy(data_host.get(), data_device.get(), data_size*sizeof(float), cudaMemcpyDeviceToHost) in file /root/lilw/smartai/main/dlib/dlib/cuda/gpu_data.cpp:133. code: 77, reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered
cudaFreeHost() failed. Reason: an illegal memory access was encountered
cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
cudaFree() failed. Reason: an illegal memory access was encountered

intgogo avatar Jun 05 '19 07:06 intgogo

Warning: this issue has been inactive for 35 days and will be automatically closed on 2019-07-20 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot avatar Jul 10 '19 08:07 dlib-issue-bot

Warning: this issue has been inactive for 43 days and will be automatically closed on 2019-07-20 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

dlib-issue-bot avatar Jul 18 '19 08:07 dlib-issue-bot

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.

dlib-issue-bot avatar Jul 20 '19 08:07 dlib-issue-bot

I've seen this error occur more frequently when other applications are using your GPU at the same time (maybe you forgot your monitor was plugged to the same GPU device you are targeting)

try running nvidia-smi to see what applications are running on which GPU, also print the device name alongside the ID in your application since I've seen the cuda library swap the ids of my 2 GPUs compared to the nvidia-smi output.

Otherwise if you have an RTX card the following comment may help (TLDR, try calling get_net() before train_one_step)

sshazly avatar Apr 04 '23 01:04 sshazly