reallijie

Results 10 comments of reallijie

``` import os os.environ["QT_API"] = "pyqt5" import sys import numpy as np import open3d as o3d from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QTimer from PyQt5.QtWidgets import QWidget from...

``` os win10 64 python 3.8.10 PyQt5 5.15.4 pyqt5-plugins 5.15.4.2.2 PyQt5-Qt 5.15.2 PyQt5-sip 12.11.0 pyqt5-tools 5.15.4.3.2 pyvista 0.35.2 pyvistaqt 0.9.0 QtPy 2.1.0 vtk 9.1.0 ```

```` ERROR:root:init error Traceback (most recent call last): File "test_r.py", line 47, in gpuContext = GpuContext(str(i)) File "test_r.py", line 12, in __init__ self.cuda_context = cuda.Device(0).make_context() pycuda._driver.MemoryError: cuCtxCreate failed: out of...

![111](https://user-images.githubusercontent.com/39477602/146708765-161cfa7e-b6ee-47c6-80a8-65676c50ee75.png) When an exception occurs, how to release the GPU memory, as shown in the figure, 39M GPU memory.

It's not easy to explain. Situation 1: Under normal circumstances, on a laptop (different graphics cards), when all cuda contexts are released, GPU memory is not occupied. On my desktop,...

```` import time import logging import pycuda.driver as cuda # from PyQt5.QtCore import QThread class GpuContext(object): def __init__(self, name=None): self.logging = logging.getLogger('GpuContext - ' + name) self.cuda_context = None self.cuda_context...

![1](https://user-images.githubusercontent.com/39477602/146710275-54d12c3b-50b1-42b4-b2af-d17c2dd0de92.png)

Throwing 10 exceptions, GPU memory occupies 390M.

There may be a problem with the make_context method. prepare_context_switch may cause the context to be switched, but the GPU memory allocation is unsuccessful. Therefore, the pop of the previous...

CuCtxPopCurrent failed: invalid device context exception caused by unsuccessful pop of the previous context. So the GPU memory is not released?