cuda

linux相关

∥☆過路亽.° 提交于 2020-03-25 19:07:17
1. 查看cpu相关信息,包括型号、主频、内核信息等 cat /proc/cpuinfo 2. 查看Linux内核版本命令 cat /proc/version 或者使用 uname -a 查看电脑以及操作系统的相关信息 3.查看cuda版本 cat /usr/local/cuda/version.txt 4.查看cudnn版本 cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 5.显示当前路径 pwd 来源: https://www.cnblogs.com/kongle666/p/12567679.html

Different timing indicated from two kind of timers

和自甴很熟 提交于 2020-03-25 16:37:34
问题 I’m trying to use two kind of timers to measure the run time of a GPU kernel. As the code indicated below, I have cudaEventRecord measuring the overall kernel and inside the kernel I have clock() functions. However, the output of the code shows that two timers got different measurements: gpu freq = 1530000 khz Hello from block 0, thread 0 kernel runtime: 0.0002453 seconds kernel cycle: 68194 According to results, the kernel elapsed 68194 clock cycles, the corresponded time should be 68194

[2020.03]Unity ML-Agents v0.15.0(一)环境部署与试运行

橙三吉。 提交于 2020-03-23 20:08:33
3 月,跳不动了?>>> [20200318更新]注意:之前关于下载CUDA与cuDNN的版本我写错了,首先道个歉。如果要想用Tensorflow利用GPU进行训练,就需要Tensorflow、CUDA、cuDNN的版本对应一致。之前我弄错了!我们后面用的Tensorflow的版本是2.0.1,所以对应CUDA的版本应该是CUDA v10.0,而相应的cuDNN v7.6.5即可,下面的截图都是我之前错误的10.2.89版本,是不能用GPU进行训练的(虽然还可以用CPU进行训练)!!!但是安装过程都是一样的。因此后文修改一下文字内容,图片就不改了。!一定要先看到这一行~别搞错了! 一、ML-Agents简介 近期在学习Unity中的机器学习插件ML-Agents,做一些记录,用以简单记录或交流学习。 先简单说一下机器学习使用的环境场景: 高视觉复杂度 (Visual Complexity,例如星际争霸、Dota2职业玩家与AI竞技)、 高物理复杂度 (Physical Complexity,例如模拟两足、四足生物行走,这里Unity ML-Agents官方也有相关例子)、 高认知复杂度 (Congnitive Complexity,例如AlphaGo)。以上几种场景利用传统算法较难搞,而利用机器学习,会更加容易解决这些问题。 而ML-Agents(Machine Learning

loading an array of structs with arrays onto cuda

夙愿已清 提交于 2020-03-23 15:34:15
问题 I'm trying to create a struct of arrays with arrays inside and load them onto the GPU. I think I followed the steps to do this correctly. Create a struct on the CPU using malloc. cudamalloc the arrays to the struct. Create a struct on the GPU using cudamalloc Copy the CPU struct onto the GPU struct. When I run this code, it will correctly work as long as I don't change the value p[i].c[0] in the kernel function. If I delete the line p[i].c[0] = 3.3; then it outputs the expected results. When

CUDA ---- 简介

那年仲夏 提交于 2020-03-22 15:12:39
CUDA简介 CUDA是并行计算的平台和类C编程模型,我们能很容易的实现并行算法,就像写C代码一样。只要配备的NVIDIA GPU,就可以在许多设备上运行你的并行程序,无论是台式机、笔记本抑或平板电脑。熟悉C语言可以帮助你尽快掌握CUDA。 CUDA编程 CUDA编程允许你的程序执行在异构系统上,即CUP和GPU,二者有各自的存储空间,并由PCI-Express 总线区分开。因此,我们应该先注意二者术语上的区分: Host:CPU and itsmemory (host memory) Device: GPU and its memory (device memory) 代码中,一般用h_前缀表示host memory,d_表示device memory。 kernel是CUDA编程中的关键,他是跑在GPU的代码,用标示符__global__注明。 host可以独立于host进行大部分操作。当一个kernel启动后,控制权会立刻返还给CPU来执行其他额外的任务。所以,CUDA编程是异步的。一个典型的CUDA程序包含由并行代码补足的串行代码,串行代码由host执行,并行代码在device中执行。host端代码是标准C,device是CUDA C代码。我们可以把所有代码放到一个单独的源文件,也可以使用多个文件或库。NVIDIA C编译器(nvcc

Making some, but not all, (CUDA) memory accesses uncached

痴心易碎 提交于 2020-03-22 08:21:19
问题 I just noticed it's at all possible to have (CUDA kernel) memory accesses uncached (see e.g. this answer here on SO). Can this be done... For a single kernel individually? At run time rather than at compile time? For writes only rather than for reads and writes? 回答1: Only if you compile that kernel individually, because this is an instruction level feature which is enabled by code generation. You could also use inline PTX assembler to issue ld.global.cg instructions for a particular load

Making some, but not all, (CUDA) memory accesses uncached

空扰寡人 提交于 2020-03-22 08:20:29
问题 I just noticed it's at all possible to have (CUDA kernel) memory accesses uncached (see e.g. this answer here on SO). Can this be done... For a single kernel individually? At run time rather than at compile time? For writes only rather than for reads and writes? 回答1: Only if you compile that kernel individually, because this is an instruction level feature which is enabled by code generation. You could also use inline PTX assembler to issue ld.global.cg instructions for a particular load

Making some, but not all, (CUDA) memory accesses uncached

≯℡__Kan透↙ 提交于 2020-03-22 08:20:14
问题 I just noticed it's at all possible to have (CUDA kernel) memory accesses uncached (see e.g. this answer here on SO). Can this be done... For a single kernel individually? At run time rather than at compile time? For writes only rather than for reads and writes? 回答1: Only if you compile that kernel individually, because this is an instruction level feature which is enabled by code generation. You could also use inline PTX assembler to issue ld.global.cg instructions for a particular load

Cuda - Multiple sums in each vector element

拈花ヽ惹草 提交于 2020-03-20 12:01:08
问题 The product of two series of Chebyshev polynomials with coefficient a and b can be represented by the formula The problem is to parallelize this as much as possible. I have managed to use cuda to parallelize the formula above by simply applying one thread per vector element. Thus one thread performs the sums/multiplications. #include <stdio.h> #include <iostream> #include <cuda.h> #include <time.h> __global__ void chebyprod(int n, float *a, float *b, float *c){ int i = blockIdx.x *blockDim.x

Cuda - Multiple sums in each vector element

佐手、 提交于 2020-03-20 11:58:42
问题 The product of two series of Chebyshev polynomials with coefficient a and b can be represented by the formula The problem is to parallelize this as much as possible. I have managed to use cuda to parallelize the formula above by simply applying one thread per vector element. Thus one thread performs the sums/multiplications. #include <stdio.h> #include <iostream> #include <cuda.h> #include <time.h> __global__ void chebyprod(int n, float *a, float *b, float *c){ int i = blockIdx.x *blockDim.x