23 questions
1
vote
0
answers
87
views
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 - ...
0
votes
2
answers
335
views
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 ...
0
votes
1
answer
934
views
Direct write to D3D texture from kernel
I am playing around with NVDEC H.264 decoder from NVIDIA CUDA samples, one thing I've found out is once frame is decoded, it's converted from NV12 to BGRA buffer which is allocated on CUDA's side, ...
0
votes
1
answer
1k
views
Texture object fetching in CUDA
I can find many examples online that use CUDA texture references, but not so many that rely on texture objects. I am trying to understand why my code below always fetches 0 rather than my input ...
0
votes
1
answer
600
views
memset cuArray for surface memory
Say you have a cuArray for binding a surface object.
Something of the form:
// These are inputs to a function really.
cudaArray* d_cuArrSurf
cudaSurfaceObject_t * surfImage;
const cudaExtent extent ...
2
votes
1
answer
618
views
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 ...
16
votes
1
answer
4k
views
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 ...
1
vote
1
answer
529
views
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 ...
0
votes
1
answer
78
views
JCuda access violation when creating a texture object with the driver API
I have a JCuda project that's encountering an access violation whenever it tries to create a texture object using the driver API. Java HotSpot claims that the error is coming from nvcuda.dll.
The ...
-1
votes
1
answer
245
views
cuda and opencv:I only want the same as the original picture
I just want to put the test.jpg into the texture memory, and then through the text2D () to show the picture, but the results are very strange. The "result" should be the same as "gray".Click there to ...
0
votes
1
answer
876
views
Pass cuda texture variable as an argument
I have setup the cudaArray, and have bound it to a texture:
texture<float, 2, cudaReadModeElementType> tex;
cudaChannelFormatDesc channelDesc =
cudaCreateChannelDesc(32, 0, 0, 0,...
0
votes
1
answer
2k
views
How to use texture memory for 1D array in CUDA
I wrote following code to see how to use texture memory for 1D array.but tex1D function is not fetching the value from array for corresponding thread id.Please correct this code and tell me how to use ...
2
votes
2
answers
1k
views
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, ...
15
votes
2
answers
3k
views
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, ...
1
vote
2
answers
1k
views
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 ...
0
votes
1
answer
1k
views
CUDA texture object -- incorrect interpolation in non-normalized mode
Non-normalized linear interpolation from a CUDA texture object bound to a CUDA array appears to be returning incorrect results. It appears that the interpolated values are a factor of 0.5 smaller than ...
6
votes
1
answer
6k
views
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), ...
2
votes
2
answers
2k
views
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<float, cudaTextureType2D,cudaReadModeElementType>...
1
vote
2
answers
6k
views
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. ...
0
votes
1
answer
2k
views
cudaMemcpyToArray
I seem to have an issue with the function cudaMemcpyToArray. I have the following commands:
float *h_data = new float[bmp.width * bmp.height];
...
cudaChannelFormatDesc channelDesc = ...
2
votes
1
answer
1k
views
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*()?
1
vote
4
answers
7k
views
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:
...
7
votes
2
answers
9k
views
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 ...