Your First CUDA C Program

  Рет қаралды 314,945

NVIDIA Developer

NVIDIA Developer

Күн бұрын

Пікірлер: 63
@piyushkatariya1040
@piyushkatariya1040 5 жыл бұрын
Very succinct. The only video you need to watch to understand how to parallelize the CPU code to execute on GPU.
@Techforcurious
@Techforcurious 5 жыл бұрын
Thank you for explaining parallel processing using a simple example.
@nathanbrutal4183
@nathanbrutal4183 7 жыл бұрын
Quite intriguing! Most of this is above my level at this time, but this seems like a nice reference for developers.
@TheOtherSteel
@TheOtherSteel Жыл бұрын
I liked your clear explanations and calm pacing, but the text on the computer screen was so tiny I could not read it. (I guessed what was displayed based on your narration, but I would have preferred closer views of the specific sections of code that were discussed.)
@NVIDIADeveloper
@NVIDIADeveloper Жыл бұрын
Thank you for the feedback - will pass this suggestion to the team for future videos.
@kartikpodugu
@kartikpodugu Жыл бұрын
The original code provided when creating a CUDA project in visual studio uses cudaMalloc() and then copies data to GPU. In the example above, cudaMallocManaged() is used. Does that mean cudaMallocManaged() allows us to things using zeroCopy. ?
@amber9040
@amber9040 6 жыл бұрын
The possibilities are endless!
@ddd12343
@ddd12343 5 жыл бұрын
"Exception thrown at 0x00007FF76D3EEEE4 in matrix_addition.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF" It happens in line where we are specifying value of a[i] in for loop: a[i] = i;
@danielpotter9629
@danielpotter9629 6 жыл бұрын
How come CUDA headers do not need to be incuded? And what happens if the number of threads is less than the array size?
@AdoobII25
@AdoobII25 4 жыл бұрын
if you specify 512 threads instead of 1024 then the vector 'c' will hold the summation values up until the 512th index and the other half of 'c' will be zeros. This is because he is using the thread ID of each thread as an index for the vectors a,b and c.
@panikoti731
@panikoti731 5 ай бұрын
for me, they do: #include "cuda_runtime.h" #include "device_launch_parameters.h"
@saigirish3275
@saigirish3275 6 жыл бұрын
I know that GPU's can perform the same operation very quickly. Can you show the time taken for each code to execute and debug and and is there any performance difference in these two codes?
@JackPunter2012
@JackPunter2012 6 жыл бұрын
The Cuda installer installs profiler. If you open a command window where the code is compiled to and use the command "nvprof [filemame]" it will give you some pretty nice performance metrics. There may be a way to do this from within visual studio but i dont know, im trying to get the damn thing to compile from within Visuall studio cause im on CUDA 9.1 in VS 2017 havent found the solution yet :|
@adist821
@adist821 6 жыл бұрын
When i tried debug GPU version i have problem "Exception thrown: write access violation. a was 0x1110112. If there is a handler for this exception, the program may be safely continued." how can I repair this problem? VS 2015 // CUDA 8.0
@alonzoc537
@alonzoc537 5 жыл бұрын
where you using the cuda managed allocation function for it?
@forero910
@forero910 5 жыл бұрын
@@alonzoc537 yes
@forero910
@forero910 5 жыл бұрын
i have VS 2015 with cuda 8.0, and when i tried debug GPU version the same thing happens, do you know how to solve it?
@hao-wenluo1145
@hao-wenluo1145 7 жыл бұрын
Dear: When I run the sample code, it shows that "no kernel image is available for execution on the device", "addWithcuda failed!". I have no idea what's going on. Could you give me some opinions? thanks
@roylevy178
@roylevy178 4 жыл бұрын
It runs for me only when SIZE is defined as 1024. Maybe problem with number of thread blocks?
@xuancao8204
@xuancao8204 5 жыл бұрын
error : operand types are incompatible ("int" and "int *") //CPU; bunch of error in GPU code. VS 2019. CUDA 10.1
@kobilica999
@kobilica999 5 жыл бұрын
int * == pointer to integer
@SachaD88
@SachaD88 4 жыл бұрын
In function __global__ void VectorAdd pointers can not point to constant (NO const int *a, const int *b) only int *a and int *b, even if data of a and b does not changed as in example given. int parameter can be passed only by value int n. (NO const int& n) Otherwise cudaDeviceSynchronize returns 0x700 error IllegalAddress.
@sandeepshetty1589
@sandeepshetty1589 6 жыл бұрын
is there a way to redefine a static array (not heap allocated, so obviously can not use cudaMallocManaged) in to a unified memory space?
@benjaminf.3760
@benjaminf.3760 6 жыл бұрын
Very good! More please :)
@jvillemare
@jvillemare 4 жыл бұрын
Same thing with my Visual Studio: Why does it have red lines under the cudaFree saying the method doesn't exist, but it compiles? This is a real whacky problem.
@panikoti731
@panikoti731 5 ай бұрын
#include "cuda_runtime.h" #include "device_launch_parameters.h"
@AngeloHafner
@AngeloHafner Жыл бұрын
Muito obrigado por compartilhar este conhecimento...👏👏👏👏👏👏
@diegolink77
@diegolink77 5 жыл бұрын
When I compile the program its ok but when I try tu run it i have a segmentation fault, i tried many solutions to solve it but its the same problem, I find that the reason is for the initial pointers, they are pointing to a null position or some like that, please someone can help me with this. Thanks
@saikiranreddy6901
@saikiranreddy6901 6 жыл бұрын
do we require a system with NVIDIA gpu to run this code ?
@RafaelBadain
@RafaelBadain 6 жыл бұрын
I believe that programs written with CUDA libraries aims at code optimization for GPU processing, so it doesn't make much sense to me run a program optimized for a non-existent GPU in your system.
@touisbetterthanpi
@touisbetterthanpi 6 жыл бұрын
Rafael Badain there are non nividia gpus though
@aytraf
@aytraf 4 жыл бұрын
"OBVIOUSLY", CUDA is a Nvidia tech, wouldn't work with other GPU's. It's platform-specific.
@Rocket62AL
@Rocket62AL 5 жыл бұрын
Very good, thanks
@saisrikanthavadhanula
@saisrikanthavadhanula 7 жыл бұрын
The code is running fine when I am running with CPU code , but when I add GPU code and debug its prompts that the program_name.exe has stopped working I am using visual studio 2017 and CUDA version 9.0
@abdjanshvamdjsj
@abdjanshvamdjsj 6 жыл бұрын
Hi Srikant, it is a visual studio issue rather than a CUDA issue. Just choose Release and x64, before building the solution.
@kashifzaheer7804
@kashifzaheer7804 6 жыл бұрын
hello gentleman why it does not work for visual studio 2017 and cuda version 10.0. any specific reasons
@viswanathansankar3789
@viswanathansankar3789 5 жыл бұрын
@@kashifzaheer7804 yes for me also its not working. I also using the same
@ChristianWidjaya_CW
@ChristianWidjaya_CW 5 жыл бұрын
@@kashifzaheer7804 use vs 2019 preview with latest 10.1 + nvidia driver
@SNIPER-my1vo
@SNIPER-my1vo 5 жыл бұрын
maybe im the only one that cant figure this out but new to running code for gpu how the hell do you convert it to cpu code not a very good demonstration on this it seams like he is using hot keys to switch it and I don't know any help please.
@Jasterthemaster
@Jasterthemaster 5 жыл бұрын
yea he CTRL+V pasted code he had in his clipboard you would have to pause the video and write it all out to have the same code as he pasted
@nathanbrutal4183
@nathanbrutal4183 7 жыл бұрын
15,000 subscribers even!
@AramAzhari
@AramAzhari 6 жыл бұрын
The latest cuda 9.1 doesn't get compiled on latest visual studio 2017 (_MSR_VER = 1912). even if i edit the config header of default cuda runtime project it still doesn't compile.
@saikiranreddy6901
@saikiranreddy6901 6 жыл бұрын
Aram Azhari hiii
@saikiranreddy6901
@saikiranreddy6901 6 жыл бұрын
Do I need to have a NVIDIA GPU to run this code ?
@jcw781
@jcw781 5 жыл бұрын
@@saikiranreddy6901 Yes
@sabrango
@sabrango 4 жыл бұрын
THx!
@ioannismichalopoulos4173
@ioannismichalopoulos4173 4 жыл бұрын
.c files compiles and runs properly while .cu file compiles and when it runs, it produces no output (and no errors)!
@abdjanshvamdjsj
@abdjanshvamdjsj 6 жыл бұрын
The program crashes when run on the CUDA version.
@panikoti731
@panikoti731 5 ай бұрын
#include "cuda_runtime.h" #include "device_launch_parameters.h"
@ramyasrigorle2609
@ramyasrigorle2609 Жыл бұрын
I got assert error
@sastavideoswala
@sastavideoswala 10 ай бұрын
First program should have been hello world.
@MaxCoplan
@MaxCoplan 5 жыл бұрын
This man is making this in 2017 while using an IDE looking like it's from 2007
@ChristopherGray00
@ChristopherGray00 Жыл бұрын
that's because its not dark mode, dark mode visual studio looks better
@lancelotxavier9084
@lancelotxavier9084 Жыл бұрын
Make CUDA open source!
@404Negative
@404Negative 6 жыл бұрын
does it works on Radeon ??
@tovarisch3039
@tovarisch3039 6 жыл бұрын
I doubt that very highly
@stc2828
@stc2828 6 жыл бұрын
Lol you are on the wrong site
@404Negative
@404Negative 6 жыл бұрын
Hello Woooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooorld
@SuhelAhmed-hs1jm
@SuhelAhmed-hs1jm Жыл бұрын
Abc
@cheonseok84
@cheonseok84 5 жыл бұрын
thank you for your video. it is very helpful/ here is the man who teach CUDA in korea. he is AI proffessional lecturer teaching Machine learning, CUDA, Aibril, etx website 'blog.naver.com/cheonseok84/220876018626'
@kasunchamara7497
@kasunchamara7497 5 жыл бұрын
Painful Indian English Accent.... Its Always Feel The Difference
@regielb1
@regielb1 5 жыл бұрын
You call yourself a "cuda developer" - heaven help us all. You don't know how to do a proper presentation. I can't imagine why people like this "example"
@dstgre
@dstgre 7 ай бұрын
Are true CUDA developers presentation experts?
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 561 М.
Добро пожаловать в C++
16:08
Winderton
Рет қаралды 472 М.
She's very CREATIVE💡💦 #camping #survival #bushcraft #outdoors #lifehack
00:26
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 11 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 112 МЛН
From Scratch: Matrix Multiplication in CUDA
30:37
CoffeeBeforeArch
Рет қаралды 21 М.
you need to stop using print debugging (do THIS instead)
7:07
Low Level
Рет қаралды 438 М.
CUDA Simply Explained - GPU vs CPU Parallel Computing for Beginners
19:11
Python Simplified
Рет қаралды 261 М.
Should I pass by const reference or by value?
10:45
The Cherno
Рет қаралды 106 М.
Nvidia CUDA in 100 Seconds
3:13
Fireship
Рет қаралды 1,3 МЛН
Intro to GPU Programming
39:00
Tom Nurkkala
Рет қаралды 34 М.
Intro to CUDA (part 1): High Level Concepts
9:26
Josh Holloway
Рет қаралды 85 М.
why is it illegal to use "goto"?
5:23
Low Level
Рет қаралды 261 М.
Intro to CUDA (part 3): Parallelizing a For-Loop
7:11
Josh Holloway
Рет қаралды 34 М.