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.

How to perform GPU memory copy. #297

@npkhgl

Description

@npkhgl

Hi, I got some troubles about GPU memory copy.
rgb24.PlanePtr().Export(surface_tensor.data_ptr(), w * 3, gpuID) # this works fine for me
However, when I tried to use pycuda to perform the GPU memory copy, it failed. The codes I used:

import pycuda.autoinit
import pycuda.driver as cudrv
texbufs_memcpy = cudrv.Memcpy2D()
# texbufs_memcpy.width_in_bytes = w * 3
texbufs_memcpy.width = w * 3
# texbufs_memcpy.height = h
texbufs_memcpy.set_src_device(rgb24.PlanePtr().GpuMem())
texbufs_memcpy.set_dst_device(surface_tensor.data_ptr())
texbufs_memcpy(aligned=True)

Could you give me some help? Thanks a lot.

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