[오류해결] UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount()

hun_dev·2023년 4월 10일
0

Ubuntu 서버에서 코드를 돌리던 중 다음과 같은 에러를 마주하게 되었습니다.

UserWarning: CUDA initialization: Unexpected error from cudaGetDeviceCount(). Did you run some cuda functions before calling NumCudaDevices() that might have already set an error? Error 804: forward compatibility was attempted on non supported HW (Triggered internally at /opt/conda/conda-bld/pytorch_1670525539683/work/c10/cuda/CUDAFunctions.cpp:109.)

분명 잘 돌아가던 코드였기에 골머리를 앓던 중, 모든 기계에서 발생하는 오류의 가장 좋은 해결법은 reboot이라는 명언이 떠올라 해당 명령어를 입력 후 코드를 재실행하였더니 마법과도 같이 해결되었습니다.

$ sudo reboot

역시 모든 기계에서 발생하는 오류의 가장 좋은 해결법은 reboot입니다.

피드백은 항상 감사히 받습니다. 게시글에 수정해야 할 내용이 있다면 댓글로 알려주세요!

profile
좋아하는 것이 잘하는 것이 될 때까지

0개의 댓글