Search Unity

Other Coil whine and 100% gpu usage when doing stuff in unity

Discussion in 'Editor & General Support' started by bartkor09, Feb 4, 2023.

  1. bartkor09

    bartkor09

    Joined:
    Jan 15, 2022
    Posts:
    6
    Whenever I play or test my unity project, I always get 100% gpu usage and a loud medium pitch coil whine from my gpu, this also happens when pressing the middle mouse button to move around and it is incredibly annoying, I have tried the script
    Code (CSharp):
    1. QualitySettings.vSyncCount = 0;
    2.  
    3. Application.targetFrameRate = 60;
    but it didn't work, I did save the script and run the game but I still had 100% gpu usage and a coil whine, I have tried enhanced sync from the amd adrenaline edition software and tried to forcefully limit my fps in it aswell, but nothing worked, I am using an rx 580 from amd.

    I have also tried to enable/disable the vsync option in Project Settings -> Quality, and nothing happened, I am using unity version 2021.3.18f1.

    Please help, I want to use this game engine but this is simply too big of an issue for me to carry on. (i'm a complete newbie)

    PS: I might not reply quickly, also please let me know if I have done something wrong in this post as this is the first one I am writing on unity forum.
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    @bartkor09 I doubt this is has much to do with Unity but sounds more like something being a bit off in your hardware configuration at the moment. I would suggest first checking which outputs you use on your PSU for the GPU and that it matches the suggestions from the manufacturer. Check that cables are properly connected, clean dust from your system (especially the cooling fins etc.) Then do some benchmarks and test games etc., and see if your system actually is stable under a heavy load. Also check your card's stats with HWiNFO and GPU-Z (or similar tool) to see if everything looks like to be in order - voltage, clocks, adequate cooling etc.
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    A lot of GPUs do that when they work at high capacity and really high framerates.
     
  4. bartkor09

    bartkor09

    Joined:
    Jan 15, 2022
    Posts:
    6
    I would definitely believe that as I saw many solutions on other platforms talking about limiting fps and vsync, can you reccomend any solutions to this?
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    You could also make sure that the scene view is vsync limited as well, the setting is somewhere in preferences (I can't open Unity right now to check).

    But in general it is a hardware "issue" (it is a very big issue for me, but GPU manufacturers don't consider it a flaw).
     
  6. bartkor09

    bartkor09

    Joined:
    Jan 15, 2022
    Posts:
    6
    Yeah everything has vsync, you experience this annoying behaviour every day aswell?
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    One of the PCs with an AMD GPU I have does this, it's not super loud though (closed in its case, which is not very close to me, it's easy to ignore except when I'm baking lightmaps, at which point it gets pretty loud, but still tolerable (and I guess knowing it will only do this for a limited time helps)).

    If it's really loud you could potentially return it and get another one (if you live in a country where returns are easy)? The loudness each GPU does this is kinda random (even within same brand, same model number).
     
  8. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    @bartkor09 I don't have any audible coin while on my current system, but I've had some cards in the past that did have a small whine. But never anything that would distract me. Of course it depends a lot on your case placement and how good your ears are etc.
     
  9. bartkor09

    bartkor09

    Joined:
    Jan 15, 2022
    Posts:
    6
    it is horribly loud for me and distracts me a lot, I need this fixed else I can't use unity
     
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Try playing with this setting, see if it helps at all:
    upload_2023-2-4_21-8-48.png
     
  11. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    252
    you could downclock the GPU

    I done the same thing with my last intel CPU, as when it was doing something with high CPU eg compiling it sounded like an vacuum cleaner due to the fan.
    Sure everything took 20% longer but it was well worth it.
     
  12. bartkor09

    bartkor09

    Joined:
    Jan 15, 2022
    Posts:
    6
    Nope, didn't help, I tried using the framerate limiting script on every script that I have and it somewhat worked, bringing the framerate down to 60 fps and my gpu usage to 40%, yet that is still bad considering that I have about 4 cubes on the scene.
     
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,183
    Unless you're on a laptop replacing the processor's fan with a new one is one of the easiest things you can do, and in fact you should be replacing the thermal paste if you intend to use a processor for more than ~5 years as it has a limited lifespan. Just replacing the thermal paste every so often can drop the temperature several degrees.
     
    LethalGenes likes this.
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Coil whine has nothing to do with fans though. Otherwise, solid fan related advice :)
     
  15. timsibiski

    timsibiski

    Unity Technologies

    Joined:
    Jun 3, 2021
    Posts:
    38
    Do you get the same experience between BOTH 1080p and 1440p? 1080p and lower resolution is heavily CPU-based, and if your GPU is maxing out in that scenario, there may be an issue with your GPU. If you track your CPU usage between gameplay in both resolutions, and see a notable difference for the CPU, but no difference for the GPU, I'd then be very curious if you have all the most updated drivers for your GFX card, along with the most updated BIOS. Sometimes, GFX cards need their BIOS updated, although it is MUCH rarer to need to do that than needing to update the Mobo's BIOS.

    The weird thing is that I have no problems with Unity using a PC that has a GTX 780. Which is incredibly old. You may also be able to tune it with GFX card software to limit how much work it does when a certain application is open.
     
    Last edited: Feb 6, 2023
    Ryiah likes this.
  16. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Older GPUs were less coil whine prone than recent ones.
     
  18. timsibiski

    timsibiski

    Unity Technologies

    Joined:
    Jun 3, 2021
    Posts:
    38
    I wasn't necessarily referring to the whine, but the maxing out and general struggling of the card. Including the fans spinning at max etc.
     
  19. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,183
    Back to the topic of coil whine it's not always the graphics card that is solely at fault. An older or low quality power supply can exacerbate the coil whine making it audible. If you have a spare one laying around you could swap it out and see if it improves the situation.

    Aside from that I do recommend reaching out to the graphics card manufacturer as some of them do cover it in their warranty (EVGA was well known for this among many other things), and for the ones that don't they might treat it as a defect if it's bad enough and nothing else seems to be the source.
     
  20. bartkor09

    bartkor09

    Joined:
    Jan 15, 2022
    Posts:
    6
    Do I disable the framerate cap and then test it in 1080p or do I keep it on, my cpu usage was near to none in 1440p with/without the script.
     
  21. Baydogan

    Baydogan

    Joined:
    Mar 22, 2018
    Posts:
    54
    Turn VSync on Game Window Screenshot at Feb 25 04-43-13.png