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

clCreatePipe error -30 #157

Open
EricksonLu opened this issue Nov 3, 2021 · 6 comments
Open

clCreatePipe error -30 #157

EricksonLu opened this issue Nov 3, 2021 · 6 comments

Comments

@EricksonLu
Copy link

EricksonLu commented Nov 3, 2021

Hi, I just build OpenCL SDK on my laptop. And all its samples code can work. But when I try to build and run the examples at CLHPP all these three programs try to create a cl::Pipe
cl::Pipe aPipe(sizeof(cl_int), numElements / 2);
throw "clCreatePipe -30"....I don't know how can I fix this. Please give me some hints.
Thanks for all.

Here is enumopencl output:
Platform:
Name: AMD Accelerated Parallel Processing
Vendor: Advanced Micro Devices, Inc.
Driver Version: OpenCL 2.1 AMD-APP (3075.13)
Device[0]:
Type: GPU
Name: gfx902
Vendor: Advanced Micro Devices, Inc.
Device Version: OpenCL 2.0 AMD-APP (3075.13)
Device Profile: FULL_PROFILE
Driver Version: 3075.13 (PAL,HSAIL)

And there is another problem:
When the trivial example compile failed the kernel code:
Plat: OpenCL 2.1 AMD-APP (3075.13) Errors for failed build for all devices Device: gfx902 C:\Users\luyao\AppData\Local\Temp\\OCL4476T1.cl:1:1: error: unknown type name 'sakfdjnksajfnksajnfsa' sakfdjnksajfnksajnfsa ^ C:\Users\luyao\AppData\Local\Temp\\OCL4476T1.cl:1:22: error: expected identifier or '(' sakfdjnksajfnksajnfsa ^ 2 errors generated.

It seems no problem at these lines. What's the problem is? Please give me some hints. Sorry to make trouble you.

@bashbaug
Copy link
Contributor

bashbaug commented Nov 4, 2021

Hello, I don't have access to this device to test, but here are a few things to try:

Error code -30 is CL_INVALID_VALUE. According to the spec, the conditions where clCreatePipe can return CL_INVALID_VALUE are:

(from: https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clCreatePipe)

  • CL_INVALID_VALUE if values specified in flags are not as defined above.
  • CL_INVALID_VALUE if properties is not NULL.

When I run the "header example" from my PR #151 on my device, I'm seeing:

>>>> clCreatePipe: context = 0x55ade4c50d00, flags = CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS (201), pipe_packet_size = 4, pipe_max_packets = 16
<<<< clCreatePipe -> CL_SUCCESS

I've also verified that the pipe properties are NULL, as required, so, I think this is all OK?

Could you try an example that uses pipes without the C++ bindings, or even the pipes CTS test, to see if it works as expected?

Since your device supports OpenCL 2.x pipes should be supported, but it may also be interesting to query some of the pipe device properties (see this part of the OpenCL 3.0 spec appendix) to see what your device returns - clinfo should be able to help.

@EricksonLu
Copy link
Author

Here is my debug code at opencl.hpp
object_ = ::clCreatePipe(context(), flags, packet_size, max_packets, nullptr, &error); fprintf(stdout,"context = %x,flags = %d,packet_size=%d ,error =%d\n",context(),flags,packet_size,error);
The fprintf code is my debug code. I'm seeing :
context = 55a8f150,flags = 513,packet_size=4 ,error =-30 . It seems that the flag is different with yours. After I use // cl_mem_flags flags = 201; , The error is gone.

I also try the test_pipes at CTS.
PASSED sub-test. PASSED 55 of 55 tests.
I didn't try clinfo as I got with a {"message":"Artifact not found or access denied."} page.

@bashbaug
Copy link
Contributor

bashbaug commented Nov 8, 2021

Odd, the 201 in my output is hexadecimal, so it should match your decimal 513 (it's the "call logging" output from the OpenCL Intercept Layer). This matches CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS, which are the proper flags to use when creating a pipe.

What exactly changed so that "the error is gone"? While I'm encouraged by this and that the pipes CTS test is passing, I still can't quite explain why it started working.

Thanks!

@EricksonLu
Copy link
Author

cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS;
flags = 201;
I just assigned flags again, as I thought the flags is wrong. After changes that. That error is gone.
context = 7f54c340,flags = 201,packet_size=4 ,error =0
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS;
flags = 201;
object_ = ::clCreatePipe(context(), flags, packet_size, max_packets, nullptr, &error);
fprintf(stdout,"context = %x,flags = %d,packet_size=%d ,error =%d\n",context(),flags,packet_size,error);
It confused me either.
Even object_ is NULL, the Output seems is correct:

	3
	3
	3
	3
	3
	3
	3
	3
	3
	3
	3
	3
	3
	3
	3
	75
	75
	75
	75
	75
	75
	75
	75
	77
	77
	77
	77
	77
	77
	77
	77



Process finished with exit code 0

@nicholaskomsa
Copy link

It appears that this is a issue still? The code put out in the SDK, on my initial attempts, errors on clCreatePipe inside of cl::pipe constructor, changing flags = 201, as suggested, causes the program to not throw, and I assume work correctly? If this could be issued as a bug or something, or has been, or is, IDK.

@nicholaskomsa
Copy link

What is with 201? this is effectively just CL_MEM_READ_WRITE and no CL_MEM_HOST_NO_ACCESS, is it still working normally? please help. My output is somewhat like what is printed above.

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

3 participants