Summary: | OpenCL support for mandelbulber-opencl | ||
---|---|---|---|
Product: | Mesa | Reporter: | Christoph Haag <haagch> |
Component: | Gallium/StateTracker/Clover | Assignee: | mesa-dev |
Status: | RESOLVED MOVED | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | frederic.romagne |
Version: | git | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | 87738 | ||
Bug Blocks: | 99553 | ||
Attachments: | Add -cl-denorms-are-zero to clang |
Description
Christoph Haag
2014-08-17 00:56:08 UTC
Small additions: With these patches the binary garbage from the build log is gone: http://patchwork.freedesktop.org/patch/31309/ http://patchwork.freedesktop.org/patch/31311/ http://patchwork.freedesktop.org/patch/31310/ So this is already fixed. Problem 4 is not related to mesa I think. The problem is that there is a huge buffer because CL_DEVICE_MAX_COMPUTE_UNITS is so big. Curiously CL_DEVICE_MAX_COMPUTE_UNITS gets increased by 100 every time my gpu wakes up from runpm. I have reduced it to this program: #include <CL/cl.hpp> #include <iostream> int main() { int err, numberOfComputeUnits = 0; std::vector<cl::Platform> platformList; cl::Platform::get(&platformList); cl_context_properties cprops[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties) (platformList[0])(), 0 }; cl::Context *context = new cl::Context(CL_DEVICE_TYPE_GPU, cprops, NULL, NULL, &err); std::vector<cl::Device> devices = context->getInfo<CL_CONTEXT_DEVICES>(); devices[0].getInfo(CL_DEVICE_MAX_COMPUTE_UNITS, &numberOfComputeUnits); std::cout << "OpenCL Number of compute units: " << numberOfComputeUnits << std::endl;; return 0; } Every time my gpu goes to sleep and wakes up this increases by 100. I have reduced numberOfComputeUnits in the code to 1. Then it finally correctly says "clCreateImage() not supported by OpenCL 1.1." So this will then have to wait for OpenCL 1.2. But to me it seems these two things should be addressed for 1.0/1.1 already: * "-cl-denorms-are-zero" * "cannot combine with previous 'type-name' declaration specifier" (at least get a better error message into clang) * CL_DEVICE_MAX_COMPUTE_UNITS (??) (In reply to comment #1) > * CL_DEVICE_MAX_COMPUTE_UNITS (??) Fixed in the kernel: https://bugzilla.kernel.org/show_bug.cgi?id=82581 Created attachment 104907 [details] [review] Add -cl-denorms-are-zero to clang This patch adds the -cl-denorms-are-zero flag to clang, which should fix one of your errors.
>
> Problem 3:
> OpenCL Build log: input.cl:323:10: error: cannot combine with previous
> 'type-name' declaration specifier
> input.cl:323:15: error: expected identifier or '('
> input.cl:324:8: error: expected identifier or '('
> input.cl:325:32: error: expected expression
> �
>
This is a bug in mandelbulber-oepncl. It's using half as a variable name, which is not allowed since half is also the name of a type.
(In reply to comment #4) Thanks, they fixed it upstream: https://code.google.com/p/mandelbulber/source/detail?r=451 That went quicker than I thought. "Only" OpenCL 1.2 is missing then I guess. (In reply to comment #5) > (In reply to comment #4) > > Thanks, they fixed it upstream: > https://code.google.com/p/mandelbulber/source/detail?r=451 > > That went quicker than I thought. > > "Only" OpenCL 1.2 is missing then I guess. Does it require any other OpenCL 1.2 features besides the static keyword on functions? If not then they should just drop the keyword when using a 1.1 implementation. Have all the issues with this program been fixed? (In reply to comment #6) > Does it require any other OpenCL 1.2 features besides the static keyword on > functions? Yes. The next one is clCreateImage I believe (not at the PC right now). Mesa has a stub for it that tells the user is not supported in opencl 1.1. I haven't gotten around testing the denorms parameter yet, but assuming it works I don't think there's anything to do for OpenCL 1.1. So close it until there's opencl 1.2 or keep it open and update whether something it uses is implemented, however you prefer it. But it's not very important, so if you have something better to do, please don't go out of your way to support it. To document the current state... Recently I was getting "unsupported call to function get_global_id" so I assumed there was some llvm problem. Turns out if this happens you just need to rebuild libclc for your llvm version. With these patches mandelbulber-opencl sorta works: https://cgit.freedesktop.org/~funfunctor/mesa/log/?h=clover-image-support-enabled When I first tested the patches, I made this Video: https://www.youtube.com/watch?v=-R-r0CEub74 The rendering actually looks close to how OpenCL from amdgpu-pro renders. Today it sorta works, but looks worse. Some comparison screenshots: Default view: clover: https://i.imgur.com/kct6anR.png amdgpu-pro: https://i.imgur.com/1FIQ07m.jpg A little bit zoomed in; clover: https://i.imgur.com/5SmwL6Q.png amdgpu: https://i.imgur.com/CcPwcpl.png Possibly it's just an image format mismatch, see https://cgit.freedesktop.org/~funfunctor/mesa/commit/?h=clover-image-support-enabled&id=894fb7c558e83534855516b499bf66b33397e1ac -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/129. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.