Code Monkey home page Code Monkey logo

cuda_programming's People

Contributors

coffeebeforearch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuda_programming's Issues

Assertion `temp == result[i]' failed.

Please note that when I attempt to run your ~/1d_constant_memory/convolution.cu with CUDA compilation tools, release 7.5, V7.5.17 on Ubuntu 16.04, I am getting these errors.

~/Resources/Github/cuda_programming/convolution/1d_constant_memory $ nvcc convolution.cu -o convolution.x 
~/Resources/Github/cuda_programming/convolution/1d_constant_memory $ ./convolution.x 
convolution.x: convolution.cu:58: void verify_result(int*, int*, int*, int): Assertion `temp == result[i]' failed.
aborted (core dumped)

Do you have any suggestions? TIA.

Unexpected results with Memory Coalescing

Hi, I am using the following system configuration:

  • Windows 10
  • Visual Studio 2019 Community
  • Cuda 10.2
  • Nvidia Nsight Compute 2019.5.0
  • Nvidia RTX 2060 GPU (Turing Architecture)

I am following your tutorials on YouTube and used the file alignment_matrix_mul.cu, in three configuartions:

  • No transpose (just as we were doing it before)
  • Transpose a matrix (temp_sum += a[k * n + row] * b[col + n * k];)
  • Transpose b matrix (temp_sum += a[k + n * row] * b[col * n + k];)

We would expect that the GPU would perform best when we transpose matrix a, as the memory accesses for each thread are coalesced in this way, but the profiling shows that it performs better when I transpose matrix b.

The only thing that I am doing different here is that I am using Nsight Compute as a separate application to profile the built binary from Visual Studio and not the inbuilt extension. I am also attaching the performance images I got:

I have double checked the transpositions and this is what I get. Can there be any other bottleneck causing these results? i.e. the cost of fetching multiple elements for the loop (index k) overpowers the coalesced access?

Consulting

Hi @CoffeeBeforeArch,

I'm not sure where else to put this, as I don't have a twitter account and don't plan on getting one + verified just to get in touch.

Is there any chance you do consulting? If so, would you be open to being hired for a few hours to help me optimize a specific kernel?

Thanks very much,
Ian

example vectorAdd c is zero after adding

I am using

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

running the example return :

vectorAdd.cu:24: void verify_result(std::vector<int>&, std::vector<int>&, std::vector<int>&): Assertion `c[i] == a[i] + b[i]' failed.
[1]    49753 abort (core dumped)  ./prog

if I print few first elements of a, b, c after running kernel and copy data from device to host it returns all elements of c is zero.

profiling cuda code with Nvidia Nsight

Hi nick, i'm trying to profile the matrix multiplication cuda code, it is the same as your naive matrix multiplication code with nvidia Nsight, i tried with 1<<10 and it worked, and i tried with 1<<11 and the profiler didn't catch the kernel launch. i have nvidia GTX 960M gpu.
so is it the problem with my gpu capability or there is something else wrong?
thanks in advance.

hello nick

where is the CUDA Crash Course (v3) series ? i can't find it on youtube😢

issue with vector-addion.cu

Hey Nick,
I am getting an error in / Boundary Check
if (tid < N) c[tid] = a[tid] + b[tid];
but when i corrected according to vs suggestion to / Boundary Check
if (tid < N) c[tid] == a[tid] + b[tid];
then it says warning #174-D: expression has no effect
1> if (tid < N) c[tid] == a[tid] + b[tid];
However, after this warning, it showed "completed successfully" .
I used the VS-2022 community. Can you please explain what happened, I am still confused

Also, when I compile the same program with nvcc on WSL2-ubuntu 20.2 it says
vector-add.cu(26): warning #174-D: expression has no effect
but the compilation was done and on running the output file give this -
vector-add: vector-add.cu:33: void verify_result(std::vector&, std::vector&, std::vector&): Assertion `c[i] == a[i] + b[i]' failed.
Aborted

Can you please help me out with the same

Regards
Pronod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.