cuda

Cupy freeing unified memory

你说的曾经没有我的故事 提交于 2021-02-10 14:30:07
问题 I have a problem with freeing allocated memory in cupy. Due to memory constraints, I want to use unified memory. When I create a variable that will be allocated to the unified memory and want to free it, it is labelled as being freed and that the pool is now empty, to be used again, but when I take a look at a resource monitor, the memory is still not freed. When I create another variable it also adds to memory (I thought that perhaps the memory labelled as taken would be reused as is

Cupy freeing unified memory

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 14:29:07
问题 I have a problem with freeing allocated memory in cupy. Due to memory constraints, I want to use unified memory. When I create a variable that will be allocated to the unified memory and want to free it, it is labelled as being freed and that the pool is now empty, to be used again, but when I take a look at a resource monitor, the memory is still not freed. When I create another variable it also adds to memory (I thought that perhaps the memory labelled as taken would be reused as is

Eclipse/nsight formatter doesn't respect function body indentation policy

╄→尐↘猪︶ㄣ 提交于 2021-02-10 08:35:09
问题 I use CUDA 8.0's version of nsight (Eclipse platform 4.4.0, CDT 8.4.0). My Eclipse C/++ formatter is configured to indent as follows (image is from the Formatter config prev: but if I have this code: and I press enter, get to the next line (the cursor is placed under the span ), and type in an opening brace, it is not placed at the beginning of the line, but is rather kept indented: Is this a bug or have I misconfigured something? Notes: I tried both the built-in formatter and the "CUDA C"

腾讯IEG开源GAME AI SDK:自动化测试吃鸡、MOBA类游戏

心不动则不痛 提交于 2021-02-09 00:09:44
视学算法报道 编辑:陈萍、魔王 转载自公众号:机器之心 SDK 还能自动玩游戏? 这个 SDK 有点「酷」 。 近日,腾讯互娱(IEG)开源了一款名为 GAME AI SDK 的自动化测试平台,该平台封装好了多种工具供开发者使用,目前支持的游戏类型有跑酷类、吃鸡类、射击类、MOBA 类等。 项目地址:https://github.com/Tencent/GameAISDK 平台内置的「天天酷跑」示例。左图为未训练随机做动作,右图是训练好的效果。 SDK(软件开发工具包)一般是软件工程师为特定的软件包、软件框架、硬件平台、操作系统等创建应用软件时可使用的开发工具集合。 似乎有些抽象。在实际项目中,我们只需记住,SDK 是手游渠道提供的,集成了用户登录、社区功能、社交分享功能、数据后台统计功能的功能模块。接入 SDK 后,游戏厂商和渠道都要对 SDK 包进行测试,测试通过才能上线。 看了上文展示的酷跑动图效果,是不是想上手试试吃鸡类、射击类的游戏体验呢?这个开源项目可以满足你的需求,它支持使用者进行项目接入以及二次开发。 AI SDK 平台 AI SDK 平台是一个基于游戏图像来开发游戏 AI 的开源工具包。工具包主要完成了 UI 检测、游戏内元素识别、AI 算法(DQN、IM)等功能。开发者可以基于此工具包完成游戏自动化测试。 目前该平台已支持的游戏类型有跑酷类、吃鸡类、射击类

OpenCL

爱⌒轻易说出口 提交于 2021-02-08 15:58:05
OpenCL GPU OpenCL 一、 CUDA vs OpenCL 1. 简介 OpenCL: Open Computing Language,开放计算语言。 OpenCL和CUDA是两种异构计算(此异构平台可由CPU,GPU或其他类型的处理器组成。)的编程模型。 CUDA只支持NVIDIA自家的GPU。 OpenCL最早是由Apple提出,后来交给了Khronos这个开放标准组织。OpenCL 1.0 在2008年底正式由Khronos发布,比CUDA晚了整整一年。 2012年移动图形处理器市场份额,imagenation失去苹果后一落千丈,已被别的公司收购: enter description here 2. 操作步骤 CUDA C加速步骤: 在device (也就是GPU) 上申请内存 将host (也就是CPU) 上的数据拷贝到device 执行CUDA kernel function 将device上的计算结果传回host 释放device上的内存 OpenCL操作步骤: 检测申请计算资源 检测platform, clGetPlatformIDs 检测platform对应的device, clGetDeviceInfo 建立context, clCreateContextFromType 建立command queue, clCreateCommandQueue

Are there templated math functions in cuda? [duplicate]

末鹿安然 提交于 2021-02-08 15:02:37
问题 This question already has an answer here : Does CUDA C++ math function of exp have override functions by default? (1 answer) Closed 6 months ago . I have been looking for templated math function in cuda and I can't seem to find one. In normal c++ if I call std::sqrt it is templated and will execute a different version based on if the argument is a float or double. I want something like this for CUDA device code. My kernels have the real type passed as a template parameter and right now I have

[NLP-CNN] Convolutional Neural Networks for Sentence Classification -2014-EMNLP

蹲街弑〆低调 提交于 2021-02-08 14:52:08
1. Overview 本文将CNN用于句子分类任务 (1) 使用静态vector + CNN即可取得很好的效果;=> 这表明预训练的vector是universal的特征提取器,可以被用于多种分类任务中。 (2) 根据特定任务进行fine-tuning 的vector + CNN 取得了更好的效果。 (3) 改进模型架构,使得可以使用 task-specific 和 static 的vector。 (4) 在7项任务中的4项取得了SOTA的效果。 思考:卷积神经网络的核心思想是捕获局部特征。在图像领域,由于图像本身具有局部相关性,因此,CNN是一个较为适用的特征提取器。在NLP中,可以将一段文本n-gram看做一个有相近特征的片段——窗口,因而希望通过CNN来捕获这个滑动窗口内的局部特征。卷积神经网络的优势在于可以对这样的n-gram特征进行组合和筛选,获取不同的抽象层次的语义信息。 2. Model 对于该模型,主要注意三点: 1. 如何应用的CNN,即在文本中如何使用CNN 2. 如何将static和fine-tuned vector结合在一个架构中 3. 正则化的策略 本文的思路是比较简单的。 2.1 CNN的应用 <1> feature map 的获取 word vector 是k维,sentence length = n (padded)

OpenCv Compiling with Cuda

微笑、不失礼 提交于 2021-02-08 11:37:52
问题 I'm giving this command cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/developments/opencv/install/opencv/* -D WITH_CUDA=ON -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ .. but always cmake gives me -- Other third-party libraries: -- Use IPP: NO -- Use TBB: NO -- Use Cuda: NO -- Use Eigen: NO -- Use Clp: NO How can it be done? Thanks. 回答1: Most probably you don't have the required CUDA version installed. The output of cmake should be warning you about it. OpenCV 2.3.1 supports only

How can I pull/push data between gpu and cpu in tensorflow

☆樱花仙子☆ 提交于 2021-02-08 11:27:55
问题 I used a temporary tensor to store data in my customized gpu-based op. For debug purpose, I want to print the data of this tensor by traditional printf inside C++. How can I pull this gpu-based tensor to cpu and then print its contents. Thank you very much. 回答1: If by temporary you mean allocate_temp instead of allocate_output , there is no way of fetching the data on the python side. I usually return the tensor itself during debugging so that a simple sess.run fetches the result. Otherwise,