Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
599 Discussions

VS2022 debug session fails on stepping over DPC++ line: "queue q(selector, exception_handler);"

MB_29
Novice
1,694 Views

Platform: Windows 10

Visual Studio 2022 (17.5.5)

OneApi 2023.1

 

I've compiled VectorAdd basic sample and it works fine from "cmd"  window for gpu and cpu selectors.

But "step-by-step"  debugging works only for gpu selector. For cpu selector it fails on command:

"queue q(selector, exception_handler);"

Unhandled exception at 0x00007FFBAD2450C2 (task_executor64.dll) in VectorAdd.exe: 0xC0000005: Access violation reading location 0x00000000FFFFFFFF.

 

I've found the simple solution for VSCode studio

Here:

https://community.intel.com/t5/Intel-oneAPI-Data-Parallel-C/Visual-Studio-Code-debug-session-hangs-on-stepping-over-DPC/td-p/1419943

"setupCommands": [

{

"description": "Disable target async",

"text": "set target-async off",

"ignoreFailures": true

}

Can somebody help.

How this command can be sent in VS2022 or something else?

 

 

To select cpu device you may add setting

ONEAPI_DEVICE_SELECTOR="opencl:cpu"

in "Debug" configuration tab.

(or  cmd> set ONEAPI_DEVICE_SELECTOR="opencl:cpu"  but in cmd it works ok).

 

 

 

 

0 Kudos
1 Solution
MB_29
Novice
1,515 Views

That is an exception I get trying to execute 

"queue q(selector, exception_handler);"

at my workplace machine in cpu selector.

 

View solution in original post

0 Kudos
8 Replies
SeshaP_Intel
Moderator
1,640 Views

Hi,

 

Thank you for posting in Intel Communities.

 

We have tried to build and debug the vector-add sample by setting the breakpoints, but we are unable to reproduce your issue. Please refer to the below screenshot.

SeshaP_Intel_0-1690461705771.png

 

I have tried on Windows 11 OS which has Visual Studio 2022 17.6.5 and oneAPI 2023.2 installed.

 

Could you please try the latest oneAPI release(2023.2) and let us know the results?

If the same issue persists with the new release, please provide us with the complete steps you have followed to reproduce the issue.

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
MB_29
Novice
1,606 Views

Thank you for reply!

May I ask you to forward till line 144 and send me the output of lines  139,141.

I would expect to see something as 

"Running on device: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz"

 

The problem that supplied example by default always run on GPU device.

And I need to run it on CPU, because mathematics I always debug on CPU 

(and in single thread mode).

On GPU this example runs ok.

To run on CPU one should  add setting to "Environment" line:

ONEAPI_DEVICE_SELECTOR="opencl:cpu"

in "Debugging" configuration tab.

 

NB: CPU also also runs ok, if I run it in opened aside "cmd" shell.

But to debug my problems, I need to run it from within VS2022.

 

Thank you,

Michael.

0 Kudos
SeshaP_Intel
Moderator
1,579 Views

Hi,

 

We have added the ONEAPI_DEVICE_SELECTOR="opencl:cpu" in the "Environment" present in the "Debugging -> Configuration Properties" tab and did not face any issues while debugging the sample till line 144. Please find the below screenshot for more details.

SeshaP_Intel_0-1690977577024.png

 

Please find the attached file(DPCPPConsoleApplication29.rar) for the complete project. In this project, I have reduced the vector_size to "10".

Could you please let us know if you have modified any code or project properties so that we can try and investigate the issue from our end? 

 

Thanks and Regards,

Pendyala Sesha Srinivas

 

0 Kudos
MB_29
Novice
1,561 Views

Thank you for reply.

I've run the project on my home computer and it is compiled and worked properly!

Now I am totally confused.

Do you think antivirus can affect in that strange way debugging flow in Visual Studio?  or something else?

At home I have no antivirus.

At work I've tried on two machines with the same effect.

I also have no privilege to switch off antivirus. I'll contact security team for help and update you.

If you know some issues which can cause the problem update me, also.

Thanks,

Michael

 

0 Kudos
MB_29
Novice
1,516 Views

That is an exception I get trying to execute 

"queue q(selector, exception_handler);"

at my workplace machine in cpu selector.

 

0 Kudos
SeshaP_Intel
Moderator
1,461 Views

Hi,


We can see that you have accepted the solution. Could you please let us know whether your issue is fixed or not?

Please let us know, if there is anything to investigate the issue from our end.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
MB_29
Novice
1,440 Views

Hi.

I've built up clean virtual machine totally disconnected from external world, installed VS2022 and the latest version of oneAPI and confirm that step-by-step debugging in cpu selector and fpga_emu are working fine.

These options don't work properly on my hard machines with multiply antivirus software installed.

 

1. I'm not sure you should investigate something, but I never encountered to the same problem on openMP environment.

2. I have also multiple issues with fpga_sim etc. but it is no sense to continue with them till I find the way to work on clean machine.

 

Thank you for support.

Michael.

0 Kudos
SeshaP_Intel
Moderator
1,342 Views

Hi,


It's great to hear that the project is functioning well on both your home computer and the virtual machine. This confirms that your code is fine, and there appear to be no issues related to the compiler, VS2022 step-by-step debugging, CPU selector, fpga_emu, and the latest version of oneAPI. However, since we are seeing the issue in your work machine, it looks like there might be environment-related factors(such as antivirus software, etc.). It could be beneficial to engage with your security/IT team to get deeper into the issue.


Going by the above rationale, we'll go ahead and close this ticket. In case you need our help in the future, please feel free to post a new thread in the forum and we'd be more than happy to help.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Reply