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
blender: add option for OptiX #106888
blender: add option for OptiX #106888
Conversation
Thanks for doing this. I'm wondering if it would be a good idea to remove the
I don't feel very strongly about it, but if it seems like a good idea to keep the option, then maybe we should consider having it follow |
Good point. My reasoning at the time was that you might want to enable CUDA support without enabling OptiX, however, as you mentioned those cases would be quite rare. I think integrating the OptiX into the CUDA setting is the way to go, since it removes a useless setting (optixSupport), and anyone wanting to use OptiX would only have to update nixpkgs and not fiddle with another override setting. I'm guessing I delete the pull request and open a new one with the changes, or can I simply add another commit to the existing pull request? |
You should be able to just push another commit to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the headers pulled when optixSupport = true
are not free. I think we should update the blender.meta.license
field to indicate that.
Perhaps something like
meta = {
# skip
license = with licenses; [ gpl2Plus ] ++ optional optixSupport unfree;
}
Considering the license, it would make more sense (than before) to have optixSupport as a separate setting, since the cudaSupport doesn't affect the license. Not sure if I have convinced myself though. Any opinions? Personally, I still vote to merge it with cudaSupport. I'm working on the changes, and they should be online soon EDIT: Another idea could be to make optixSupport follow cudaSupport by default (as @InternetUnexplorer proposed), that way it would be possible to have cudaSupport enabled while still having a free license. But again, I don't think that that user base would be enormous. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Edit: reading the license comment at the top of the headers, they definitely seem to be unfree, so it seems like @veprbl is right. |
Oh, I didn't even think of that. Good point. In that case, I'm personally in favor of keeping the option and having it follow
Again, I don't feel very strongly about this, just putting my thoughts out there. |
One last thing: I mentioned this earlier, but would it be worth it to ensure that Blender cannot be built with I think the build will still succeed in this situation (although I'm not able to check right now), OptiX just won't work obviously. |
IMHO less options is better because they don't need to be tested if they don't exist. Having said that, I don't know how optix is related to CUDA. |
I'm confused about it as well, so I looked into it a bit. Here's what I've learned so far (may be wrong!):
So, it seems like it's pretty complicated. It doesn't seem like it's possible to enable OptiX support without the OptiX headers, but it does seem possible to build OptiX/CUDA support without the CUDA headers. Also, while it's not strictly related to this PR, it seems like it's possible to build Blender with dynamic support with CUDA. I might make a separate PR for enabling that, since it would mean that Blender would not need to be rebuilt when someone enables |
Shouldn't optix go into its own file and own attribute in nixpkgs, so that is can be reused if other software needs it? |
Apparently it's not possible due to legal reasons, at least according to this comment in the Arch PKGBUILD. |
It's probably because the headers are not redistributable, but this is not a problem with nix if the derivation is properly marked as unfree, I think. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
@NomisIV Can you please update the PR? Latest OptiX is 7.2.0 now .. |
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
The arch package, which I used for reference, is not yet updated to use OptiX 7.2.0, so I can't just copy their new link and checksum. I'm away from home over New Year's, but in a couple of days I'll get back home and be able to fix it. |
Regarding the update to OptiX 7.2, I tried my best but I remain defeated. I tried simply bumping the numbers in the url to the library, but that didn't work. I went as far as to make an NVidia Developer account to be able to download the right version, but all that gave me access to was a shell script with a tarball appended to the end of the file. I could upload it somewhere for someone to analyze, but there was a pretty scary looking license in the file as well, so I don't want to be the one doing that. And since Arch Linux hasn't updated to 7.2 either, I don't think it's a massive problem. How shall we proceed? |
Let's proceed with 7.0. Thank you for trying OptiX 7.2! |
OptiX support was added to Nixpkgs in NixOS/nixpkgs#106888.
Motivation for this change
Added support for OptiX in blender. I added it as an option, just like cudaSupport, so that it wouldn't be mandatory.
I have successfully built this package on my own machine (running NixOS). I don't think the changes are big enough to cause any major problems.
Something worth noting is that this is done in the same way as Arch linux has implemented it: link
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
(I could successfully build it with a recent clone of nixpkgs)
./result/bin/
)(Blender started, and the OptiX render option is both visible and working)
nix path-info -S
before and after)(Commit message follows the guide lines, I think)