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

Trying to run any sample on osx big sur, results in "The function clCreateCommandQueueWithProperties is not supported" #39

Closed
tonywestonuk opened this issue Feb 18, 2021 · 3 comments

Comments

@tonywestonuk
Copy link

Im trying to get JOCL working on an Apple M1 Macbook.

Downloading version 2.0.4 appears to pick up the correct dylib for arm. but get the error function clCreateCommandQueueWithProperties is not supported, reardless what sample I attempt to run.

trying with Zulu java for arm64.
Its probably me not not knowing what I should do. But, help. :/

@tonywestonuk tonywestonuk changed the title Trying to run any sample on osx big slur, results in "The function clCreateCommandQueueWithProperties is not supported" Trying to run any sample on osx big sur, results in "The function clCreateCommandQueueWithProperties is not supported" Feb 18, 2021
@gpu
Copy link
Owner

gpu commented Feb 19, 2021

As far as I know, the OpenCL support of Mac is not entirely "up to date". Specifically, I think that it does not support OpenCL 2.0, where clCreateCommandQueueWithProperties was introduced. You should be able to run https://github.com/gpu/JOCLSamples/blob/master/src/main/java/org/jocl/samples/JOCLDeviceQuery.java though, and it should print the CL_PLATFORM_VERSION.

Surprisingly, this prints OpenCL 1.2 CUDA 11.2.66 for me, so strictly speaking, clCreateCommandQueueWithProperties shouln't be available for me either, but apparently, it is supported (handwaving: Maybe NVIDIA added it, even though they only support 1.2 officially and fully, and it is just picked up by the ICD).

In any case, when there is code like this in one of the samples...

    // Create a command-queue for the selected device
    cl_queue_properties properties = new cl_queue_properties();
    cl_command_queue commandQueue = clCreateCommandQueueWithProperties(
        context, device, properties, null);

then you should be able to replace it with

    // Create a command-queue for the selected device
    cl_command_queue commandQueue = clCreateCommandQueue(
        context, device, 0, null);

(the function is marked as "deprecated", and I'd have to look up how you could sensibly emulate the cl_queue_properties is this is required, but maybe it's sufficient for a first test...)

@tonywestonuk
Copy link
Author

Yes, this works..... The Mandelbrot sample working using this 👍
Screenshot 2021-02-19 at 15 44 08

Thank You for your time and efforts :-)

@gpu
Copy link
Owner

gpu commented Feb 19, 2021

Good to hear that. Assuming that it's OK to close then.

@gpu gpu closed this as completed Feb 19, 2021
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