
cuda
luoganttcc
微信:luogantt2
展开
-
ubuntu.24安装cuda
1.下载CUDA Toolkit。2.按照命令下载,安装。原创 2024-11-17 21:51:48 · 1519 阅读 · 0 评论 -
最小 CUDA 示例 cudaMalloc
【代码】最小 CUDA 示例 cudaMalloc。原创 2024-10-28 23:09:58 · 117 阅读 · 0 评论 -
英伟达技术博客
link原创 2024-10-26 13:18:38 · 128 阅读 · 0 评论 -
如何学习cuda编程?
大致的知道要coalesced access,用vectorized datatype,以及大致的知道 atomics 慢,要避免 bank conflict, 但不是很懂architecture。我的领导就是我见过的最纯粹的体系结构派,碰到问题不是先写代码,而是先建一个excel表格来估算我们最好/最差的情况预期能达到怎样的效率。我觉得计算机专业出身的话,可能学习的路径是反过来的。更新下上手之后对我帮助比较大的一些资料,这个时候对计算机底层不是很了解,做的东西还是浮于算法表面。以上是我自己的学习路径。原创 2024-10-26 12:44:42 · 894 阅读 · 0 评论 -
线程层次结构
原创 2024-10-26 09:25:14 · 84 阅读 · 0 评论 -
Solving environment: failed错误解决方法
【代码】终于彻底解决了conda install速度慢的问题。原创 2023-03-31 21:01:21 · 398 阅读 · 0 评论 -
终于彻底解决了conda install速度慢的问题
【代码】终于彻底解决了conda install速度慢的问题。原创 2023-03-30 18:00:20 · 713 阅读 · 0 评论 -
CUDA入门教程
推荐几个不错的CUDA入门教程(非广告)godweiyang字节跳动 AI Lab NLP算法工程师关注他1,089 人赞同了该文章❝ 最近因为项目需要,入坑了CUDA,又要开始写很久没碰的C++了。对于CUDA编程以及它所需要的GPU、计算机组成、操作系统等基础知识,我基本上都忘光了,因此也翻了不少教程。这里简单整理一下,给同样有入门需求的同学们参考一下。 ❞官方文档及书籍英文好、时间充裕的同学可以精读官方文档或者著作。NVIDIA CUDA C++ Programming Guide「地址:」 h原创 2022-03-14 11:08:08 · 5872 阅读 · 0 评论 -
查询gpu 参数
代码在git#include "error.cuh"#include <stdio.h>int main(int argc, char *argv[]){ int device_id = 0; if (argc > 1) device_id = atoi(argv[1]); //CHECK(cudaSetDevice(device_id)); cudaDeviceProp prop; //CHECK(cudaGetDeviceProper原创 2022-03-14 10:50:14 · 345 阅读 · 0 评论 -
cuda 编 程(10) cuda 并行加速时间对比
代码在gitnvcc add1cpu.cu -o add1cpu./add1cpuTime = 352.801 ms.Time = 222.614 ms.Time = 223.758 ms.Time = 224.543 ms.Time = 223.666 ms.Time = 222.695 ms.Time = 223.809 ms.Time = 222.556 ms.Time = 222.363 ms.Time = 221.945 ms.Time = 222.848 ms.Ti原创 2022-03-12 10:24:06 · 688 阅读 · 0 评论 -
cuda 编 程(9)Error checking in CUDA programs demo
error.cuh#pragma once#include <stdio.h>#define CHECK(call) \do \{ \ const cudaError_t error_code = call原创 2022-03-11 18:27:47 · 560 阅读 · 0 评论 -
Chapter 4: Error checking in CUDA programs
In this chapter, we show how to check CUDA runtime API functions and CUDA kernels.4.1 A macro function checking CUDA runtime API functionsIn the last chapter, we have learned some CUDA runtime API functions, such as cudaMalloc, cudaFree, and cudaMemcpy..原创 2022-03-11 17:35:27 · 255 阅读 · 0 评论 -
cuda 编 程(8)定义device函数
#include <math.h>#include <stdio.h>const double EPSILON = 1.0e-15;const double a = 1.23;const double b = 2.34;const double c = 3.57;void __global__ add1(const double *x, const double *y, double *z, const int N);void __global__ add2(cons原创 2022-03-11 17:12:31 · 640 阅读 · 0 评论 -
cuda 编 程(7)cuda 实现向量加法
#include <math.h>#include <stdio.h>#include <iostream>using namespace std;const double EPSILON = 1.0e-15;const double a = 1.23;const double b = 2.34;const double c = 3.57;void __global__ add(const double *x, const double *y, doub原创 2022-03-11 16:43:28 · 776 阅读 · 0 评论 -
cuda 编 程(六)简单CUDA程序的基本框架
简单CUDA程序的基本框架包含头文件const 或宏定义C++ 函数和CUDA 内核的声明主函数 (){分配主机和设备内存初始化主机内存中的数据将数据从主机传输到设备启动(调用)内核在设备中进行计算将数据从设备传输到主机释放主机和设备内存}C++ 函数和CUDA 内核的定义...原创 2022-03-11 13:56:16 · 1379 阅读 · 0 评论 -
cuda 编 程(五) c++版本demo
#include <math.h>#include <stdlib.h>#include <stdio.h>#include <iostream>using namespace std;const double EPSILON = 1.0e-15;const double a = 1.23;const double b = 2.34;const double c = 3.57;void add(const double *x, const原创 2022-03-11 13:52:13 · 873 阅读 · 0 评论 -
cuda 编 程(四) helloworld 打印grid 与block
#include <stdio.h>#include <iostream>using namespace std;__global__ void hello_from_gpu(){ const int b = blockIdx.x; const int c = blockIdx.y; const int tx = threadIdx.x; const int ty = threadIdx.y; // cout<<b<原创 2022-03-11 12:53:38 · 223 阅读 · 0 评论 -
cuda 编 程(三) helloworld 打印 blockIdx和threadIdx.x threadIdx.y
#include <stdio.h>#include <iostream>using namespace std;__global__ void hello_from_gpu(){ const int b = blockIdx.x; const int tx = threadIdx.x; const int ty = threadIdx.y; // cout<<b<<endl; printf("Hello Wor原创 2022-03-11 12:47:51 · 676 阅读 · 0 评论 -
cuda 编程 (二) helloworld 打印 blockIdx和threadIdx
#include <stdio.h>__global__ void hello_from_gpu(){ const int bid = blockIdx.x; const int tid = threadIdx.x; printf("Hello World from block %d and thread %d!\n", bid, tid);}int main(void){ hello_from_gpu<<<2, 4>>原创 2022-03-11 11:03:30 · 1233 阅读 · 0 评论 -
cuda 编程 (一) helloworld
#include <stdio.h>__global__ void hello_from_gpu(){ printf("Hello World from the GPU!\n");}int main(void){ hello_from_gpu<<<2, 4>>>(); cudaDeviceSynchronize(); return 0;}nvcc hello3.cu -o hello3Hello Worl原创 2022-03-11 11:01:18 · 865 阅读 · 0 评论 -
Ubuntu 20.04 安装 cuda10报错 Error: unsupported compiler: 9.4.0. Use --override to override this check.
Error: unsupported compiler: 9.4.0. Use --override to override this check. Missing recommended library: libGLU.so Missing recommended library: libX11.so Missing recommended library: libXi.so Missing recommended library: libXmu.so Missing recommended libra在原创 2022-01-21 16:31:05 · 17457 阅读 · 1 评论 -
Ubuntu环境下挂载新硬盘 --硬盘要挂载在某个文件夹下面
Ubuntu环境下挂载新硬盘Ubuntu环境下挂载新硬盘可以参考这两个教程,在挂载的时候,下面的代码报错sudo mount -t ext4 /dev/sdb /devdata原因是硬盘要挂载在某个文件夹下面mkdir /mnt/devdatasudo mount -t ext4 /dev/sdb /devdata...原创 2022-01-20 14:07:15 · 405 阅读 · 0 评论 -
cuda grid 和block理解(二)
dim3 grid(3, 2);dim3 block(5, 3);可以转置一下理解#include <stdio.h>#include <iostream>using namespace std;__global__ void hello_from_gpu(){ const int b = blockIdx.x; const int c = blockIdx.y; const int tx = threadIdx.x; co原创 2021-12-06 18:23:55 · 587 阅读 · 0 评论 -
cuda grid 和block理解(一)
#include <stdio.h>#include <iostream>using namespace std;__global__ void hello_from_gpu(){ const int b = blockIdx.x; const int tx = threadIdx.x; const int ty = threadIdx.y; // cout<<b<<endl; printf("Hello Wor原创 2021-12-06 18:19:58 · 487 阅读 · 0 评论 -
cuda blockIdx.x 和 threadIdx.x
git#include <stdio.h>__global__ void hello_from_gpu(){ const int bid = blockIdx.x; const int tid = threadIdx.x; printf("Hello World from block %d and thread %d!\n", bid, tid);}int main(void){ hello_from_gpu<<<2, 4>原创 2021-12-06 16:41:41 · 881 阅读 · 0 评论 -
GPU中的几个基本概念
物理概念:streaming processor(sp): 最基本的处理单元。GPU进行并行计算,也就是很多个sp同时做处理。现在SP的术语已经有点弱化了,而是直接使用thread来代替。一个SP对应一个threadWarp:warp是SM调度和执行的基础概念,通常一个SM中的SP(thread)会分成几个warp(也就是SP在SM中是进行分组的,物理上进行的分组),一般每一个WARP中有32个thread.这个WARP中的32个thread(sp)是一起工作的,执行相同的指令,如果没有这么多t原创 2021-12-06 14:01:07 · 726 阅读 · 0 评论 -
推荐几个不错的CUDA入门教程(非广告)
link❝ 最近因为项目需要,入坑了CUDA,又要开始写很久没碰的C++了。对于CUDA编程以及它所需要的GPU、计算机组成、操作系统等基础知识,我基本上都忘光了,因此也翻了不少教程。这里简单整理一下,给同样有入门需求的同学们参考一下。...原创 2021-12-02 12:30:54 · 2866 阅读 · 0 评论 -
cuda 编程(3)基本介绍
Chapter 3 Basic framework of simple CUDA programs3.1 An example: adding up two arraysWe consider a simple task: adding up two arrays of the same length (same number of elements). We first write a C++ program add.cpp solving this problem. It can be compil原创 2021-12-02 11:51:04 · 331 阅读 · 0 评论 -
cuda 编程(1 ) intoduction
Chapter 1: Introduction to GPU and CUDA1.1 Introduction to GPUGPU means graphics processing unit, which is usually compared to CPU (central processing unit). While a typical CPU has a few relatively fast cores, a typical GPU has hundreds or thousands of原创 2021-12-02 11:44:49 · 380 阅读 · 0 评论 -
cuda 编程(2 )hello world
Chapter 2: Thread Organization in CUDAWe start with the simplest CUDA program: printing a Hello World string from the GPU.2.1 A Hello World Program in C++To master CUDA C++, one must first master C++, but we still begin with one of the simplest C++ prog原创 2021-12-02 11:41:39 · 979 阅读 · 0 评论 -
cuda 代码与文章
github谭升的博客原创 2021-11-30 22:30:52 · 178 阅读 · 0 评论 -
CUDA编程之快速入门
链接转载 2020-04-24 21:20:16 · 364 阅读 · 0 评论 -
jetson nano包安装
nano 上安装 anacondanano install opencvnano install pytorchnano install opencv4.1原创 2020-04-17 20:23:35 · 609 阅读 · 0 评论 -
如何卸载cuda
============ Summary ============Driver: InstalledToolkit: Installed in /usr/local/cuda-10.2/Samples: Installed in /home/game/, but missing recommended librariesPlease make sure that - ...原创 2020-04-13 21:38:39 · 2652 阅读 · 3 评论 -
卸载 nvidia 显卡驱动
sudo apt-get purge nvidia*reboot原创 2018-09-27 18:39:59 · 4291 阅读 · 0 评论 -
历史版本的cuda
链接原创 2018-09-27 12:07:51 · 1606 阅读 · 0 评论