зеркало из https://github.com/mozilla/kaldi.git
trunk,cudamatrix : added reset of cuda error state by cudaGetLastError(), when allocator runs out of gpu memory before releasing
git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@3197 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
This commit is contained in:
Родитель
c3a5fa2187
Коммит
b1602fd846
|
@ -588,6 +588,7 @@ void* CuAllocator::MallocInternal(size_t row_bytes,
|
|||
if (ret != 0) {
|
||||
KALDI_WARN << "Allocation of memory block of " << size << " bytes "
|
||||
<< "failed, releasing cached memory and retrying.";
|
||||
cudaGetLastError(); // reset the error state
|
||||
ReleaseAllCachedMemory();
|
||||
ret = cudaMalloc(&ans, size);
|
||||
if (ret != 0)
|
||||
|
@ -603,6 +604,7 @@ void* CuAllocator::MallocInternal(size_t row_bytes,
|
|||
KALDI_WARN << "Allocation of " << num_rows << " rows, each of size "
|
||||
<< row_bytes << " bytes failed, releasing cached "
|
||||
<< "memory and retrying.";
|
||||
cudaGetLastError(); // reset the error state
|
||||
ReleaseAllCachedMemory();
|
||||
ret = cudaMallocPitch(&ans, &pitch, row_bytes, num_rows);
|
||||
if (ret != 0) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче