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

Remove const modifier on float4 color definition in volume kernel #80

Merged
merged 2 commits into from
Sep 23, 2022

Conversation

beowulfey
Copy link
Contributor

There is a bug with the ClearVolume Fiji plugin where it is unable to compile the VolumeRender kernel on Intel GPUs. The plugin works fine on Nvidia GPUs, but on a PC with an Intel GPU the window appears blank, and an error message appears in the log (as well as a full output of the source code). An example of this error code can be found in #76; there are a lot of other examples of errors with NullPointerExceptions, and I wonder if they are related!

Basically, there is a float4 definition for "color" that is labeled const, but then immediately modified right after that. For whatever reason, Nvidia GPUs seem to be fine with this, but Intel must be stricter and fails to compile. Removing the "const" allows the kernel to compile on both Nvidia and Intel, but I haven't tested it anywhere else yet.

I think, given the code that is right below the color variable definition, it is NOT meant to be const, but I am absolutely not familiar with OpenCL development at all, nor could I even safely call myself a Java developer. If this change is dangerous, I hope someone else might catch it; however, I can say that I am very happy to finally be able to use CV on my intel-GPU laptop!

The const modifier on the float4 color definition at line 295 seems to cause problems with Intel GPUs. I removed that modifier (I have NO idea if this is a bad thing to do) and the kernel now compiles on both Nvidia and Intel GPUs. This means that the ClearVolume FIJI plugin can now work on Intel GPUs, whereas it would crash otherwise.
Removed const modifier for color variable
@nicost
Copy link
Contributor

nicost commented Sep 18, 2022

Is there anyone still monitoring this repository? Just realized that some of the newer NVidia GPUs do the same checking as the Intel GPUs (fair enough! if you make something const, most languages will not let you modify it), resulting in empty 3D viewers in both Fiji and Micro-Manager. It would be really awesome to merge this PR, and push out a new version to https://maven.scijava.org. If nobody is maintaining the repository, please let's discuss how to keep this usable. There are plenty of people making use of the ClearVolume plugins in Fiji and Micro-Manager (and they really like them!).

@nicost
Copy link
Contributor

nicost commented Sep 18, 2022

I can attest that this simple change fixes display issues under both Fiji and Micro-Manager on my laptop using Intel GPU. Also suspect that newer NVidia drivers may do the same checking for const that the Intel GPU drivers do.

@jdeschamps jdeschamps merged commit 7482d98 into ClearVolume:master Sep 23, 2022
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

Successfully merging this pull request may close these issues.

3 participants