cudaStreamDestroy() failed. Reason: an illegal memory access was encountered
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
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.
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.
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.
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)