Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel ICX Compiler , Intel® DPC++ Compatibility Tool, and GDB*

OneMKL sample takes forever to build

AyushM
Novice
5,893 Views

I am using the latest oneAPI Base Toolkit in my local machine.I tried running the examples provided as zip inside the onemkl folder.Had some inlclude errors in my VS.So I had to turn on the option to use onemkl in my VS 19 and also had to add the folder containing the "common_for_examples.hpp".Noww VS doesn't show any errors,but takes forever to build my .cpp file.Please look into this and help.Urgent help required.Thanks in advance!!

0 Kudos
36 Replies
AyushM
Novice
2,285 Views

Hi ziglar,can you please let me know the exact procedure you used to run the onemkl examples?

The nmake method as decribed earlier doesn't seem to work.I tried with cmake and it gives me the following error:

AyushM_0-1618594144356.png

 

 

0 Kudos
ziglar
Beginner
2,277 Views

Hi AyushM, I didn't run any of the samples provided but wrote my own as I was trying to compare different ways to multiply matrices and cobbled together bits from multiple sources.

I can probably strip my project down to the bare minimum and upload it over the next few days if that helps

0 Kudos
AyushM
Novice
2,276 Views
Hi ziglar, if would be of immense help of you could do it. Also please let me know how did you build and run your project. Did you use some specific commands or just VS?
0 Kudos
ziglar
Beginner
2,254 Views

Hi AyushM, I have attached a simple example that runs MKL on GPU that hopefully you can run on your PC using VS (I use VS2019 only for this with 2021.2.0 base kit installed).

I don't think I have stripped anything out that will prevent it from running but just let me know.

I can only vouch for the Release version in this zip file.

My original project used boost::ublas but this should all have been removed also.

Check that the paths for the project settings match your setup.

Cheers,

 

0 Kudos
AyushM
Novice
2,243 Views

Thanks a lot mate!!

I should open the project using VS and just build it,nothing else right?

Because I did that and got quite a lot of errors.

I'm pretty new to this stuff so please excuse me for a silly question.

Thanks in advance!

0 Kudos
ziglar
Beginner
2,232 Views

On my machine I can open the project, select Release configuration and build and execute with no issues so maybe you PC configuration is different to mine.

0 Kudos
AbhishekD_Intel
Moderator
2,240 Views

Hi,

 

@ziglar, thanks for the confirmation, glad to know that your issue is resolved.

@AyushM , please check the C:\Program Files (x86)\Intel\oneAPI\mkl\2021.2.0\examples directory from the MKL related samples and choose examples_dpcpp.zip for dpcpp related samples and do let us know if you are able to compile and execute the samples.

Hope the provided details will help you to solve your issues.

 

Warm Regards,

Abhishek

0 Kudos
ziglar
Beginner
2,230 Views

Hi Abhishek, please excuse my (and others) frustration, but the zip file contains no details on how to run the examples with Visual Studio.

DPCC is integrated into VS2019 so why can't we just get from Intel an example VS project (xxx.sln) that executes MKL code on an integrated GPU?

My CMake is pretty weak so I struggle with CMakeLists.txt based projects.

I would have thought that Intel are very keen to lower the barriers to entry on this and make it easily accessible to all who have an interest no matter their technical skills.

Even trying to run cmake from the command line in a command prompt from which I have executed DPCPP setvars.bat fails miserably.

Hope you can help.

0 Kudos
AyushM
Novice
2,226 Views

Hi Abhishek,

I've already done that but I'm still not able to run it.I get a cmake every time I try to run it.

AyushM_0-1618855756671.png

I've followed the same steps as given in the README.txt present inside the examples_dpcpp folder.

0 Kudos
AbhishekD_Intel
Moderator
2,206 Views

Hi Ayush,

 

It seems that the TARGET_DOMAIN which you are using is invalid. TARGET_DOMAIN should be any domains listed in the folder.

So try running the same command without using TARGET_DOMAIN or you can also use TARGET_FUNCTIONS="rng/uniform" if you only want to use the specific function(uniform from rng)

We tried running the samples and it's compiling and executing for us without any errors.

Please give it a try with valid options.

You may also try the below set of commands

  1. cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=dpcpp -DTARGET_DEVICES="gpu" -DTARGET_FUNCTIONS="rng/uniform"
  2. cmake --build . -j 2 --verbose
  3. ctest

 

Hope the above details will help you build and run your samples. Refer to the screenshot for more details.

 

 

Warm Regards,

Abhishek

 

0 Kudos
AyushM
Novice
2,195 Views

Hi Abhishek,

I've tried to execute the exact same command as mentioned by you.

cmake .. -G "Ninja" -DCMAKE_CXX_COMPILER=dpcpp -DTARGET_DEVICES="gpu" -DTARGET_FUNCTIONS="rng/uniform"

I keep getting the same error.Please refer to the below image.

AyushM_0-1619100778118.png

 

0 Kudos
AbhishekD_Intel
Moderator
2,185 Views

Hi Ayush,


It seems that there is some problem with your environment. Your CMake has detected the dpcpp.exe but the status is broken, so there might be some problem with the installed dpcpp. So please try once compiling and running any simple samples(using oneapi-cli) with dpcpp and check if it's working or not.

If the other samples are working correctly then there might be some issue with your cmake. In such a case try manually compiling and executing the samples from rng, that will work.



Warm Regards,

Abhishek


0 Kudos
AyushM
Novice
2,169 Views

Hi Abhishek,

I have already compiled and executed dpcpp samples using my Visual Studio and it works all fine.I guess it won't make a difference if I do it using oneapi-cli than VS.

Also please let me know how exactly do we manually compile and execute the samples.

Thanks,

Ayush.

0 Kudos
AbhishekD_Intel
Moderator
2,143 Views

Hi Ayush,


Yes, you are correct, we just wanted to know whether the dpcpp samples compiles and executes.

And we can see that you are able to compile and execute them. Please follow the below steps and commands to compile and execute the sample (rng/uniform).


  1. Go to the application director (dpcpp_device) using the command prompt, where you will find common and rng directories.
  2. Run the C:\Program Files (x86)\Intel\oneAPI\setvars.bat script.
  3. Try running the below commands on the same instance of the command prompt.


> mkdir build && cd build

> dpcpp -I..\common -I..\rng -I"C:\Program Files (x86)\Intel\oneAPI\mkl\latest\include" /W3 /EHsc -Wno-unused-function  -fno-sycl-early-optimizations -fsycl-unnamed-lambda -DSYCL_DEVICES_gpu -std:c++14 -c ..\rng\source\uniform.cpp

> dpcpp uniform.obj -o rng-uniform.exe -fsycl-device-code-split=per_kernel

> rng-uniform.exe


This will execute the sample, hope this will help you to resolve your issue.



Warm Regards,

Abhishek


0 Kudos
AbhishekD_Intel
Moderator
2,053 Views

Hi Ayush,


Please give us an update on the provided details. Let us know if your issue got resolved.



Warm Regards,

Abhishek


0 Kudos
AbhishekD_Intel
Moderator
2,038 Views

Hi Ayush,

 

We haven't heard back from you, and we assume that your issue is resolved. We will no longer monitor this thread. If you require any additional assistance from Intel, please start a new thread. 

Any further interaction in this thread will be considered community only.

 

 

Warm Regards,

Abhishek

 

0 Kudos
Reply