I have a tensor of size {height, width, 3 channels} with uin8_t format. I used the interoperability with OpenGL to link a cuda array to a GL_TEXTURE_2D. I init the texture with :
GL_RGB8, Width, Height, GL_RGB, GL_UNSIGNED_BYTE.
I show by OpenCv the tensor to show that is correct and does not have an issue (see the picture called “show_byte” below).
So I use to put it in the OpenGL Texture this method :
cudaMemcpy2DToArray( cudaArray pointer, 0, 0, tensor.data_ptr<uint8_t>(), (spitch) Width x 3, Width x 3, Height, cudaMemcpyDeviceToDevice);
spitch = Width*3 because it’s a RGB image with data of 1 byte.
But, unfortunately I have the all image data in the Texture but with an issue with the width (see the picture called “Texture output 4”) :
If someone could give me ideas to solve my issue. Thanks.
