Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble getting diagnostics for CL files. #36

Closed
LouChiSoft opened this issue Mar 11, 2022 · 4 comments
Closed

Trouble getting diagnostics for CL files. #36

LouChiSoft opened this issue Mar 11, 2022 · 4 comments

Comments

@LouChiSoft
Copy link

LouChiSoft commented Mar 11, 2022

Hi I am trying to set up the extension to provide diagnostics for my CL files. I have the extension installed and the AMD OpenCL runtime as part of my driver. I have checked using the OpenCL: Info command and it returns a valid platform. My CL files have autocomplete and syntax highlighting, but doesn't provide any diagnostics for incorrect code. I see in the extension page that it mentions that for offline compilation it needs the Intel OpenCL SDK, is it also required for the diagnostics? If so this seems inconvenient as the link in the extension page take you a site that no longer links to Intel's SDK or System Studio. Instead taking you to their oneAPI site which only mentions SYCL and not OpenCL and also requiring you sign up to download anything. The SDK I have installed was built from the official Khronos repo, is there anyway to use that if offline kernel compilation is needed for the diagnostics?

I have tried this on two machines, one using AMDs runtime and the Khronos SDK. And another one using Intel's runtime and an older version of Intel's SDK

Example kernel I used to test diagnostics, there should be an error on line 4 where there is a missing semi-colon

__kernel CLEntry(const int *src, int *dst) 
{
  const uint idx = get_global_id(0);
  const uint size = get_global_size(0)

  dst[size - idx] = src[idx];
}

The output from the log

00:43:25:050 ERR vscode::opencl::Diagnostics::BuildSource:191 #diagnostics Failed to build program, error: clBuildProgram (-66)
00:43:25:050 ERR vscode::opencl::Diagnostics::BuildSource:203 #diagnostics Failed get build info, error: clGetProgramBuildInfo (-33)

Output from the language server window

State changed: 1 -> 3
State changed: 3 -> 2
Ready
@LouChiSoft
Copy link
Author

LouChiSoft commented Mar 11, 2022

Update: I did manage to find the most recent Intel OpenCL SDK from a different link here, but it does still need you to sign up for it. However, installing it didn't provide diagnostics and I got the same errors in my log as above

@Galarius
Copy link
Owner

Galarius commented Mar 12, 2022

Hello, @LouChiSoft!

The error -66 is CL_INVALID_COMPILER_OPTIONS, which means the specified compiler options are invalid.
Even if OpenCL.server.buildOptions setting is empty, I still pass -I <source directory> option to the clBuildProgram.
Likely this is why compilation failed, and you do not have the diagnostics. I will remove -I as this option is not portable (#33).

@Galarius
Copy link
Owner

I updated opencl-ls and integrated binaries into the new vscode-opencl version 0.7.3. It should also appear in MS Store soon.
I hope this will resolve the issue.

@LouChiSoft
Copy link
Author

That's worked perfectly. Opened the same test folder and all the cl files immediately had diagnostics. Thanks for the quick turn around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants