jingweimo的个人博客分享 http://blog.sciencenet.cn/u/jingweimo

博文

A Cuda Sample Test

已有 3502 次阅读 2018-6-22 04:01 |系统分类:科研笔记| visual, studio, visual, studio, visual, studio, visual, studio, visual, studio, visual, studio, visual, studio, visual, studio, visual, studio

Here I assume you have cuda 8.0 properly installed in your computer with VS2015.

1. open Samples_vs2015.sln (normally located at C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0) (using vs2015 by default)

2. Build a complete set of solutions in Release mode (although it is not necesary  to build all the stuff for a quick test on cuda)

(the building process takes a while, and so you may plan on an extended coffee break)

3. Open Developer Command Prompt for VS2015

4. Choose the deviceQuery sample for a simple test: cd C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0\bin\win64\Release

5. Enter deviceQuery

Then, you should see the results similar to those shown below.

1.png

Good. You are on the right track for the journey of cuda programming.


Possible Issues in Building cuda sample solutions

----------------------------------------------------------------------------------------------

Cannot open include file: 'd3dxd9.h' or 'd3dxd10.h' (no such file or directory)

Check the solution here:

https://stackoverflow.com/questions/17015088/missing-files-directx-sdk-d3dx9-lib-d3dx9-h/42654539

https://stackoverflow.com/questions/38156330/do-we-still-need-directx-sdk-to-develop-dx-application-in-windows10

https://blogs.msdn.microsoft.com/chuckw/2015/08/05/where-is-the-directx-sdk-2015-edition/

https://stackoverflow.com/questions/41631576/cannot-open-source-file-d3dx9-h

https://msdn.microsoft.com/en-us/library/mt683786.aspx

-----------------------------------------------------------------------------------------------

cuda driver version is insufficient for cuda runtime version windows

Check the solution here:

https://stackoverflow.com/questions/38416994/cuda-driver-version-is-insufficient-for-cuda-runtime-version-despite-being-on-ne

https://stackoverflow.com/questions/33669258/what-can-i-do-against-cuda-driver-version-is-insufficient-for-cuda-runtime-vers

http://www.nvidia.com/Download/index.aspx?lang=en-us

------------------------------------------------------------------------------------------------

Choose the right GPU driver  

https://forums.geforce.com/default/topic/734249/do-i-need-all-these-drivers-addons-/?offset=6

https://devtalk.nvidia.com/default/topic/1033111/cuda-setup-and-installation/cuda-9-1-cannot-install-due-to-failed-visual-studio-integration/

---------------------------------------------------------------------------------------------------

VS Projects or solutions Load Failed

I recently rearranged the content of my working folder which is used to store all my coding related projects. But after doing that I had problem loading solution of my WinForm project in Visual Studio Express 2012 as I received an error telling me about a problem with a project file.

 

Exact error message in the Output window was:

error  : The project file could not be loaded. Could not find a part of the path...

Another way you can encounter this error is if you renamed your project folder and sometimes you can get this error without moving or renaming anything at all. In this article you will be shown how to solve this problem for all those cases.

 

For those who receive this error but did not move projects around

Try deleting .suo files in your solution folder. Solution User Option file is a binary file which contains various user information and settings such as location of the breakpoints.

If that didn't help try also to delete .user file.

If you have trouble finding .suo file

In Visual Studio 2015 (also in Community Edition), the .suo file is located inside a hidden .vs folder in solution folder. Since both .vs folder and .suo file have hidden attribute applied to them, you have to reveal them using using File Explorer by changing folder options to “show hidden files, folders and drives”.
How to get to this option in File Explorer depends on the version of Windows:

  • In Windows 7, option is located under Organize > Folder and search options.

  • in Windows 8, it is located under View tab > Options > Change folder and search options.

  • in Windows 10, it is the same as in Windows 8.


For those who have this error due to moving projects around or renaming the project

The problem lies with the nonexistent path of one or more projects that are stored into the solution file.

You can solve this problem in two ways:

Using Text Editor

One way to fix this error is to correct path of the problematic projects yourself by directly editing .sln file.

For those who feel uncomfortable editing the solution file there is another way. You can fix the path of the project directly from Visual Studio and this procedure is shown next.

Using Visual Studio

Just follow these steps:

  • Load the solution into VS. You might get Error Popup Window with the message shown below. Ignore the warning and click OK.

     

    Visual Studio Error Window with message that one or more projects were not loaded.

    Error window with a message "One or more projects in the solution were not loaded correctly. Please see the Output Window for Details."

  • In the Solution Explorer you should find at least one project that was not loaded. Select that project. It will have (unavailable) text next to the name as shown below:

    Not loaded project in Solution Explorer

    Solution Explorer with unavailable project

    In Properties Window you will find unloaded project properties. There will be a single property named File path which stores the path of the project. We need to change that so click on the path. Browse button ... will appear on the right as shown in the following image. Click on it.

    Properties Window of the unavailable project showing the project's path.

    Properties Window of the unavailable project showing the project's path.

    Note:Sometimes, the path in File path property is grayed out and you are unable to get to the Browse button. In this case try deleting .suo files. Don't worry, these files gets recreated when you rebuild the solution / project.

  • File Dialog box will open. Locate project file (.csproj) and click Open.

  • In the Solution Explorer, the project will still have (unavailable) message besides it. We still need to carry out one more step. Right-click on the project to open context menu. Select Reload Project as shown below:

     

    Reloading the unloaded project in the solution explorer.

    Reloading the unloaded project in the solution explorer.

  • Build solution. If you get an error telling you that the referenced project does not exist, we need to update references. Save solution and Close it, then Open project again.


Another reason for the load failed is due to the customer based modifications made to MirosoftCpp property file [located at, e.g., C:\Users\userName\AppData\Local\Microsoft\MSBuild\v4.0)]. You may try restore it to its default values (https://stackoverflow.com/questions/9248526/how-do-i-restore-a-property-sheet-to-its-default-value)


Now you should be able to build solution without getting errors (at least not those relating to paths of a project file).


Source:

https://www.howtosolutions.net/2013/02/solving-project-file-error-could-not-find-part-of-the-path-with-visual-studio/



https://wap.sciencenet.cn/blog-578676-1120228.html

上一篇:Nonlinearity and loss function in multi-tasking problems
下一篇:Jupyter notebook: change its start-up directory
收藏 IP: 73.18.82.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-14 08:57

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部