[Guide] How to control fans on Dell Laptops under Windows

Discussion in 'Dell' started by valuxin, May 27, 2017.

?

Does this solution work for you?

  1. Yep :)

    15 vote(s)
    50.0%
  2. Nope T_T

    6 vote(s)
    20.0%
  3. Scared to try :c

    9 vote(s)
    30.0%
  1. Aaron44126

    Aaron44126 Notebook Virtuoso

    Reputations:
    706
    Messages:
    3,709
    Likes Received:
    1,006
    Trophy Points:
    231
    ioperm is used to open up I/O port access to user-mode processes (basically allowing them to send arbitrary commands to PCI devices) and is key to the whole solution. It is mainly used in Linux to get the graphics stack working in user mode, from what I can tell. There isn't an equivalent in Windows, you're "supposed" to use a device driver for this sort of thing, which is how the Dell fan utility works. (Naturally, drivers must be signed which is the cause of this whole signing/test mode problem.)

    There are alternatives like giveio.sys (packaged with some older hardware monitoring tools) or the Cygwin ioperm.sys driver... These seem to be from the 32-bit era and stopped working when Microsoft transitioned to 64-bit and started requiring kernel-mode code to be signed.

    I poked around for a while and found this:
    https://www.codeproject.com/Tips/985807//Tips/985807/Enable-I-O-Access-From-User-Mode
    This guy has source code for a driver that basically does ioperm's job (allowing user-mode access to send commands to a device). He also has included a signed 64-bit binary file giveio.sys.
    I did some testing and I was able to load and start the driver *without* mucking with test signing or "disable driver signature enforcement" mode. So, it appears to be a good starting point, at least Windows accepts the signature. (Granted, I haven't actually tried to get it to do anything yet.) It appears to use a trick to get around Windows PatchGuard which could be, well, patched in the future to keep it from working.

    Between this driver, the source code for the Linux dellfan utility listed above, and the source code for the Dell fan control utility, I'm going to see if I can stitch something together to get around this whole driver signing thing. We'll see...
     
    Maleko48 and maffle like this.
  2. Aaron44126

    Aaron44126 Notebook Virtuoso

    Reputations:
    706
    Messages:
    3,709
    Likes Received:
    1,006
    Trophy Points:
    231
    I can confirm that using "Disable driver signature enforcement" startup option (detailed two posts up) allows the Dell fan utility to work. You don't have to disable secure boot or enable test signing.

    I poked around some more and decided that the easiest path forward is to just get proper signatures for the Dell SMM controller .sys files. It looks like the cost for this is just around $75. I'll look into it tomorrow. (I have another custom driver that I need signed anyway.)
     
    Maleko48 and maffle like this.
  3. maffle

    maffle Notebook Evangelist

    Reputations:
    95
    Messages:
    407
    Likes Received:
    334
    Trophy Points:
    76
    @MikeR_Va ... Of course I am in test mode (annoying imprint on desktop in the right bottom corner). OF COURSE, I run it as admin.... It does NOT WORK on the 9570. The tool sees the fan speeds, but sliding the slider for FAN1/FAN2 does nothing they spin back always into the middle position. The driver is loaded though because afterwards, the fans wont go off anymore automatically by EC, I can send a 0RPM or whatever value via HwInfo to BOTH fans after EC button disable. BUT... the EC still interferences with it and resets it all the time, for example for dGPU polls.
     
  4. MikeR_Va

    MikeR_Va Notebook Enthusiast

    Reputations:
    0
    Messages:
    21
    Likes Received:
    4
    Trophy Points:
    6
    @maffle . . . that's interesting, actually. I don't know that I know enough to help you here, and again, I'm not trying to tell you you did it wrong. Just comparing notes to see if we can find the issue.

    Based on your most recent, I could add one item: When working with the Dell Fan App, I noticed that whenever I had missed a step or forgotten something (which I did on a number of occasions), the sliders would refuse to stay where I put them. If I slid the CPU slider to the right, it would just bounce back and the fans wouldn't run. When I went back and took another shot, finding some step I'd missed, I could move the slider normally, and the fans would spin up. So, if that's the behavior you're describing, something (though based on your description, I'm not sure what) is going wrong at step one -- you're not actually getting fan control. Maybe that's at least useful for diagnostics.

    If you get the sliders to work, that step is done, and there may be an HWInfo issue. Haven't used that tool for fan control, so can't help there. But can confirm that if you get that far, Speedfan will work as far forward as XX60 series XPSs.

    If none of that helps, I'm likely at a loss, though I'm happy to keep trying if you like. I feel your frustration. But sometimes I find that some trivial thing I missed is the key -- thus my seemingly overly detailed descriptions. Best of luck with the effort -- here's hoping you can make it work (and that Dell hasn't locked something new . . . ).

    @Aaron44126 . . . that's good to know. I will absolutely try that method and report my results. The problem, of course, is that this just saves a bit of typing. What we want is something that survives a cold boot. So far I can't come up with anything that will do that -- though, again, there's a Dell Command | Configure utility that may do it.

    I was contemplating trying that, but I'm finding that when I try to apply the override in the command line tool using the specified in the command,

    cctk --FanCtrlOvrd=Enabled

    I get confirmation from the software, but don't get fan control -- even in test mode. I thinks that's true even after a warm reboot -- might have to check that again. So I'm a bit lost about what the Fan Ctrl Gui is doing that the command line switch is not. But the tool is made to allow Sys Admins to configure fleets fo laptops, so maybe if I applied the setting in the Command | Control Wizard and applied it, that would work. I'm still hesitant to do that, but I'm still looking for more information that might make me less hesitant.

    Best,
    Mike
     
    Last edited: Jan 17, 2019
  5. Aaron44126

    Aaron44126 Notebook Virtuoso

    Reputations:
    706
    Messages:
    3,709
    Likes Received:
    1,006
    Trophy Points:
    231
    Here's what I've got for that.

    1. I'm going to get a certificate and sign the Dell SMM driver files. This will allow the driver to be loaded without having to muck with *anything* (secure boot, test signing on/off, or "disable driver signature enforcement" boot mode). I purchased the certificate this morning but I'm told it might take three days for it to be approved and issued. I already have experience using Microsoft's signtool to sign executables and driver files, I don't expect that there will be any trouble with this once I actually get the cert.

    (It might be possible to bypass this by using the signed 64-bit giveio.sys file that I mentioned before and finding a way to use that in place of the unsigned Dell SMM driver. However, the time it is going to take me to figure out how to do that isn't worth the cost of just buying a certificate.)

    2. I'm working on a command-line app, derived from the Dell fan utility code, that will just disable EC control and set the fans to run at max speed. (Someone else already did this, but the link is dead.) You could use Task Scheduler to have this run at boot time or upon login. (Automatically setting the fans to max speed is for safety and will remind you to start a proper fan control app like SpeedFan.) I'm working on this today and expect to have some output this afternoon.

    3. This one will be a little bit further out but I'd like to create a system service to use instead of a command line app. The service will disable the EC fan control at startup and set the fans to max speed, like the command line app. However, I would also like it to periodically probe and make sure that the EC fan control is still disabled, and re-disable it if necessary. (After hibernate/sleep?) Also, it could *enable* EC fan control at shutdown to put things back into the regular state. This one depends on if I can figure out how to check the EC fan control status and figure out how to re-enable it.


    I went ahead and set up custom fan profiles in speed fan. I love finally having control over this. I have the CPU fan running at 50% all of the time unless the temperature passes 80 C, and the GPU fan running at 0% up to 65, 50% up to 85, and 100% after that. Seems perfect from my testing, under regular light work conditions the CPU fan sits at 50% and the GPU fan sits at 0%. My main complaint about the default Dell configuration is that the CPU fan keeps toggling between 0% and 50% when the CPU temperature hits around 60 C (constant 50% is much preferred over on/off/on/off/on/off)... And the GPU fan follows along with it even though the GPU has no load.
     
    Last edited: Jan 17, 2019
  6. MikeR_Va

    MikeR_Va Notebook Enthusiast

    Reputations:
    0
    Messages:
    21
    Likes Received:
    4
    Trophy Points:
    6
    Aaron:

    That sounds outstanding. Just being able to run the Gui based utility without the driver issue would be a big step forward. And if you get to the command line solution, that would pretty much solve the problem -- though the service would admittedly be better still. I can confirm that the previous author's solution is no longer out there -- it was there when I first looked, but Google decided it was a virus and wouldn't allow a download. Then the link just died. So this would be a big help.

    I've spent a good bit of time modding my little 9360, and by way of repasting, heat padding, and undervolting I have about 20 C of thermal headroom that didn't exist before. The i7 8550 now idles between 25-30 C in a 64F ambient environment, and I run 50% fan at about 52 C and 100% at about 64 C. This probably seems aggressive, but I really only hear the fan when there's a huge raft of updates all running en masse or when I'm deliberately testing limits. I think Dell's limits are too high, probably because of noise complaints, so I share your enthusiasm for having control.

    One caution. If you're playing with this stuff, and if you're running Throttlestop and Speedfan, be careful about using TStops test module. I noticed in the midst of doing that that during the test, Speedfan couldn't run the fans up -- conflict of some sort. It was a repeatable error. Even passively cooled, the new configuration did OK until i (fairly promptly!) shut down the test, following which I tested with Prime 95 without difficulty. Could be unique to my machine, but if you're working on your machine as I did, just be careful of that.

    i have some similar plans for the house 9560 -- that will involve padding the mosfets in the power chain rather than the CPU (Google for the reasons why), using Throttlestop to engage speedshift (Dell apparently never did), and repasting. The i7 in the XPS 15 has a 45w TDP, so it's not going to run as cool as the 8550 (15w), but there are apparently good gains to be made.

    There really are only two things remaining for project 9360-- the one we're talking about here, and proper S3 sleep. Dell had a BIOS option for force the latter, but recently removed it. I mean to look at the BIOS changes to see if I can safely roll back to the last BIOS iteration that had the options (i.e., is it after the Spectre/Meltdown fix?), and hope that Dell might be persuaded to put it back, because I really don't care for modern sleep.

    If you're still having issues with the fans "breathing" as you describe, try longer hyteresis settings in Speedfan's advanced fan control set-up. That tells the fan to run longer (demanding a lower temp before it dials back) and seems to bridge those short gaps.

    I thank you very much for your help, and I look forward to testing your work.

    Mike
     
  7. Aaron44126

    Aaron44126 Notebook Virtuoso

    Reputations:
    706
    Messages:
    3,709
    Likes Received:
    1,006
    Trophy Points:
    231
    Yes, it took a bit of playing but I figured out a good setup in SpeedFan. I'm quite pleased with the setup. The "breathing" thing was actually what was happening with the stock Dell configuration (EC controlling the fans) and is eliminated now that I am using SpeedFan to control things. I figured out hysteresis. The main hang-up for me was figuring out the multiple different boxes you have to check in order for it to start taking control of the fans and also figuring out that the "alarm" temperature will override the "advanced fan settings" and force the fans to 100% if it is tripped.

    My CPU is Intel 3rd gen (Ivy Bridge) which doesn't support undervolting with Throttlestop (as far as I can tell) so I don't have that running for anything, but thanks for the heads up on that... But the Precision has a lot more thermal headroom than the XPS by virtue of just being larger so I'm not really having any sort of temperature problems. This whole effort is just to get the fans to do what I want (i.e. shut up), I don't like the default behavior. :p

    Regarding the BIOS and Spectre/Meltdown "safety", you should know that a BIOS update isn't required to actually correct this anymore, Microsoft has issued patches to apply the microcode fix from Intel at Windows boot time. (https://arstechnica.com/gadgets/201...t-shipping-the-intel-spectre-microcode-fixes/) I'm pretty sure that they are all bundled in Windows 10 1809 and you'd have to go out of your way to disable the security fixes (there are registry toggles for them). There still might be other security concerns, I think that Dell regularly pushes updates for security issues in the Intel Management Engine.

    I have been able to compile and tweak the Dell fan utility GUI app and I'm sitting here waiting for Qt to build so that it can be distributed standalone...
     
    Last edited: Jan 17, 2019
  8. MikeR_Va

    MikeR_Va Notebook Enthusiast

    Reputations:
    0
    Messages:
    21
    Likes Received:
    4
    Trophy Points:
    6
     
  9. MikeR_Va

    MikeR_Va Notebook Enthusiast

    Reputations:
    0
    Messages:
    21
    Likes Received:
    4
    Trophy Points:
    6
    Aaron:

    That all sounds good. Hadn't noticed you were running a Precision. And yes, even the XPS 15 has a lot more cooling headroom than the 9360. But you can pad a 15w cpu direct to the chassis and get some pretty good benefit. I'm really liking the little guy, and it'll be just about perfect for me if I can beat these last two glitches.

    Appreciate the heads up on the Spectre fix. I had read MS was going to do that based on work by some folks at Google, but didn't know it was in the wild yet. Will check that out.

    Thanks very much for your work on the utility. If you can pull this off, I think you're going to have a lot of happy people here.

    Mike
     
    Last edited: Jan 17, 2019
  10. maffle

    maffle Notebook Evangelist

    Reputations:
    95
    Messages:
    407
    Likes Received:
    334
    Trophy Points:
    76
    No. Constant 0% is much more preferred. There is no reason to spin on the fans if CPU or GPU are under 65-70°C. That can easily be cooled passively. And Dell is just retarded because the EC also uses PCH and SSD temps for spinning on the fans, even the fans have no air flow to these parts.

    @MikeR_Va the stupid tool has no output showing you, if it loaded the driver correctly, or not. is there some way to see, if the driver really is running? but it has to, because like I said, the EC auto turn of doesnt work anymore afterward. it just seems the 9570 EC is not compatible with this driver.
     
    Last edited: Jan 17, 2019
Loading...

Share This Page