Blender 2.79: OpenCL on par with CUDA
wiki.blender.org
wiki.blender.org
Edit here's the post https://news.ycombinator.com/item?id=13379597
Blender's UI is so much better this way. The idea that the functionality of any professional software tool should be immediately visible is just silly. Photoshop, GIMP, Autocad, 3DS Max, Maya, etc. all follow that philosophy, and just end up with way too many buttons and menus for anyone to want to sift through. Blender shows functionality only where it is needed in the most beautiful modular system I have ever used.
One thing I ran into was it seemed there are some shortcuts that are essential and basically wired to the number pad so I had to buy an external keyboard (and non trackpad mouse).
I haven't had time to get back to it again but I'm looking forward to sitting down and having another good play.
Edit I'm not super familiar with autocad but I make software for construction companies so I've seen it used a bit. You can do everything in a vim like command manner. I think it had a lisp prompt.
I'll admit, I'm even less familiar with AutoCAD. I really just assumed from my experience with every other AutoDesk software I have seen.
> I think it had a lisp prompt.
AFAIK, AutoLISP is still one of the most prevalent lisps.
There is an irrational fear of modal interfaces that is prolific in teaching software design. It seems like everyone has agreed that Caps Lock sucks, and therefore modal interface is inherently awful.
It's also very dev friendly. And exploring its file format makes for very good nerdy times.
I also highly recommend trying out the Pie Menu addon addon in the settings. It's more or less becoming an official part of the Blender UI flow
"OpenCL works fine on NVIDIA cards, but performance is reasonably slower (up to 2x slowdown) compared to CUDA, so it doesn't really worth using OpenCL on NVIDIA cards at this moment."
I wonder if that's intentional on NVIDIA's part.
Does it mention which version of OpenCL they're using? I'm looking forward to hearing news about v2.x and SPIR-V.
I highly doubt it, a normal resource allocation conflict would suffice.
NVIDIA has everything to gain by being ahead on each and every metric and to purposefully hobble that would eventually come out and would make people decide to buy a non-NVIDIA product in the meantime.
I think the reason is more that NVIDIA has been able to tailor CUDA to a much larger degree to match the architecture of their cards and by extension anybody that writes for CUDA automatically benefits from that. OpenCL is more general but that also immediately implies that it will be less efficient. And it doesn't take all that much in terms of missing optimizations (a single memory fetch penalty would do) to get a 2x penalty. GPU programming is much less forgiving when it comes to subtle mistakes than regular programming because it immediately gets multiplied by a very large factor rather than a single missed cycle.
A nice example of the reverse: ATI cards dominated the bitcoin GPU mining scene because of their ability to do a particular operation in one clocktick instead of two on the NVIDIA cards.
I think that's a reasonable guess. NVIDIA only supports OpenCL 1.2 (and it took them about 6 years to get there from 1.0, while other vendors were at 2.x).
While I don't think NVIDIA ever outright stated OpenCL was on the back burner, their support clearly waned, which devs noticed (https://streamcomputing.eu/blog/2012-09-10/nvidias-industry-...).
As for why...well, why should NVIDIA participate? They don't have anything to gain when they already have CUDA dominating the industry.
Everyone working in it seems to agree there are good reasons for it dominating. Just easier to work with overall.
Is it broken in any way?
Also, this isn't a monopoly, OpenCL exists.
There are 2 NVIDIA drivers. It turns out pinned memory transfers are 2x faster with the Tesla driver (vs the Geforce driver). This can matter a lot for some workloads. For some reason you can't use the faster driver with cheap consumer cards.
So, in my view NVIDIA is dumbing down performance for OpenCL and CUDA alike, and also slowing down the unavoidable OpenCL adoption.
Of course, while it's the cheap consumer garbage ^W^W pro-gaming hardware, the prices are okay, since these are kept in check by AMD. Once we get to the relabelled consumer garbage ^W^W^W professional compute hardware, you pay for it. Dearly. Why? No one that keeps them in check through competition.
EDIT: even the Titan Xp while being much more expensive than the 1080Ti is still vastly cheaper than Teslas
I am sure their Windows driver actually worked. However that still meant that for my hardware OpenCL was about as portable as CUDA. Just with a Windows lock-in instead of a NVIDIA lock-in.
Edit: Just to note this was a few years ago. I have no idea what the current state is.
It's not perfect, but it's already quite good, and improving rapidly.
From my view, it's not just that CUDA > OpenCL. Rather, it's CUDA ecosystem >>> OpenCL ecosystem. The tools, the libraries, the documentation, the community - all of these are superior on the CUDA side. If you give all those up to use OpenCL, how do you make up for that cost?
https://www.intelligentinvestor.com.au/2012/07/ykk-the-zippi...
Since SPIR-V allows you to effectively define your own Shader APIs, and OpenCL has more and more bindings with other platforms, including ones that support the web like Go, Javascript and a new support layer for WebGL, it is absolutely a game (no pun intended) for Nvidia to lose in the longrun.
When has a monopoly never not been caught frantically trying to buy out knockoff companies that spawned from teams developing on opensrouce alternatives in innovative places after they became comfortable and confident with being a closed source monopoly?
On top of this, graphics programmers, the games industry and advanced web support, especially now that AWS and I think google cloud integrate server hosting with GPUs (and companies like Blazing DB for easier integration) will only exponeniate the rate of advantage opensource has since this is a race with some of the best programmers in the world, with a ton of money behind it.
I am curious what NVIDIAS end game is here. Already they were trailing behind the after party with their releases post AMD Ryzen, and I havn't heard anything at all exciting on NVIDIAs part to counter since the Vulkan release and SPIR-V integration announcements, which are some of the most promising I've seen yet, and expansive for programmers who have otherwise avoided this platform due to the extremely indepth learning curve and requirements to be somewhat experienced C/C++ programmers.
It took me 8months to be able to write a good kernel and some good host code with opencl because I did the entire integration in C and C++ and I've been developing with it since 1.2, but with more languages a broader range of support applications, perspectives and contributions will go to the opensource dev.
So far, outside of currently dominating the industry and embedding some long term runway with large contracts and having a head on red tape involved with larger corporations they have contracts for hardware and support embedded with, I don't see what advantages NVIDIA is getting the industry excited about in the long run.
When it comes to savvy programmers in Silicon Valley, a friend of mine who works as a PhD programmer in Deep Learning with Google Scientists did an unofficial ad hoc poll on her twitter, asking people why so much opencl hate and so much CUDA in the valley? There were lots of responses from lots of people, but I only saw on repeated reason over and over again, the initial learning curve is lower with CUDA and its more convenient. There were no specs of performance advantages in discussion.
In the functionalities I apply OpenCL to, CUDA doesn't even offer the same functionality, and in many ways processes algorithms by simply parsing out algorithms CPUs utilized, but OpenCL never assumed this as an optimal path, and reconsiders the entire structure of the algorithm and data its working with, often times reorganizing formats for processing entirely different from CPUs that NVIDIA incorporates as a default.
It's more work to learn than CUDA, but the advantages are worth it in my experience so far.
As a last consideration, When it comes to NVIDIA trying to make their products compatible with OpenCL and OpenGL, I predict that promise of that to be delayed at best, as it took NVIDIA 5 years to make their hardware std OpenCl 1.2 compatible. Vulkan is extremely large in terms of the source code, and SPIR-V is nontrivial, OpenCL is standard 2.0 now, so if getting OpenCL 1.2 was hard for them to integrate in under 5 years, we can expect a lot longer given the new releases.
The learning curve is now going away with the recent releases, so whats the next step with NVIDIA? Good question. The only advantage they seem to have is that they have an advantage right now, but that becomes circular and perhaps backwards going forward.
This strangely reminds me of Microsoft getting ubuntu to run in a Windows partition checksum for checksum, to offer cross compatibility with other operating systems as an advantage to stay competitive in the demographic that produces the most advancement within their own industry.
Can you explain what you mean? Reads like gibberish.
OpenCL does something similiar with the null values, but redesigns the entire compression format reading in matrix data and the entire computation of accessing the tiles of data differently based on the format they have for parsing and accessing the data.
I am trying to find a good explanation online, but I can only find what I have in the OpenCL 1.2 Book Chapter 22 on SPMV, where they visualize and explain CUDAs format, and then OpenCLs format, and provide performance comparisons between the two methods using the standard 22 matrix sets provided by the University of Florida.
OpenCLs performance was better on every metric, the smallest increase in performance cutting computation time by one half, the rest were closer to a third. They ran their own CUDA testing, but also provide the whitepaper results from CUDAs testing, and use NVIDIAs reported results as their official comparison.
For an influx of repetitive real time data reading in millions of data points every few seconds, this kind of advantage is not of a negligible significance.
It took a long time to work with but of course now I can reap the benefits every few seconds on large datasets forever so I found it worth diving into the performance specs on this case.
While I cant find an online visual of the designs for CUDA vs OpenCL explained in CH22, the source code for the std SPMV I speak of here is on one of the authors github: "bgaster" is the username. You should be able to download the code working cross platform and read in matrices of your choice, and compare performance on your own if you have datasets you want to look at.
The OpenCL book I highly recommend. It explains how to use opencl and provides comprehensive examples, walking through concepts with code for 22 chapters. The source code for that book is there with the rest of bgasters stuff. It's definitely not a trivial language to take on. The learning curve is steep. However, I learned GPUs through OpenCL, so I don't know if it would be easier coming from CUDA, biases about what to expect because the learner is already reaping the benefits of CUDA aside.
I took time initially to read through the entire 1.2 openCL API over a couple of weeks. It's one of the most comprehensive and detailed API's I've ever read and I find myself dissapointed with documentation of other groups in comparison. Once you are familiar with the scope of functionality available to you, I typically keep the PDF API open and search F for concepts and find whats available to me as I code through things. The most recent API is just as good and can be found here:https://www.khronos.org/registry/OpenCL/specs/opencl-2.2.pdf
Also, one of the authors of OpenCL works fulltime at Apple now, and opencl comes installed and simply working on any OSX operating system. So if you happen to have a mac, it should be relatively easy to download some working source code and try out.
I have OSX, and was also able to download an SDK for my NVIDIA graphics card on an asus zenbook running fedora 24, and got it up and running just fine in an hour or so, for total install and testing.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP
So when is Intel going to join the party?
Then I got tired of waiting 4 years for any of the GPU computing software I was interested in to support it and bought an Nvidia GPU and a PC to run it instead and became part of the problem.
I think the whole point of Vulkan and particularly SPIR-V, was to offer support for broadened languages including but not limited to Javascript.
OpenCL even has go bindings now.
SPIR-V allows you to define your own SHADER APIs.
Right now, it's alot to learn, but going forward, it hard to ignore the advantages in the functionalities and the broadened support to lower the barrier for learning by increasing the number of languages you can work with OpenCL in, particularly ones that predominately support web dev as we move to cloud developing and hosting AWS and Google Cloud with GPUs.
The cloud is a big one here to consider for potential shift in market share because if one group hosting the cloud finds OpenCL to be particularly beneficial, all they have to do is offer support ontop of a stack like Blazing DB, which I imagine a GPU server support stack will be engulfed within cloud platforms backend within 5 years anyways, and suddenly thousands and thousands of companies rely on it and it becomes and industry standard.
The shift in a market where cloud hosting exists on GPUs, becomes more based on what large companies who have the money and talent to go in depth and scale out support for OpenCL based functionalities moreso than the barrier every single developer or hip web dev hosting on the cloud is wanting to overcome to invest in low level kernel writing and hardware optimization.
Throw the games industry in with Vulkan, with opensource games on PCS always competing with console based games, and I see alot more support in the long run with OpenCL.
I would test myself but don't have an NVIDIA card handy.
See https://www.indigorenderer.com/benchmark-results for some benchmarks. All GPU results are using OpenCL.
We used to have both an OpenCL and CUDA implementation in earlier versions. The CUDA version was slightly faster (10-15%?) on Nvidia cards, but not worth the effort of maintaining both implementations.
If you run native OpneCL 2.0 on NVIDIA GPUs you aren't getting a major penalty, there will still be things that CUDA is going to be faster at but that has nothing to do with intentional gimping.
- the problem blender is solving is super hard
- the competition was way ahead
- FOSS don't have great track record for this kind of challenge (gimp has never replaced photoshop nor LibreOffice MSO)
- they don't have that much resources
- professionals are very demanding
- the graphic space is not really foss friendly
- the amount of work they poured into this is incredible
They are heroes really.
It's so modular that it's very easy to extend.
A new fluid sim algorithm? A few months later Blender is shipping it.
That's also the reason it's fast. It starts in one or two seconds.
But if you take into account how the Blender project is handled with consideration of how to sustain itself via the Blender Foundation, and all the related projects, you can observe how an outlier it is compared to all similar ambitious projects that are not doing so well.
This is a bad and a good sign: it makes evident how little FOSS projects take in account it's sustainability over time, on the other hand it presents an opportunity for huge improvements in this area.
My hunch is Professionals as users might also be a benefit as they will tend to put up with bigger learning curves if they see benefits in the end. Also professionals don't tend to care as much about look of the UI (harder to do without dedicated design resources) vs efficiency of using it.
That's like saying Linux doesn't have a great track record cause it hasn't replaced MS Windows. To be successful, they don't have to replace, just service a different niche / enable new or additional uses (e.g. I don't have $$$, I need better support&customization)
Gimp was used for a few movies https://en.wikipedia.org/wiki/CinePaint
A few successful examples of usage of X (like Gimp) in the industry doesn't make it remotely in the same league as proprietary star Y (like Photoshop). Don't try to create a reality out of the thing we all wish were true. FOSS is not winning those battles yet.
Agreed on Maya, but Houdini's node based workflow has ruined me on essentially any other piece of 3D/CAD software. As a programmer it is so obviously the right way to do 95% of the things...
But really, as much as I like blender and open source, you hit the nail on the head, Houdini is on another level of awesomeness. Basically functional modelling done right.
I just wish that it had as good of tools for NURBS as it does for polygons, but at that point it basically becomes Rhino/Grasshopper, and that's not really what Houdini's for. I also kind of wish that VEX wasn't a thing, I don't really want to have to learn an entire mini language to get into the guts. I try to do all of that in VOPs unless it gets complicated.
Is this true in professional environments? I thought Maya was still far ahead...
For effects most shops use Houdini.
I'm not aware of any major studios or effects houses using Blender, but that would be cool!
https://www.blendernation.com/2017/02/23/man-high-castle-sea...
https://www.reddit.com/r/IAmA/comments/5rvwo2/comment/dddidn...
Technically you can use it standalone, but it's not a great experience. There are no binaries, it's painful to build, and the only way to interact with it is via an undocumented XML format; and I haven't found any way to do truly procedural volumes or geometry (i.e. via a density function callback specified by the user).
Right now I have an extremely patched version of Povray, but I'd love to switch to something faster.
The nicest renderer I've found, API-wise, was OSPRay, which was simple and elegant to use... but doesn't support volumetric rendering in any way. I have in the past got this working, more or less, with Mitsuba with some custom code but I'd rather like to avoid customisations. They're too much work to maintain.
I personally think Mitsuba is the dark horse of free renderers. Blazing fast, good highly modular design, good docs, super easy Python bindings, GPU preview. The only problem is it's a one-man show, and the one man seems to have been doing other things lately. Nevertheless it's the renderer I think deserves to become the "standard".
OpenCL is one of those things that I never felt fully comfortable working with, but I felt productive in CUDA after a week or two. Granted, I learned them in that order, so it's possible that CUDA got an unfair head-start, but I stand by my initial thesis.
There is an open-source implementation to dig into: https://github.com/Xilinx/triSYCL
It abstracts away most of the difficult stuff.
CUDA simply feels less hacked together to me. It's like working with a well thought out and documented code base (CUDA) vs working with some library that has little documentation and contradicting syntax and formats (OpenCL).
IMO that's why AMD is losing the "deep learning" battle, it's just not easy to develop using OpenCL. At least, not as easy as it should be.
It's a vicious cycle though, since everything uses CUDA/CuDNN everyone buys nVidia cards, which means that developer interest in getting AMD cards fast isn't there.
If AMD GPU cores were in phones etc, they would probably be getting TF support for client work at least. Heck, considering they sold off that dept to Qualcomm, which is getting supported...
Considering how small of a dent that would make in their bottom line (financially), it's really amazing they haven't yet... The potentially upside is easily in the tens (if not hundreds) of millions of dollars.
So definitely, I agree they intentionally have decided to not support deep learning. For the life of me, I don't know why.
The problem is that it isn't just TensorFlow. It is also Caffe, Theano, Torch, etc., etc., etc.. For deep learning, Nvidia GPU acceleration is almost a given.
80% of deep learning users use the TensorFlow, Caffe, or Torch frameworks.
https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP/iss...
I like freebsd a lot, but for this reason had to switch back to debian/ kubuntu.
And the answer is so far not. And likely it won't happen, they are supporting Linux because it is a large enough target for their scientific customers, FreeBSD just does not have the market share there.
For CUDA supported are Windows, Linux, Mac OSX
So all this in the context of CUDA. Sorry for messing that line up.
Even better if there were open-source drivers, but you know, baby steps.
There are open source drivers. Only on nvidia they (nouveau) are seriously worse than the proprietary ones. For Intel GPUs, the open source driver is the only driver. For AMD, there are some proprietary drivers but they are becoming obsolete, the fully open amdgpu stack is getting better and better all the time.
I mean, there are numerical libraries that run 2x as fast on nvidia compared to their most optimized opencl implementations, because they use 'gpu assembly' specific for nvidia cards; how does that fit the 'opencl on par with cuda' claim? It depends on what effort is spent on optimizing for a certain platform, not what api is used...
I'm working in opencl myself but it's frustrating that I'll never get as much performance as I would when using opencl, even when I'm using gtx gpus myself.
Didn't you mean CUDA?
I made this video about worker in tech with blender.
The worker is slaving away at his terminal, he is writing code that creates the 'feed' of apps/entertainment/media/etc.. for the insatiable appetite of society (Represented by the somewhat-similar-to-a-hungry-hippo character in the depths). Who are these other two glowing beings? What do they represent? My friends have tried to guess some explanations, but I'll let each audience member decide for themselves.
Or are their machine models so different that that is an unreasonable thing to even try..
They both have very similar ideas for the core of the APIs then CUDA adds a bunch of stuff on top of it for ease of use and performance which is tightly coupled with the hardware in some cases. It would be a lowest common denominator situation with a lot of those features in CUDA.
I think the actual page that talks about Cycles rendering performance improvements in version 2.79 is this wiki page: https://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.7...
But that page doesn't seem to mention any comparison between OpenCL and CUDA.
I think something is still missing to make a concrete link between "OpenCL on par with CUDA" and version 2.79 specifically.
I can't say for sure what's the latest state of Blender; somebody on Freenode #radeon mentioned a few months ago that Blender is failing to compile its OpenCL kernel, while before that somebody mentioned it as working, but quite a bit slower than with the proprietary driver. I suggest to try it yourself and report any bugs you encounter as blocking [2].
The 3D artists using GPU production rendering require at least 4 of the top of the line cards for their workstation. My workstation crams x5 980Tis in the case (2 off the board with PCIe risers).
Joining the community using this approach not only requires the hardware and ability to build it but also new rendering software and a lot of time to learn a new approach/mindset/workflow. The best software available is crucial. It is worth every penny to invest in the best rendering software when entering this environment. Right now, there are 3 that matter and none of the GPU-specific remdering softwares support OpenCL. There is a unique exception with V-Ray, the last gen maverick of rendering engines. V-Ray's future in GPU rendering could be bright if the new companies don't entirely outpace them in GPu development. Either way, every part of the people actually using this solution in the real world is investing all of their time, money, energy into Nvidia right now.
The devs at Redshift, my chosen renderer, insist OpenCL is not even close to having what they need.
Pseudo-realtime feedback could actually advance the craft to a new era and Nvidia is carrying the entire ecosystem.
Somehow I read your comment as V-Ray is not among them as being last-gen. I remember that years ago there was a lot of buzz regarding Arnold (and it was justified to some extent AFAIR, at least judging by opinions of pleased 3D crowd), but maybe it's last-gen too now? Many years ago there was Brazil, but quick googling shows it's only for Rhino now? I haven't heard about Redshift till now, though.
CPU renderers are a different story but Arnold is right up there with V-Ray. CPU renderers are tried and true, reliable and robust.
V-Ray is the only company making both CPU and GPU renderers. The GPU version can render most of the same shaders but the backward compatibility requirements slow it's progress. It's OpenCL support is always behind CUDA as well.