Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

In the same process, decoding and reasoning will cause GPU video memory leakage #435

@SubMarineas

Description

@SubMarineas

The problem is that when I add resnet or yolo to VPF as a thread, I find that GPU increases rapidly until out of memory. The code is:

class VPF_decode_inference(object):
     
    def run(self):
        self.rtsp_list = ["rtmp://192.168.1.229/live/mytest",]
        # cuda.init()
        decode_thread_pool = []
        gpu_id = 0
        yolo_thread_pool = []
        for i in range(0, 25):
            thread = Thread(target = VPF_decode_inference.decode,args=[self,gpu_id, "rtmp://192.168.1.229/live/mytest",i])
            thread.start()
            decode_thread_pool.append(thread)
        for thread in decode_thread_pool:
            thread.join()
        for i in range(1):
            vpf_yolo_obj = yolo_inference(gpu_id)
            yolo_thread  = Thread(target = yolo_inference.inference,args=[vpf_yolo_obj])
            yolo_thread.start()
            yolo_thread.join()


class yolo_inference(object):
    pass


if __name__ == "__main__":
    gpu_id = 0
    
    for i in range(1):
        vpf_decode = VPF_decode_inference(0)
        p = Process(target=VPF_decode_inference.run,args=(vpf_decode,))
        p.start()
    time.sleep()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions