CUJ2K编译

Jun 07, 2016 pm 03:20 PM
develop environment compile

VS2005 开发CUDA3.2 环境配置 VS2005 开发 CUDA 环境配置 下面记录的是在 VS2005 中开发 CUDA 应用程序的配置过程,使用的路径均为默认路径。 安装、配置步骤: 1 、安装 Visual Studio 2005 环境。 2 、安装开发助手 Visual Assist X 。 3 、安装 CUDA 的驱

VS2005开发CUDA3.2环境配置

VS2005开发CUDA环境配置

 

下面记录的是在VS2005中开发CUDA应用程序的配置过程,使用的路径均为默认路径。

 

安装、配置步骤:
1
、安装Visual Studio 2005环境。
2
、安装开发助手Visual Assist X
3
、安装CUDA的驱动、工具集、SDK
    
可以从http://developer.nvidia.com/object/cuda_3_2_downloads.html免费下载。


4
、语法高亮:
    
查看C:/Program Files/Microsoft Visual Studio 8/Common7/IDE目录是否存在usertype.dat文件。
如果没有存在则将C:/Program Files/NVIDIA GPU Computing SDK/doc/syntax_highlighting/visual_studio_8里面的usertype.dat文件拷贝到此目录;
如果已经存在则将C:/Program Files/NVIDIA GPU Computing SDK/doc/syntax_highlighting/visual_studio_8里面的usertype.dat的内容添加到C:/Program Files/Microsoft Visual Studio 8/Common7/IDE/usertype.dat文件的尾部。

 

5、设置VS2005环境:
    
依次打开工具|选项|项目和解决方案|VC++目录,添加:
    
包含文件:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v3.2/include

                  C:/Program Files/NVIDIA GPU Computing SDK/C/common/inc
     
库文件:   C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v3.2/lib/Win32

                  C:/Program Files/NVIDIA GPU Computing SDK/C/common/lib
    
源文件:   C:/Program Files/NVIDIA GPU Computing SDK/C/common/src

     依次打开工具|选项|文本编辑器|文件扩展名,在扩展名中添加“cu”,在编辑器中选择“Microsoft Visual C++”

 

6、在VS2005中依次打开工具|选项|项目和解决方案|VC++项目设置里面的“C/C++文件扩展名添加*.cu;
    
在规则搜索路径中C:/Program Files/NVIDIA GPU Computing SDK/C/common,指定Cuda.rules所在的路径。

 

7、在VS2005中新建工程,在工程名上鼠标右击,在弹出菜单中选择菜单项自定义生成规则,选择要添加的规则文件,

     如:“CUDA Build rule v3.0.14”
    
在工程中添加.cu文件,右键点击cu文件,在弹出菜单中依次选择属性|配置属性|常规,在工具的下拉列表中选择生成规则的名称,例如“CUDA Build rule v3.0.14”,单击确定即可。
   
    
顺便说明一下,在下载文件中有一个“cudatoolkit_3.2_win_buildrules-patch.zip”,解压后其实是编译驱动级别的api及编译运行时api的规则文件,可以将它们拷贝到一个目录,  如上所示指定该目录即可编译驱动级别的api和编译运行时api

 

8Visual Assist X设置:
    
关闭已经所有打开的Visual studio,之后进入注册表编辑器,依次打开“HKEY_CURRENT_USER/Software/Whole Tomato/Visual Assist X/VANet8”,找到右边的ExtSource项,将其值添加.cu;.cuh,之后关闭,再次打开VS2005即可。

 

     至此,就已经可以打开SDK目录下的例子代码(如:C:/Program Files/NVIDIA GPU Computing SDK/C/src/vectorAdd/vectorAdd.sln)进行编译、调试了。

 

 

 

 

注明:

(1)       我安装的是CUDA4.2版本

(2)       运行C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\OpenCL中的例子没有问题,可以直接运行。运行CUDA例子出现Cuda.rules没有找到。需要将文件NvCudaDriverApi.rulesC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\extras\visual_studio_integration\rules拷贝到C:\Program Files (x86)\Microsoft Visual Studio 8\VC\VCProjectDefaults目录下。运行CUDA例子没有问题。

 

 

编译CUJ2K出现错误。

0步是打开工程提示找不到Cuda.rules文件,需要将gpu_vc2005.vcproj文件用txt方式打开,将下面这段:

        

                  

                            RelativePath="..\..\..\..\..\CUDA\common\Cuda.rules"

                   />

        

改为:

        

                  

                            FileName="NvCudaRuntimeApi.rules"

                   />

        

 

第一步是缺少cutil32D.lib库,需要设置Lib库的路径,

工具〉选项〉项目和解决方案VC++目录〉库文件目录

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\lib\Win32

C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\common\lib\Win32

同时将配置属性〉连接器〉常规〉附加库目录清空

 

第二步出现库文件冲突问题

1>LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用/NODEFAULTLIB:library

1>LINK : warning LNK4098: 默认库“LIBCMTD”与其他库的使用冲突;请使用/NODEFAULTLIB:library

于是打开项目属性,在配置属性-->C/C++-->代码生成-->运行时库中将多线程(/MT修改为多线程调试DLL/MDd出现以下错误:

1>   LINK : warning LNK4098: 默认库“MSVCRTD”与其他库的使用冲突;请使用/NODEFAULTLIB:library

静态库中使用配置属性-MFC,并将LIBCMT.lib设置为忽略特定库。

 

 

第三步出现找不到cutil32D.dll的错误,只需要将C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.2\C\common\lib\Win32文件夹下的cutil32D.dll拷贝到目录下cuj2k-src-1.1\src_encoder\Debug

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Four recommended AI-assisted programming tools Four recommended AI-assisted programming tools Apr 22, 2024 pm 05:34 PM

This AI-assisted programming tool has unearthed a large number of useful AI-assisted programming tools in this stage of rapid AI development. AI-assisted programming tools can improve development efficiency, improve code quality, and reduce bug rates. They are important assistants in the modern software development process. Today Dayao will share with you 4 AI-assisted programming tools (and all support C# language). I hope it will be helpful to everyone. https://github.com/YSGStudyHards/DotNetGuide1.GitHubCopilotGitHubCopilot is an AI coding assistant that helps you write code faster and with less effort, so you can focus more on problem solving and collaboration. Git

Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent Which AI programmer is the best? Explore the potential of Devin, Tongyi Lingma and SWE-agent Apr 07, 2024 am 09:10 AM

On March 3, 2022, less than a month after the birth of the world's first AI programmer Devin, the NLP team of Princeton University developed an open source AI programmer SWE-agent. It leverages the GPT-4 model to automatically resolve issues in GitHub repositories. SWE-agent's performance on the SWE-bench test set is similar to Devin, taking an average of 93 seconds and solving 12.29% of the problems. By interacting with a dedicated terminal, SWE-agent can open and search file contents, use automatic syntax checking, edit specific lines, and write and execute tests. (Note: The above content is a slight adjustment of the original content, but the key information in the original text is retained and does not exceed the specified word limit.) SWE-A

Learn how to develop mobile applications using Go language Learn how to develop mobile applications using Go language Mar 28, 2024 pm 10:00 PM

Go language development mobile application tutorial As the mobile application market continues to boom, more and more developers are beginning to explore how to use Go language to develop mobile applications. As a simple and efficient programming language, Go language has also shown strong potential in mobile application development. This article will introduce in detail how to use Go language to develop mobile applications, and attach specific code examples to help readers get started quickly and start developing their own mobile applications. 1. Preparation Before starting, we need to prepare the development environment and tools. head

Which Linux distribution is best for Android development? Which Linux distribution is best for Android development? Mar 14, 2024 pm 12:30 PM

Android development is a busy and exciting job, and choosing a suitable Linux distribution for development is particularly important. Among the many Linux distributions, which one is most suitable for Android development? This article will explore this issue from several aspects and give specific code examples. First, let’s take a look at several currently popular Linux distributions: Ubuntu, Fedora, Debian, CentOS, etc. They all have their own advantages and characteristics.

Exploring Go language front-end technology: a new vision for front-end development Exploring Go language front-end technology: a new vision for front-end development Mar 28, 2024 pm 01:06 PM

As a fast and efficient programming language, Go language is widely popular in the field of back-end development. However, few people associate Go language with front-end development. In fact, using Go language for front-end development can not only improve efficiency, but also bring new horizons to developers. This article will explore the possibility of using the Go language for front-end development and provide specific code examples to help readers better understand this area. In traditional front-end development, JavaScript, HTML, and CSS are often used to build user interfaces

Understanding VSCode: What is this tool used for? Understanding VSCode: What is this tool used for? Mar 25, 2024 pm 03:06 PM

"Understanding VSCode: What is this tool used for?" 》As a programmer, whether you are a beginner or an experienced developer, you cannot do without the use of code editing tools. Among many editing tools, Visual Studio Code (VSCode for short) is very popular among developers as an open source, lightweight, and powerful code editor. So, what exactly is VSCode used for? This article will delve into the functions and uses of VSCode and provide specific code examples to help readers

Is PHP front-end or back-end in web development? Is PHP front-end or back-end in web development? Mar 24, 2024 pm 02:18 PM

PHP belongs to the backend in web development. PHP is a server-side scripting language, mainly used to process server-side logic and generate dynamic web content. Compared with front-end technology, PHP is more used for back-end operations such as interacting with databases, processing user requests, and generating page content. Next, specific code examples will be used to illustrate the application of PHP in back-end development. First, let's look at a simple PHP code example for connecting to a database and querying data:

Git must-know secrets: Amazing Java development Git must-know secrets: Amazing Java development Mar 06, 2024 am 08:25 AM

1. Branching and merging Branches allow you to experiment with code changes without affecting the main branch. Use gitcheckout to create a new branch and use it when trying new features or fixing bugs. Once complete, use gitmerge to merge the changes back to the master branch. Sample code: gitcheckout-bnew-feature // Make changes on the new-feature branch gitcheckoutmain gitmergenew-feature2. Staging work Use gitadd to add the changes you want to track to the staging area. This allows you to selectively commit changes without committing all modifications. Sample code: gitaddMyFile.java3

See all articles