NVIDIA / NVIDIA/cuda-samples

Incorrect texture address mode in convolutionFFT2D sample

Open
#176 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
9.6k
Forks
2.4k
Avg merge
53m
Merged PRs (30d)
1

Description

According to https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#texture-memory

cudaAddressModeWrap and cudaAddressModeMirror are only supported for normalized texture coordinates

In "convolutionFFT2D.cu" the texture address mode is set as "cudaAddressModeWrap" and coordinates isn't set as normalized. For example:

extern "C" void padKernel(float *d_Dst, float *d_Src, int fftH, int fftW,
int kernelH, int kernelW, int kernelY, int kernelX) {
...

texDescr.normalizedCoords = false;
texDescr.filterMode = cudaFilterModeLinear;
texDescr.addressMode[0] = cudaAddressModeWrap; // This address mode is only supported for normalized texture coordinates.
texDescr.readMode = cudaReadModeElementType;
...
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with convolutionFFT2D.cu and inspect the padKernel texture descriptor, especially normalizedCoords and addressMode[0]. Compare the configuration with the CUDA texture-memory documentation cited in the issue. Done means the sample no longer uses an unsupported address-mode and remains consistent with its coordinate configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.