Linux: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
Linux cmd 창에서 파이썬 파일을 실행시키면
Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 발생한다.
구글링해보니 많이 발생한 에러라 금방 해결방법을 찾을 수 있었다
캐시가 문제일 수도 있고 메모리가 문제일 수도 있단다
Failed to get convolution algorithm. This is probably because cuDNN failed to initialize,
In Tensorflow/ Keras when running the code from https://github.com/pierluigiferrari/ssd_keras, use the estimator: ssd300_evaluation. I received this error. Failed to get convolution algorithm. ...
stackoverflow.com
둘중 뭐가 문제인지 확인을 해보자
GPU 메모리가 다 차는 순간 코드가 중지되더라
나는 메모리 문제인 걸 확인.
해결방법은 두가지
1. GPU에 할당되는 총 메모리의 크기를 제한하기
2. 필요한만큼 메모리를 할당하기
2번 방법을 써보자
import tensorflow as tf
from tensorflow.compat.v1 import ConfigProto, InteractiveSession
config=ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction=0.8
session=InteractiveSession(config=config)
그 결과,
파이썬 파일이 정상적으로 실행된다
메모리 사용량도 확인
아래와 같은 이슈가 발생한다
Internal: ptxas exited with non-zero error code 256,
output: Relying on driver to perform ptx compilation.
Modify $PATH to customize ptxas location.
This message will be only logged once.
정확한 원인은 모르겠지만,
해결 방법은 다음과 같다고 한다
1. nvidia driver version을 최신으로 업데이트
2. 메모리 확인 후 ps -ef로 필요없는 메모리 사용량을 확인하고 kill
파이썬 파일이 실행되기는 하니 critical error는 아닌거 같다