If you would like to run CUDA Samples on Jetson Xavier: Open a terminal in the sample you would like to run. For example, on my machine, open a terminal in Home/NVIDIA_CUDA-10.0_Samples/5_Simulations/oceanFFT Make sure the terminal is in that directory. […]
Category: NVIDIA CUDA / GPU Programming
CUDA Device Variables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
//CUDA EDUCATION //CUDA Device Management | cudaLimitPrintfFifoSize | cudaLimitStackSize | cudaLimitMallocHeapSize | A quick overview of device management variables in CUDA //Website: cudaeducation.com //Twitter: @cudaeducation //Email: cudaeducation@gmail.com //YouTube: Cuda Education | Please subscribe //Slack: https://bit.ly/2NBBG4h | Join the workspace //Mailing List: Visit cudaeducation.com to join our mailing list //Donate: Visit cudaeducation.com to donate //DISCLAIMER: Use at your own risk. This code is for teaching purposes only! CUDA Education does not guarantee the accuracy of this code in any way. This code should not be used in a production or commercial environment. Any liabilities or loss resulting from the use of this code, in whole or in part, will not be the responsibility of CUDA Education. //All rights reserved. This code is the property of CUDA Education. Please contact CUDA Education at cudaeducation@gmail.com if you would like to use this code in any way, shape or form. #include "cuda_runtime.h" #include "device_launch_parameters.h" #include <stdio.h> __global__ void cuda_education_device_management() { //CUDA EDUCATION //Website: cudaeducation.com //Twitter: @cudaeducation //Email: cudaeducation@gmail.com //YouTube: Cuda Education | Please subscribe //Donate: Visit cudaeducation.com to donate to the cause } int main() { //initialize size variable size_t size; //START PRINT BUFFER SIZE //set print buffer size //this must be set before launching any kernels cudaDeviceSetLimit(cudaLimitPrintfFifoSize, 1); cudaDeviceGetLimit(&size, cudaLimitPrintfFifoSize); printf("Printf size found to be %d\n", (int)size); //END PRINT BUFFER SIZE //START STACK SIZE //set the size of stack //this must be set before launching any kernels cudaDeviceSetLimit(cudaLimitStackSize, 1); cudaDeviceGetLimit(&size, cudaLimitStackSize); printf("Stack size found to be %d\n", (int)size); //END STACK SIZE //START HEAP SIZE //set the heap size //this must be set before launching any kernels cudaDeviceSetLimit(cudaLimitMallocHeapSize, 1); cudaDeviceGetLimit(&size, cudaLimitMallocHeapSize); printf("Malloc Heap Size found to be %d\n", (int)size); //END HEAP SIZE //get the nVidia GPU running CUDA ready int cuda_education_device = 0; //set the device to be used for CUDA execution cudaSetDevice(cuda_education_device); //launch the CUDA kernel //cuda_education_grid and BLOCK are used as launch parameters cuda_education_device_management << <1, 1 >> > (); //practice good housekeeping by resetting the device when you are done cudaDeviceReset(); //CUDA EDUCATION //Website: cudaeducation.com //Twitter: @cudaeducation //Email: cudaeducation@gmail.com //YouTube: Cuda Education //Donate: Visit cudaeducation.com to donate to the cause } |
Teaching & Consulting sessions available cudaeducation@gmail.com
Setting up Jetson AGX Xavier Developer Kit from a Windows Machine | Oracle VirtualBox | Ubuntu 18.04 LTS
DO NOT USE A VIRTUAL MACHINE! I am having problems running code written on the host machine (VM Ubuntu 18.04 LTS) on the Jetson Xavier. I keep getting a “Exec Format Error” whenever I run remotely on the Jetson Xavier. […]
CUDA Debugging Tutorial | Cuda Education
Donate A brief outline of how to go about debugging you CUDA program. Probably the best way in my opinion is to use printf functionality to print out variable and system state to the console. printf can be used in […]
How to Start Programming your NVIDIA graphics card using CUDA | CUDA Tutorial | GeForce Programming | CUDA Programming
Donate A quick overview of how to program your NVIDIA graphics card using the CUDA programming language. CUDA Toolkit 9 and CUDA Toolkit 10. To get started, visit cudaeducation.com/howtoprogramcuda Teaching & Consulting sessions available cudaeducation@gmail.com Next: CUDA Dynamic […]
OpenCV + CUDA Module | Video Walkthrough (1 hour 30 min.) | CMake Tutorial | Windows 10 | CUDA Toolkit 10 |
Use your NVIDIA GPU to make your computer vision project run faster! Below is a link to a detailed video walkthrough of adding the CUDA module to OpenCV on a Windows-based machine. The video walkthrough is 1 hour and 30 […]
CUDA Dynamic Parallelism Tutorial with Code | Video Walkthrough (59 minutes)
A video walkthrough (59 minutes) of using CUDA dynamic parallelism to achieve some an objective. Includes source code. Click the link below.
Video Walkthrough (21+ min.) of using CUDA Pinned Memory | CudaMallocHost | Make your applications run faster
Learn how to use CUDA Pinned Memory to make your applications run faster. You can’t process if you don’t have the data! Pinned memory is used give your GPU data faster so it can keep busy processing. This is a […]
CUDA Kernel Error | unspecified launch failure | Error: C:/kernel.cu:170, code: 4, reason: unspecified launch failure | TDR Registry Keys | Tdrlevel | Windows Environment
When I try to run CUDA code that takes a long time to process on the GPU, I would always get an error such as the following: Error: C:/kernel.cu:170, code: 4, reason: unspecified launch failure After spending many sleepless nights […]