Bug 1094777 - Blender cycles are broken
Blender cycles are broken
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: E-mail List
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-27 16:14 UTC by Mateusz Mikuła
Modified: 2018-06-07 22:38 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Mikuła 2018-05-27 16:14:34 UTC
Blender spec file has command that removes cycles headers from the package.
It results in broken GPU rendering with cycles, example with CUDA:
```
Compiling CUDA kernel ...
"/usr/local/cuda/bin/nvcc" -arch=sm_61 --cubin "/usr/share/blender/2.79/scripts/addons/cycles/source/kernel/kernels/cuda/kernel.cu" -o "/home/mateusz/.cache/cycles/kernels/cycles_kernel_sm61_52CFAD0EF032EEC8D0F7A458B14C818A.cubin" -m64 --ptxas-options="-v" --use_fast_math -DNVCC -D__KERNEL_CUDA_VERSION__=92 -I"/usr/share/blender/2.79/scripts/addons/cycles/source" 
/usr/share/blender/2.79/scripts/addons/cycles/source/kernel/kernels/cuda/kernel.cu:21:10: fatal error: kernel/kernel_compat_cuda.h: No such file or directory
 #include "kernel/kernel_compat_cuda.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CUDA kernel compilation failed, see console for details.
```

Removing `find %{buildroot}%{_datadir}/%{name}/%{_version}/scripts/ -name "*.h" -print -delete` from line 321 as shown here: https://build.opensuse.org/package/rdiff/home:mati865:branches:graphics/blender?linkrev=base&rev=2 resolves issue and Blender works fine.

However it causes rpmlint errors:
```
[  988s] A file that is needed only e.g. when developing or building software is
[  988s] included in a non-devel package. These files should go in devel packages.
[  988s] 
[  988s] (none): E: badness 10450 exceeds threshold 1000, aborting.
[  988s] 3 packages and 0 specfiles checked; 209 errors, 0 warnings.
[  988s] 
[  988s] 
[  988s] linux-d4vu failed "build blender.spec" at Sun May 27 12:56:33 UTC 2018.
[  988s]
```

On Fedora those headers are packed in the main package causing rpmlint warnings which are ignored: https://taskotron.fedoraproject.org/artifacts/all/3f4f799e-48ae-11e8-a47d-525400fc9f92/tests.yml/blender-2.79b-3.fc28.log
Comment 1 Dave Plater 2018-05-28 06:28:53 UTC
Blender is deliberately packaged to be gpu and cpu agnostic in openSUSE, I'm assuming that this bug is against the source rpm and the output you posted is the result of some form of build command.
It is impossible to package anything built against cuda due to license issues.
Could you please post the steps to reproduce this bug.
Comment 2 Mateusz Mikuła 2018-05-28 08:24:20 UTC
> Blender is deliberately packaged to be gpu and cpu agnostic in openSUSE, 

Without cycles headers Blender GPU rendering doesn't work with Nvidia at least. I cannot test OpenCL because I don't have AMD card but I expect it to fail because `kernel_compat_opencl.h` was removed as well.

> I'm assuming that this bug is against the source rpm and the output you posted is the result of some form of build command.

First error (with CUDA) happens when Blender tries to build cycles kernel.
Second error with rpmlint is the impact of removing line which breaks cycles from `blender.spec`, I don't know how to solve it in openSUSE.


> It is impossible to package anything built against cuda due to license issues.

Those headers are property of Blender Foundation and are licensed under Apache License, Version 2.0.
CUDA is not unnecessary for package building. Blender will build and link cycles kernel against it on runtime.


> Could you please post the steps to reproduce this bug.

1. Start blender from terminal with command `blender`
2. In Blender open: File->User Preferences (or use Ctrl+Alt+U)
3. Go to System tab and under Cycles Compute Device select CUDA or OpenCL depending on the GPU
4. Save and exit settings
5. At the centre or top toolbar click list with `Blender Render` selected and choose `Cycles Render`
6. On the right toolbar change Device from `CPU` to `GPU Compute`
7. Click Render above previously changed Device
8. Look into terminal for errors
Comment 3 Dave Plater 2018-05-28 14:17:00 UTC
So the solution is to include the headers as is done in Fedora.
Thanks for your input.
Comment 4 Swamp Workflow Management 2018-06-01 16:20:05 UTC
This is an autogenerated message for OBS integration:
This bug (1094777) was mentioned in
https://build.opensuse.org/request/show/613495 Factory / blender
Comment 5 Dave Plater 2018-06-02 11:41:26 UTC
I've packaged /usr/share/blender/2.79/scripts/addons/cycles directory in 
blender-devel and made it a dependence of blender.
It's just been accepted to Factory. Please test install blender after it has built. If installing blender also installs blender-devel you have the correct version.
Comment 6 Mateusz Mikuła 2018-06-02 17:28:35 UTC
Works fine, thanks.
Comment 7 Dave Plater 2018-06-03 08:27:55 UTC
I need to update Leap:15.0
Comment 8 Dave Plater 2018-06-03 11:07:34 UTC
Created mr#613773 to Leap:15.0
Comment 9 Swamp Workflow Management 2018-06-03 11:40:09 UTC
This is an autogenerated message for OBS integration:
This bug (1094777) was mentioned in
https://build.opensuse.org/request/show/613773 15.0 / blender
Comment 10 Dave Plater 2018-06-04 14:58:30 UTC
Update to Leap:15.0 accepted
Comment 11 Swamp Workflow Management 2018-06-07 22:11:48 UTC
openSUSE-RU-2018:1594-1: An update that has one recommended fix can now be installed.

Category: recommended (low)
Bug References: 1094777
CVE References: 
Sources used:
openSUSE Leap 15.0 (src):    blender-2.79b-lp150.2.3.1