본문 바로가기

Error and Solve

[에러 해결] RuntimeError Cuda Error : invalid argument / os.environ['CUDA_LAUNCH_BLOCKING'] = '1' 추가하기

반응형

 

 

오류 : Runtime Error Cuda Error : invalid argument

 

 

RuntimeError: CUDA error: invalid argument
CUDA 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.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

RuntimeError: CUDA error: invalid argument
CUDA 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.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

 

 

RuntimeError CUDA error invalid argument 에러가 났다. 

 

 

 

 

 

 

해결: os.environ['CUDA_LAUNCH_BLOCKING'] = '1'  추가하기

 

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

 

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

 

돌리는 파일에 위의 설정을 추가해준다 

 

 

 


 

Reference

 

https://velog.io/@pswo1021/CUDA-ERROR-%ED%95%B4%EA%B2%B0

 

[Solved] CUDA ERROR

RuntimeError: CUDA error: an illegal instruction was encounteredCUDA kernel errors might be asynchronously reported at some other API call, so the sta

velog.io

 

 

End.

 

 

반응형