Passer1072/RookieAI_yolov8

关于RuntimeError: CUDA error: an illegal memory access was encountered的报错求助

Closed this issue · 3 comments

你好,我在使用trt模型时之前是正常的,但是因为c盘爆红,我不小心清理了虚拟内存,导致帧数暴跌,甚至出些个位数后卡顿然后报错如下,我在网上寻找了办法,依然没有解决,我将虚拟内存开到40个g也没有解决,我的显卡是3070laptop,还请麻烦提供一下帮助,谢谢

[08/22/2024-14:10:44] [TRT] [E] IExecutionContext::executeV2: Error Code 1: Cuda Runtime (an illegal memory access was encountered)
Exception in thread Thread-2 (main_program_loop):
Traceback (most recent call last):
File "D:\aimbot\anaconda\envs\cheater\Lib\threading.py", line 1045, in _bootstrap_inner
self.run()
File "D:\aimbot\anaconda\envs\cheater\Lib\threading.py", line 982, in run
self._target(*self._args, **self.kwargs)
File "D:\aimbot\RookieAI_yolov8\RookieAI_yolov8.py", line 2427, in main_program_loop
results = model.predict(frame, save=False, conf=confidence, half=True, agnostic_nms=True, iou=0.7, classes=[
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\engine\model.py", line 563, in predict
return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\engine\predictor.py", line 168, in call
return list(self.stream_inference(source, model, *args, **kwargs)) # merge list of Result into one
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context
response = gen.send(None)
^^^^^^^^^^^^^^
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\engine\predictor.py", line 253, in stream_inference
with profilers[1]:
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\utils\ops.py", line 51, in exit
self.dt = self.time() - self.start # delta-time
^^^^^^^^^^^
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\utils\ops.py", line 61, in time
torch.cuda.synchronize(self.device)
File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\torch\cuda_init
.py", line 801, in synchronize
return torch._C._cuda_synchronize()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: an illegal memory access was encountered
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.

cuda无法访问指定内存,请尝试重新安装cuda或进行冷重启以及系统更新

My account has been stolen and they are sending junk emails or links all over the place. I've changed my password. I'm sorry for what you've received.
1propanol

你好,我在使用trt模型时之前是正常的,但是因为c盘爆红,我不小心清理了虚拟内存,导致帧数暴跌,甚至出些个位数后卡顿然后报错如下,我在网上寻找了办法,依然没有解决,我将虚拟内存开到40个g也没有解决,我的显卡是3070laptop,还请麻烦提供一下帮助,谢谢

[08/22/2024-14:10:44] [TRT] [E] IExecutionContext::executeV2: Error Code 1: Cuda Runtime (an illegal memory access was encountered) Exception in thread Thread-2 (main_program_loop): Traceback (most recent call last): File "D:\aimbot\anaconda\envs\cheater\Lib\threading.py", line 1045, in _bootstrap_inner self.run() File "D:\aimbot\anaconda\envs\cheater\Lib\threading.py", line 982, in run self._target(*self.args, **self.kwargs) File "D:\aimbot\RookieAI_yolov8\RookieAI_yolov8.py", line 2427, in main_program_loop results = model.predict(frame, save=False, conf=confidence, half=True, agnostic_nms=True, iou=0.7, classes=[ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\engine\model.py", line 563, in predict return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\engine\predictor.py", line 168, in call return list(self.stream_inference(source, model, *args, **kwargs)) # merge list of Result into one ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\torch\utils_contextlib.py", line 35, in generator_context response = gen.send(None) ^^^^^^^^^^^^^^ File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\engine\predictor.py", line 253, in stream_inference with profilers[1]: File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\utils\ops.py", line 51, in exit self.dt = self.time() - self.start # delta-time ^^^^^^^^^^^ File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\ultralytics\utils\ops.py", line 61, in time torch.cuda.synchronize(self.device) File "D:\aimbot\anaconda\envs\cheater\Lib\site-packages\torch\cuda__init.py", line 801, in synchronize return torch._C._cuda_synchronize() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: CUDA error: an illegal memory access was encountered 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.

尝试重新安装CUDA环境,如果不起作用建议直接重装系统或采用双系统。