본문 바로가기
Error Correction

RuntimeError: CUDA error: device-side assert triggeredCUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

by apsdfjoi 2023. 4. 19.
728x90
반응형

장 시간 훈련 뒤, 새 출발하는 마음으로 컴퓨터를 재부팅하고 실행하니 다음과 같은 오류가 발생했다.

cuda kernel에 예기치 않은 오류가 발생했나보다.

해결 방법

import os
os.environ['CUDA_LAUNCH_BLOCKING'] = "1"

import 선언 시 윗 줄을 추가해준다.

cuda kernel을 강제로 동기적으로 실행 시키는 코드이다.

근본적인 해결 방법은 아닌듯 하다.

728x90
반응형

댓글