Questions tagged [cuda-arrays]

GPU arrays are opaque memory layouts optimized for texture fetching (interpolation, multi-dimensional locality). They have dimensionality of 1, 2 or 3. The OpenCL term for them is "images".

24 questions
15
votes
2 answers

CUDA cube map textures

How to deal with OpenGL cube map textures in CUDA? When one want to use OpenGL textures in CUDA kernel one of the things to do is to retrieve a CUDA array from registered image and mapped resource, in this case a texture. In driver API it is done by…
Dori
  • 675
  • 1
  • 7
  • 26
12
votes
1 answer

Use Vulkan VkImage as a CUDA cuArray

What is the correct way of using a Vulkan VkImage as a CUDA cuArray? I've been trying to follow some examples, however I get a CUDA_ERROR_INVALID_VALUE on a call to cuExternalMemoryGetMappedMipmappedArray() To provide the information in an ordered…
jsantander
  • 4,972
  • 16
  • 27
7
votes
2 answers

How to read back a CUDA Texture for testing?

Ok, so far, I can create an array on the host computer (of type float), and copy it to the gpu, then bring it back to the host as another array (to test if the copy was successful by comparing to the original). I then create a CUDA array from the…
hwrd
  • 2,134
  • 6
  • 29
  • 36
6
votes
1 answer

How to access each channel of a pixel using cuda tex2D

I'm learning cuda texture memory. Now, I got a opencv Iplimage, and I get its imagedata. Then I bind a texture to this uchar array, like below: Iplimage *image = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3); unsigned char* imageDataArray =…
hakunami
  • 2,351
  • 4
  • 31
  • 50
2
votes
1 answer

Limit GPU Memory in Julia using CuArrays

I'm fairly new to julia and I'm currently trying out some deep convolution networks with recurrent structures. I'm training the networks on a GPU using CuArrays(CUDA Version 9.0). Having two separate GPU's, I started two instances with different…
SeVe
  • 354
  • 1
  • 6
2
votes
2 answers

How to create and use a 1D layered texture in CUDA

I am new to CUDA. I have figured out how to do 1D and 2D textures in CUDA. However, I am struggling with how to use a 1D layered texture. The output of my kernel which uses the texture is all zeros, which is definitely incorrect. However, I am not…
Rehman Ali
  • 51
  • 3
2
votes
2 answers

Cuda cudaGetTextureReference returns "invalid texture reference"

Im developing a small cuda lib, stuck by this annoying tex ref issue. This is the sample code from Cuda C Programming Guide, Page43~44: texture texRef; textureReference*…
Defd
  • 470
  • 3
  • 16
2
votes
1 answer

Is it possible to run cuMemset on a CUarray?

I have a CUarray that I got from my OpenGL-context via cuGraphicsSubResourceGetMappedArray(). Is there a possiblity to use it with cuMemset*()?
morph
  • 305
  • 2
  • 12
1
vote
0 answers

How do I copy 2D CUDA arrays/textures between contexts?

Suppose I want to copy some memory between different CUDA contexts (possibly on different devices). The CUDA Driver API offers me: cuMemcpyPeer - for plain old device global memory cuMemcpy3DPeer - for 3D arrays/textures But there doesn't seem to…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
4 answers

CUDA: Allocating 2D array on GPU

I have already read the following thread , but I couldn't get my code to work. I am trying to allocate a 2D array on GPU, fill it with values, and copy it back to the CPU. My code is as follows: __global__ void Kernel(char **result,int N) { //do…
lina
  • 1,679
  • 4
  • 21
  • 25
1
vote
1 answer

Cuda create texture object from black/white image

I'm trying to process a video, frame by frame. To do this I want to create a texture containing the current frame and pass it to the kernel. The frames are 1440*1080 pixel with each pixel being represented by an unsigned char, e.g. 8 bit. I followed…
octavio
  • 456
  • 4
  • 14
1
vote
0 answers

CUDA surface memory unbind

When using texture memory in CUDA, we call cudaBindTextureToArray(texRef, cuArray, channelDesc), use the texture, and then unbind it: cudaUnbindTexture(texRef); With surface memory, there is an analogous cudaBindSurfaceToArray(surfRef,…
1
vote
2 answers

CUDA texture as a class member?

Attempting to define a class with a per-instance texture. Yes, the number of instances of that class will be small. To work around the restriction that CUDA texture must be a global variable, I tried the following approach: Define a global table of…
1
vote
2 answers

Read cudaArray in device code

Is there a way to read the values in a cudaArray from the device without wrapping it in a texture reference/object? All of the examples I've looked at use cudaArrays exclusively for creating textures. Is that the only way they can be used, or could…
agrippa
  • 379
  • 5
  • 19
0
votes
2 answers

Why are my 2D array copy parameters being rejected by the driver API?

I'm trying to use the CUDA Driver API to copy data into a 2D array, in the program listed below, but am getting an "invalid value" error when I pass my copy parameters. What value in them is wrong? #include #include #include…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
2