1. https://m.blog.naver.com/wideeyed/221329619056

GPU기반 Keras로 코드를 작성하다보면 아래와 같은 오류 메시지에 직면할 때가 있다.

InternalError: Blas GEMM launch failed
CUDA_ERROR_OUT_OF_MEMORY
InternalError: GPU sync failed

GPU에 할당된 메모리를 다른 세션이 점유하고 있어서 발생할 가능성이 높다.
1) 점유하고 있는 세션을 중단하고 메모리를 회수한다.
2) Keras가 사용하는 Backend엔진(ex.Tensorflow)의 메모리 추가 사용을 허락한다.

이 문제를 해결한 후 오류가 발생한 세션을 다시 시작해야한다. 
그렇지 않으면 "InternalError: GPU sync failed"가 발생할 수 있다.


[Tensorflow Backand 엔진 설정 방법]

from keras.backend import tensorflow_backend as K config = tf.ConfigProto() config.gpu_options.allow_growth = True K.set_session(tf.Session(config=config))



전체 소스코드는 아래 포스트를 참고하세요.

[Keras] IRIS데이터 이용한 DNN

IRIS데이터를 이용한 간단한 DNN 학습 및 추론을 해보자. 데이터를 Train/Test로 구분한 후 학습...

blog.naver.com

끝.

--------------------------------------------------------------------------------------

2. https://zereight.tistory.com/228

GPU 동기화 오류이다.

다음 코드를 돌려서 해결하자

import tensorflow as tf

config = tf.ConfigProto()

config.gpu_options.per_process_gpu_memory_fraction = 0.4

session = tf.Session(config=config)

session.close()

--------------------------------------------------------------------------------------

3. https://emmadeveloper.tistory.com/27

GPU sync failed 에러가 떴다.

 

 

 

러닝 시작한 것 확인하고 잤는데 에러 떠 있어서

확인해보니 전용 GPU메모리의 50% 정도를 이미 다른 곳에서 점유하고 있었다.

 

나머지 것들을 shutdown시켰다.

다시 실행해보려는데 안 됨.

그냥 jupyter notebook을 재실행했더니 다시 잘 된다.

 

이제 돌리기 전에 전용 GPU 메모리 사용량을 미리 확인하고, 깔끔하게 낮춘 후, 돌려야겠다.

--------------------------------------------------------------------------------------
4. https://stackoverflow.com/questions/51112126/gpu-sync-failed-while-using-tensorflow

TLDR: If you find that tensorflow is throwing a GPU sync failed Error, it may be because the model's inputs are too large (as was my case when first running into this problem) or you don't have cuDNN installed properly. Verify that cuDNN is installed correctly and reset your nvidia caches (ie. sudo -rf $HOME/.nv/) (if you have no yet done so after initially installing CUDA and cuDNN) and restart your machine.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by uniqueone
,