Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and GDB*
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
262 Discussions

Unable to build the Vector Add sample on windows 10

Nikhil_T
Novice
1,017 Views

Hi there! 

I have just started learning DPC++ and I was going through the tutorials. I tried running the Vector Add example provided by intel oneAPI, but it shows the following errors:

Build started...
1>------ Build started: Project: vector-add-usm, Configuration: Debug x64 ------
2>------ Build started: Project: vector-add-buffers, Configuration: Debug x64 ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(473,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(473,5): warning MSB8003: The WindowsSDKDir property is not defined. Some build tools may not be found.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(491,5): warning MSB8028: The intermediate directory (x64\Debug\) contains files shared from another project (vector-add-buffers.vcxproj). This can lead to incorrect clean and rebuild behavior.
2>In file included from src/vector-add-buffers.cpp:22:
2>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl.hpp:11:
2>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl/ONEAPI/atomic.hpp:11:
2>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl/ONEAPI/atomic_accessor.hpp:11:
2>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl/ONEAPI/atomic_enums.hpp:11:
2>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/__spirv/spirv_ops.hpp:10:
2>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/__spirv/spirv_types.hpp:11:
2>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\cstdint:9:
2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\yvals.h(12,10): : error : 'crtdbg.h' file not found
2>#include <crtdbg.h>
2> ^~~~~~~~~~
1>In file included from src/vector-add-usm.cpp:22:
1>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl.hpp:11:
1>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl/ONEAPI/atomic.hpp:11:
1>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl/ONEAPI/atomic_accessor.hpp:11:
1>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/sycl/ONEAPI/atomic_enums.hpp:11:
1>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/__spirv/spirv_ops.hpp:10:
1>In file included from C:\PROGRA~2\Intel\oneAPI\compiler\20211~1.1\windows\bin\..\include\sycl\CL/__spirv/spirv_types.hpp:11:
1>In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\cstdint:9:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\yvals.h(12,10): : error : 'crtdbg.h' file not found
1>#include <crtdbg.h>
1> ^~~~~~~~~~
2>1 error generated.
1>1 error generated.
2>Done building project "vector-add-buffers.vcxproj" -- FAILED.
1>Done building project "vector-add-usm.vcxproj" -- FAILED.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

 

An image is also attached that shows the errors. I am using windows 10, Processor : core i5 10th gen 1035G1 CPU

 

0 Kudos
1 Solution
AbhishekD_Intel
Moderator
968 Views

Hi Nikhil,


Thanks for reaching out to us.

Please try selecting the Windows SDK for any newer versions. You can select it from the below path.

Project Property -> Configuration Properties -> General -> Windows SDK Version.


Also, try running the same sample (vector_add) using command line and let us know if you observed any errors.

It seems that this problem is related to your Visual Studio Environment.



Warm Regards,

Abhishek.


View solution in original post

14 Replies
Nikhil_T
Novice
1,013 Views

Here is the Screenshot of running setvars and sys_check ::

Nikhil_T
Novice
999 Views

Just to add a bit information regarding my download, I have done custom installation which includes the following only:

  • Intel® oneAPI DPC++/C++ Compiler
  • Intel® oneAPI DPC++ Library
  • Intel® Distribution for GDB*
  • Intel® DPC++ Compatibility Tool
  • Intel® oneAPI Threading Building Blocks

 

AbhishekD_Intel
Moderator
969 Views

Hi Nikhil,


Thanks for reaching out to us.

Please try selecting the Windows SDK for any newer versions. You can select it from the below path.

Project Property -> Configuration Properties -> General -> Windows SDK Version.


Also, try running the same sample (vector_add) using command line and let us know if you observed any errors.

It seems that this problem is related to your Visual Studio Environment.



Warm Regards,

Abhishek.


View solution in original post

Nikhil_T
Novice
964 Views

Okay I will try it and get back to you! 

Nikhil_T
Novice
948 Views

Though I am able to solve the problem, I am still seeing these errors which aren't affecting the compilation process. Image attached. 

DPC++ error.PNG

Nikhil_T
Novice
954 Views

Changing the windows SDK thing really worked for me!! Thanks you for the help. I wanted to know if there is a way by which I can use it one Nvidia GPU? 

 

Thanks again for the help!! 

AbhishekD_Intel
Moderator
942 Views

Hi Nikhil,

 

Thanks for the confirmation, glad to know that it solved your issue.

The error logs which you are getting on the VS is because buffer & accessor are templated functions and I think you have not specified any template arguments for example like buffer<float, 2>. That's the reason you can only see the error logs on VS but at a time of compiling it's compiling with no errors. You may try giving template arguments to buffer to remove those error logs.

 

Warm Regards,

Abhishek

 

 

 

Nikhil_T
Novice
929 Views

Could you also tell if it is possible to work with nvidia GPUs using DPC++ ? 

AbhishekD_Intel
Moderator
907 Views

Hi,


It is possible to use DPC++ for NVIDIA GPUs. Please follow the below link for more details.

https://intel.github.io/llvm-docs/GetStartedGuide.html


Let us know if your issue has been resolved. So that we can close this thread. You are always welcome to post a new thread if you have any other issues.


Warm Regards,

Abhishek


Nikhil_T
Novice
847 Views

I am trying to run a simple code to test the performance of parallel processing. The code is presented below:

 

#include <CL/sycl.hpp>
#include <vector>
#include <iostream>
#include <numeric>
#include <ctime>
using namespace sycl;

int main() {

std::vector<int> vec(10000);
std::iota(std::begin(vec), std::end(vec), 0);
std::vector<int> vec_serial(10000);
std::vector<int> vec_parallel(10000);
clock_t begin_serial = clock();
for (int i = 0; i < vec.size(); i++) {
vec_serial[i] = vec[i] + 2;
}
clock_t end_serial = clock();
double time_serial = double(end_serial - begin_serial);

queue Q{ host_selector() };
clock_t begin_parallel ;
clock_t end_parallel;
{

buffer b1{ vec };
buffer b2{ vec_parallel };
begin_parallel = clock();
Q.submit([&](handler& h) {
accessor a1{ b1 , h };
accessor a2{ b2 , h };
h.parallel_for(10000,[=](id <1>i) {

a2[i] = a1[i] + 2;

});

}).wait();
end_parallel = clock();

}
double time_parallel = double(end_parallel - begin_parallel);
std::cout << "The time taken for serial operation is " << time_serial;
std::cout << "\nThe time taken for parallel operation is" << time_parallel;
return 0;
}

 

 

 

The code measures the time taken to produce the results. I am compiling it in Visual Studio environment and building it there. However the time taken for computation in the serial case seems to be way lesser than the parallel mode. Am I missing something??

 

AbhishekD_Intel
Moderator
815 Views

Hi Nikhil,


Please try running a more complex workload. You will find the time difference in more compute-intensive workloads. Though there will be some overhead to create a queue, still you will find a good difference if you use a more compute-intensive workload.


Hope these details will help you to compare the time differences.

As your issue is resolved, please give us confirmation if we can close this thread. You are always welcome to post a new thread if you have any other issues.


Warm Regards,

Abhishek


AbhishekD_Intel
Moderator
759 Views

Hi,


Please give us an update on your issue. Do let us know if your issue is resolved.


Thank You


Nikhil_T
Novice
747 Views

Hi there! 

This issue is resolved now. I tried using VTune to check the code and it seems that this parallel version of this code does not performs well. I will try using heavy application to see the difference. 

 

Thank you! 

AbhishekD_Intel
Moderator
742 Views

Hi Nikhil,


Thanks for the confirmation.

We will close this thread as your issue is resolved. Please post a new thread if you have any other issues.


Warm Regards,

Abhishek


Reply