How to avoid "native cpu code generated in xs" in Iray renders
![taiuri](https://secure.gravatar.com/avatar/15b395af8f2df94f3ed9d8f08e5bc73a?&r=pg&s=100&d=https%3A%2F%2Fvanillicon.com%2F15b395af8f2df94f3ed9d8f08e5bc73a_100.png)
in The Commons
I have an issue when I render in Nvida Iray. When the "native cpu code generated in Xs" text appears, the render delays for hours and it does just the 2%.
I have a similar problem of this guy in this forum:
https://f95zone.to/threads/solved-daz-rendering-4-iterations-over-and-over-again.95953/
He says he solved it modifying the post-denoiser settings, but he wasn't clear. Could someone explain me how did he solve this issue, please?
Comments
System specs, which GPU, amount of RAM?
Do you have CPU Fallback enabled, or even the CPU enabled as a render device? If iray uses the CPU (by default, or because the GPU has dropped out and it is falling back) then code will have to be generated.
I have the Allow CPU Fallback enabled, but the CPU as device unchecked. Should I uncheck the Allow CPU Fallback option too for avoiding the native cpu code is generated and it goes directly to the iterations?
If you uncheck the "Allow CPU fallback" and you are running out of VRAM, you just get a black render.
How much VRAM do you have on the GPU?
8 GB of VRAM and 16 GB of RAM.
With 8GB's of VRAM, there are limits to what you can have in the scene.
Do you have an RTX GPU?
It's likely that you're running out of VRAM for your scene. If you go over, Daz will fall back to doing 100% CPU rendering (if you have allow fallback to CPU enabled). Sometimes, Daz doesn't clear out the VRAM cache either when switching between scenes. I run into this from time to time, particularly when I load up 2 or 3 different HDRIs, check the lighting with iray preview, etc. I'll have to save my scene, close Daz, then reload the scene and start the render.
The denoiser requires more VRAM to use. So by disabling the denoiser you save some memory. The amount you save depends on how large the renders are, logically the bigger the render is the more VRAM the denoiser requires.
So what happened with that fellow was that his scene was right on the brink of his VRAM capacity, and the denoiser pushed it it over.
In your case, that may not be enough VRAM regardless of the denoiser, as your scene is likely already past the VRAM capacity.
Is this a new problem? Did the GPU work previously? More details is always better if you want people to be able to help you. There are a lot of things that can be causing your issue, but running out of VRAM because the scene is too large for it is a high probability.
You can test this easy by just rendering a base Genesis all by itself, no back ground. You said you have 8GB VRAM, so that should fit no problem. If it renders without an issue then the scene you have built is probably too large for your GPU. Rendering with Iray requires a lot of memory and hardware. It is just a cold truth. But you can learn how to deal with this and how to optimize a scene to fit into memory. There are various tutorials for this out there (paid and free), and some items in the store designed to help with saving memory. You can learn the tricks and rework your scene to fit. 8GB is not fantastic for Iray, but it is indeed doable. After all, even right now 8GB is considered standard for high end GPUs like the 2080 and 3070. So 8GB is very common for Daz users.
The full characteristics are: Core i7, RTX 2060 super, 8 GB of VRAM, 16 GB of RAM, and 8 cores.
That's exactly what I have to do, and it's very frustrating to have to close Daz in every render.
When I have one character or 2 in scene and I don't have troubles for rendering. The problem is I need more of 4 Genesis 8 characters in scene. I've tried deleting unnecessaries objects in the scene, or using the Optimizer Scene product, but I have the same results. The real problem for me is the quantity of characters in the scene, that's what causes my renders are too slow.
The solution is to get a GPU with more VRAM. The 12GB 3060 is the budget friendly option, which almost doubles the amount of VRAM available for geometry and textures.
A typical G8 figure will require around 800MB's to 1.5GB's of VRAM per figure, and you only have about 4GB's available for geometry and textures in the scene.
I want you to take a look at this.
https://www.daz3d.com/resource-saver-shaders-collection-for-iray
Mattymanx has a 980ti, that is a card with 6GB of VRAM, and with less VRAM than you he manages to throw 15 Genesis 3 characters into a scene. He proves it can be done, the promo pics show the results. This product helps, but the reason I want you to look at it is because of the promos. A lot of the promo pics for this product have valuable tips in them. If you put these tips to use correctly I can pretty much guarantee you will fix your problem. 4 characters should be doable without even going to wild extremes with 8GB. So there is something you are doing to push VRAM high in your scene.
Another thing to look at are the Advanced Iray Settings for compression. You can turn the numbers down so that Iray compresses the textures more. Since you have 16GB of RAM, and that is only twice your VRAM, I get the feeling you are not doing enough with compression here. You can find a lot of people who use 3 times, 4 or even FIVE times the RAM for a given scene over there VRAM. But here you only have twice that VRAM. If the scene didn't fit in RAM, it wouldn't render at all, I believe it crashes Daz. Unless it is being saved by virtual memory in the page file, I don't think Iray can use virtual memory.
Alternatively you can buy a GPU that has more VRAM, but you still only have 16GB of RAM, and that will likely become a problem at some point. In order to populate that extra VRAM, you need more RAM. At least RAM is easier to get than a GPU.
I'm going to try to get this product, it's probably it can help me. Thank you so much for the information!
Thank you for the advice.