Search Unity

Out of memory with good graphics card

Discussion in 'Editor & General Support' started by George S, Oct 29, 2009.

  1. George S

    George S

    Joined:
    Jul 28, 2009
    Posts:
    54
    Unity runs out of memory and dies when I try import a 33MB texture file.

    In the log I see the following:
    Code (csharp):
    1. Audio devices: Generic Hardware (default: Generic Hardware)
    2. Initialize mono
    3. Direct3D:
    4.     Version:  Direct3D 9.0c [nv4_disp.dll 6.14.11.8242]
    5.     Renderer: NVIDIA GeForce GTX 285
    6.     Vendor:   NVIDIA
    7.     VRAM:     -2048 MB
    8. D3D: VRAM amount suspiciously low (less than 32MB for PS2.0 card)
    9. LicenseInfo:InitializeProtection
    10.   open PACE from our own executable
    11.   opened PACE, get info...
    12.   checked authorization, authstate=100 r=0
    13.   ReadDeveloperData
    14.   ReadTokens
    15. E:/UnityProjects/TroubleInc
    16.  Rebuilding GUID cache: Deleting metadata Assets/Standard Assets/Scripts/Player/MuzzleFlash because the asset doesn't exist anymore.
    17. MetaData path library/metadata/f7/f789087527a6ded40a13b508ba089f08
    18. (Filename: ..\..\Editor\Src\AssetPipeline\AssetInterface.cpp Line: 551)
    19.  
    20. Automatic import for 'Assets/Standard Assets/Particles/ELECTRIC FENCE/Textures/Fence_Electricity_Particle_Animation_4096.psd' was disabled because the asset importer crashed on it last time.
    21. You can Reimport the asset or rename it in the file manager to force reimporting it.
    22. (Filename: ..\..\Editor\Src\AssetPipeline\AssetDatabase.cpp Line: 355)
    23.  
    The comment "VRAM amount suspiciously low - less than 32MB" is odd considering my card has 2048 MB of memory. Although it is listed at -2048 MB in the card description, negative instead of positive.

    It this a bug in Unity, having too much memory?

    What can I do to get around this?

    Thanks
     
  2. Narlix

    Narlix

    Joined:
    Jul 3, 2009
    Posts:
    111
    is it 65536x65536 or something in size?
    have you tried making the psd to a jpeg?

    When talkin' texture, well size doesn't count. well, 128, is just poor if your using it to other stuff that particles though a max 2048 in jpeg, should not mess with your memory, ( bad idea to make them larger than that, No point! )
     
  3. erica.sampson

    erica.sampson

    Joined:
    Jul 9, 2009
    Posts:
    158
    Hello :) I can answer that one.

    The texture size of this one is 4096x4096 and it's being used as an animated tile texture. The script for which was acquired either on the unity site or the wiki. Can't tell you which because the guy who designed the object that uses it isn't here at the moment.

    The strange part about this whole problem is that my computer imports it no problem. The difference for George is that he's acquiring the texture via the Unity Asset Server.

    Could it be an issue with the Asset server?
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    a 4096 shouldn't cause that, thats a small nothing of about 80mb uncompressed.
    at fantastic quality though you will add another 40-60mb for backbuffer, frontbuffer, CSAA

    None the less its nowhere in the range of getting low.
    question is if you have a 64bit OS on 6GB ram because then you get another 2GB texture memory from RAM and end with a negative number of RAM right from the start. The correct value then is 2048 - return value (thats negative).
    Thats also what your startup value actually indicates.
    The problem actually comes from the fact that it is signed int measured, not unsigned, thus +-2B are the max and thats +-2GB.

    I've that with my GTX280 on Vista64/Win7 as well that I in many techs have -1GB VRAM (thats 1GB onboard + 2GB system ram texture memory)
     
  5. George S

    George S

    Joined:
    Jul 28, 2009
    Posts:
    54
    I am running Windows XP with 4GB of memory. My system memory monitor shows about 60% when the import fails due to lack of memory.

    The lines:
    Code (csharp):
    1.     VRAM:     -2048 MB
    2. D3D: VRAM amount suspiciously low (less than 32MB for PS2.0 card)
    indicate a bug to me. My VRAM is not suspiciously low, I have 2GB of VRAM. I agree its it likely a signed 32 bit long problem. It could fixed using an unsigned long which can address close to 4GB of memory, like 32bit XP can.

    Is there a work around to this problem?
    Can I somehow tell Unity my card has 1GB of memory rather than the 2GB Unity cannot handle?
    Can I somehow tell XP my graphics card has 1GB instead of 2GB?
     
  6. George S

    George S

    Joined:
    Jul 28, 2009
    Posts:
    54
    So I guess you should all know that you should avoid great video cards with over a Gig of memory since Unity cannot handle it.

    I can see the funny part, I upgraded my computer specifically to get a better video card to do Unity development. At least my frame rate did go from an unusable 1 (at times) to 160.
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    This has nothing to do with unity, thats DirectX that reports that.

    And on a XP 32bit you shouldn't waste money on a card with more than 512mb ram anyway as it will cut your available RAM to less than 3GB due to the memory adressed you lose on the graphic memory.
     
  8. George S

    George S

    Joined:
    Jul 28, 2009
    Posts:
    54
    So, would moving to Windows 7 64 solve my problem?

    Having to do a complete re-install sucks of course.
     
  9. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    261
    Sorry to dig up this old thread, but users of our software who have Windows 7 64bit and 2GB graphics cards reported the same problem.
    Unfortunately we have to use Unity 2.6 at this point. Is there anything we or the user can do to get around this issue?
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Unity 2.6 won't be upgraded any more, so probably not.

    --Eric
     
  11. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    261
    Is it really a Unity 2.6 problem, or something that can be handled by a DirectX update? Is it actually fixed in Unity 3?
     
  12. robert

    robert

    Moderator

    Joined:
    Dec 21, 2008
    Posts:
    265
    VRAM detection was fixed in 3.0, so this crash shouldn't happen any more.

    We don't plan on releasing any further updates to 2.x, sorry.
     
  13. Orion

    Orion

    Joined:
    Mar 31, 2008
    Posts:
    261
    Thanks!
    Yes, I figured as much. But at least that's an incentive to go through the hassle of converting the project to 3.0.
     
  14. nafonso

    nafonso

    Joined:
    Aug 10, 2006
    Posts:
    377
    We're having this issue too, which will make the game look like it is in "predator mode".

    Basically we have 2 computers with the following specs (grabbed straight from Unity's API):
    Comp A:
    - OS Window 7 (6.1.7600) 64bit
    - CPU Intel i7 Q840 (4 cores)
    - RAM: 8Gb
    - GPU ATI Mobility Radeon HD 5600/5700 Series D3D 9.0c [aticfx32.dll 8.17.10.1059]
    - VRAM 32 Mb
    - Shader Level 30
    - Pixel Fillrate 4400
    - Shadow / Render Texture / Image Effects / Vertex Programs = True

    Comp B:
    - OS Window 7 (6.1.7600) 64bit
    - CPU Intel i3 540 (4 cores)
    - RAM: 4Gb
    - GPU ATI Radeon HD 4670 Series D3D 9.0c [atiu9pag.dll 8.14.1.6105]
    - VRAM 32 Mb
    - Shader Level 30
    - Pixel Fillrate 4400
    - Shadow / Render Texture / Image Effects / Vertex Programs = True


    As you can see, from both Comp A B, they return wacked VRAM. Unity says they only have 32Mb when running through the web player, and then have more!

    If I do a standalone build, it reports that they have 4Gb of VRAM, which still isn't the correct value! Still, with this incorrect value the game loads fine, so it is an issue for web player only.

    So why is this a problem? Well when it reports 32Mbs, the camera starts rendering crap. Textures start getting downsized (like it can't load big textures and scales them really down), and the color is all screwed up (usually it renders in shades of red).

    Things we know:
    - It is not bootcamp, computer A doesn't have bootcamp but computer B has;
    - It is not hardware related only, we have 3 Comps B (all with bootcamp)! Only happens on one of them;
    - It is not ATI related, we have another computer with a ndivia Quadro card that also has the problem (I don't have its specs atm).
    - It is not Windows build related (afaik), we also updated to SP 1 (version 6.1.7601 iirc) and the problem maintains on the same computers.

    We're running unity 3.2, we haven't tried 3.3, but there's nothing mentioned on the 3.3 change log.

    So, what now? We're completely standing still on this, since it is inside unity there's nothing we can do. Help?

    Regards,
    Afonso
     
  15. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Well 4GB is not needfully incorrect. Cause DX will report back physical VRAM + PCIe Texture Memory which with 8GB RAM installed on a 64bit OS is 2GB.
    Though with the chips you mention its pretty unlikely that you have 2GB physicsl VRAM to compensate for it.

    But and thats a big but: I am on a 1GB VRAM NVIDIA 280, Win7 64Bit SP1, Unity 3.3 and I don't see any such problems with the latest WHQL NVIDIA Drivers (266.58) and the most current DX9.0c installation, it correctly reports 1024MB VRAM for standalone builds and my System with its 18GB RAM would have plenty of RAM to push it up if it wanted to.
     
  16. nafonso

    nafonso

    Joined:
    Aug 10, 2006
    Posts:
    377
    With the computers that it doesn't have any issues, iirc, it reports 256 VRAM (which is how much memory those cards have).

    For some reason, these computers have issues reporting it. My problem atm (although it looks ugly) is not that it reports a bad value, is that it screws the game. It turns everything "red", and scales down textures (which really affect the HUD stuff, in some cases we even got the game mouse cursor rendered as 4 pixels :p), which basically breaks the game.

    Any UT guys want to chip in?

    Regards,
    Afonso
     
  17. nafonso

    nafonso

    Joined:
    Aug 10, 2006
    Posts:
    377
    I can hear crickets! XD

    Anyway, seems that I was mislead by the RAM stuff. The predator low resolution texture seem to be associated with screen post effects (which iirc came with Unity, I need to check with the artists). Basically the Color Correction (turn render into predator view) and Vignette (somehow screws the texture resolutions) effects are the ones that screw up the render.

    Only happens - like the RAM issue - when running on the browser, so I still think that there is a Unity bug in there.

    Regards,
    Afonso
     
  18. 0mr_ashutosh0

    0mr_ashutosh0

    Joined:
    Jul 9, 2014
    Posts:
    5
    Hi there not sure if you have solved the problem BUT

    I changed my default graphics from internal (default onboard chip with motherboard ) to Nvidea which i have.
    and then restart Unity3d
    u might get FMOD errors or something but have patience.

    The problem is that unity does not identify which graphics card to use it just detects the default one and runs on it
    Just go to control panel of whatever graphics card you have and assign unity to it.

    Happy developing. :)
     
    BrandyStarbrite likes this.