Dedicated GPU Runs Hot for Absolutely No Reason

Hello everyone, I'll start with my laptop's specs:
Lenovo B50-70
CPU: Intel Core i3-4030U CPU @ 1.90Ghz, 2 cores, 4 logical processors
Graphics:
  • Integrated: Intel HD Graphics 4400
  • Dedicated: AMD Radeon R5 M230 2GB
(Dual booting Windows 10 and FreeBSD 13.2)

When I turn on the laptop, the dedicated AMD video card starts up, and stays active even though I'm not using it. For example, if I open the BIOS and let the laptop run for a minute or so, the computer heats up and the GPU fan starts spinning to cool things down. But as soon as I boot into Windows 10, some magic happens and the GPU turns off, making the computer run very silent and decently cool. Windows is doing something during booting, but I don't know what.

When I boot into FreeBSD, however, the GPU is not put to sleep, and runs hot and noisy even in minimalist situations, like having the Shell open to create partitions during the FreeBSD installation. With KDE installed, on idle, the laptop uses about 0.3% CPU, so it's probable that FreeBSD can't control the dedicated GPU to calm it down.

I checked the BIOS, but it's a very bare-bones BIOS; it gives me an option to choose between "Switchable graphics" and "UMA graphics" and that's about it. I gave it a try by switching to UMA, but nothing changed.

Has anybody experienced this, and found a way to recreate the Windows magic during booting? Fiddling with powerd obviously did nothing. Running
pciconf -lv | grep -B3 display
...shows only the Intel card.

Any tips I could try? Thanks!
 
When I boot into FreeBSD, however, the GPU is not put to sleep, and runs hot and noisy even in minimalist situations, like having the Shell open to create partitions during the FreeBSD installation.

If the Radeon is on, it will be on at some level whatever you're doing.

With KDE installed, on idle, the laptop uses about 0.3% CPU, so it's probable that FreeBSD can't control the dedicated GPU to calm it down.

0.3% is very little CPU with KDE running, but using the Radeon graphics won't use CPU per se.

I checked the BIOS, but it's a very bare-bones BIOS; it gives me an option to choose between "Switchable graphics" and "UMA graphics" and that's about it. I gave it a try by switching to UMA, but nothing changed.

UMA is just the Intel integrated graphics; switchable means you can choose - I don't know how, but in order to apply a low- or off-power mode to the Radeon from FreeBSD, I expect it will have to be set available in BIOS, unless it can be switched right off there.

Running
pciconf -lv | grep -B3 display
...shows only the Intel card.

With both devices enabled in BIOS, check 'pciconf -lv' more thoroughly ... perhaps it's listed as 'none@' (no driver attached) or as 'graphics' rather than 'display'? Otherwise ... weird.

(Hopefully someone who knows more or better will jump in now).
 
sysctl hw.pci.do_power_nodriver=3 should disable anything that doesn't have a driver attached. i.e. if you blacklist the amd kernel modules the GPU should be turned off. However, this depends on proper ACPI implementation on the BIOS side. Often there is only some proprietary interface that only works with specific windows-drivers...
 
Thanks everyone!

With both devices enabled in BIOS, check 'pciconf -lv' more thoroughly ... perhaps it's listed as 'none@' (no driver attached) or as 'graphics' rather than 'display'?
This is what I could find:

Code:
$ pciconf -lv | grep 'none'
none0@pci0:0:22:0:      class=0x078000 rev=0x04 hdr=0x00 vendor=0x8086 device=0x9c3a subvendor=0x17aa subdevice=0x3978

$ pciconf -lv | grep -A 4 none
none0@pci0:0:22:0:      class=0x078000 rev=0x04 hdr=0x00 vendor=0x8086 device=0x9c3a subvendor=0x17aa subdevice=0x3978
    vendor     = 'Intel Corporation'
    device     = '8 Series HECI'
    class      = simple comms
hdac1@pci0:0:27:0:      class=0x040300 rev=0x04 hdr=0x00 vendor=0x8086 device=0x9c20 subvendor=0x17aa subdevice=0x3978

Today, while I was looking for solutions online, I noticed that the laptop fans were pretty silent. It's possible that switching to UMA graphics in BIOS successfully disabled the GPU; I probably didn't notice last time because the laptop was still cooling down from recent usage.

Although the system no longer overheats from reading blog posts, it's struggling to play YouTube videos for some reason. It takes about 30-40% CPU to play a YT video in Chromium, while Windows 10 takes about 6% CPU and barely any iGPU usage. Does anybody know why this happens? Maybe I'm missing some essential video-related package. The same thing happens in Firefox, making the computer very hot. There's also a weird glitch that causes horizontal stripes to appear in the bottom half of the video player whenever I hover the cursor over it.

Here's the graphics packages I installed so far:
drm-kmod (i915kms is enabled) libva-intel-driver mesa-libs mesa-dri

I also tried:
  • Turning KDE's compositor off
  • Installing the enhanced-h264ify extension for browsers
  • Installing xf86-video-intel
Suggestions are much appreciated!
 
KDE is an absolute power (and resource) hog; I'd use something more lightweight like e.g. xfce on such old hardware if a DE is required and power draw is important. This might even solve the bad performance / high GPU/CPU usage for video playback.

If that dGPU isn't used at all I'd leave it completely disabled at the BIOS or (if this is one of those modular GPUs) I'd just rip it out entirely...

Regarding general power efficiency: Make sure to set performance_cx_lowest="Cmax" and economy_cx_lowest="Cmax" in /etc/rc.conf, although I'm not sure what C-states that old CPU actually supports; but it should at least go down to C2 on low load and save some watts that way.
Test that in combination with or without powerd (or powerdxx) - on most systems I didn't see any change in power consumption when running powerd(xx) additionally to enabling C-states, but sometimes I noticed a considerable performance penalty for dynamic loads (browsers are especially horrible in this regard...)
 
Today, while I was looking for solutions online, I noticed that the laptop fans were pretty silent. It's possible that switching to UMA graphics in BIOS successfully disabled the GPU; I probably didn't notice last time because the laptop was still cooling down from recent usage.

Given this is a 2014 laptop, could be fan(s?) and heatsinks are clogged with dust, and/or thermal paste needs replacing?

If so, you should be able to use the Radeon GPU and driver to get decent video performance without overheating?
 
Edit: saw you are running KDE.

Yeah, I've got some laptops from 2012 which absolutely boil and completely heat saturate the chassis that run FreeBSD, both AMD and NVIDIA graphics cards do it. The same machines running Windows and Mac OS (via OpenCore) don't have the same issue. Linux still runs hotter than the proprietary operating systems, but FreeBSD will run it hot enough to scald skin. It's highly curious, and I never found a cause, but using Chromium for YouTube or video streaming was better than Firefox in my experience.
 
I think I found the culprit for high CPU usage during YouTube playback (Chromium): there's no hardware acceleration, in spite of enabling the recommended flags and settings for Linux and other non-Windows systems.

After starting a video, chrome://media-internals reports:
"Cannot select DecryptingVideoDecoder for video decoding"
"Cannot select VaapiVideoDecoder for video decoding"
"Cannot select VpxVideoDecoder for video decoding"
"Cannot select Dav1dVideoDecoder for video decoding"

I already have the following packages installed (in addition to the ones I previously mentioned):
libva-intel-driver
libva-intel-media-driver
libvdpau-va-gl
libva-vdpau-driver
libva-intel-hybrid-driver
libva
mesa-gallium-va
mesa-gallium-vdpau
libva-utils
xf86-video-intel


And here is the vainfo output:
Code:
$ vainfo
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva error: /usr/local/lib/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.18 (libva 2.18.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD

Looks like VAAPI support is there, but for some reason web browsers can't make use of it. Does anybody know how I can get hardware acceleration to work?
 
  • Like
Reactions: mro
RedFellow Sorry, I don't know the answer to that. I know that for me, Chrome runs better using Linuxulator than it does natively, particularly when watching videos. Perhaps the Linux version is using hardware acceleration?

I'm curious of something you could try, it might be a bit left-field though.

If you install xmoto via pkg, and then open it using a terminal i.e. sudo pkg install -y xmoto && xmoto do you get "Segmentation fault (core dumped) or does the game load ok?
 
Given this is a 2014 laptop, could be fan(s?) and heatsinks are clogged with dust, and/or thermal paste needs replacing?
This !
If your laptop hasn't been cleaned and repasted since 9 years, it can be the root cause of your problem.
I did that with an old laptop from 2011 and temp went down from >60°C to 40°C.

TBO last thing I would do with an old laptop is to install a full desktop like KDE, GNOME, CINNAMON, from my point of view these are for new hardware, for old hardware pick one of those XFCE, MATE or LXQT.
 
TBO last thing I would do with an old laptop is to install a full desktop like KDE, GNOME, CINNAMON, from my point of view these are for new hardware, for old hardware pick one of those XFCE, MATE or LXQT.
In my experience, MATE appears to be the least efficient. XFCE is most responsive on my hardware, whereas GNOME isn't too bad either. MATE chugs and tears when moving windows around the screen.
 
Just to clarify:

After disabling the dGPU in BIOS, the laptop runs the same as in Windows 10, i.e. it's silent and temperatures are good. However, one issue is making the OS unusable right now: no hardware acceleration on video. FreeBSD takes up about 600% more CPU than Windows to play the exact same video in a web browser (Windows uses 6-7%, while FreeBSD uses 45-50%). Under such circumstances, it's normal for the computer to get very hot, especially in hot weather.

I had the same problem with Arch Linux a couple years ago. My solution back then was to simply watch videos on my phone instead. But now I'm thinking: if I want to use FreeBSD or Linux as a daily-driver desktop OS, then I should aim for a genuine desktop experience. Why resort to workarounds, like not using YouTube, or loading YouTube videos into MPV, when I can simply get HW to work in a browser!

In my experience so far, KDE is not CPU-hungry, although RAM usage is indeed high. When I used Arch, I tried the "rat" (XFCE) before quickly moving to a dwm + st combo because it looked cooler. The price for minimalism was that I had to set everything myself: backlight controls, compositing etc. I still have PTSD from that, so this time I said: screw it, I'm installing KDE, which will do all of those things for me out-of-the-box.
I know that for me, Chrome runs better using Linuxulator than it does natively, particularly when watching videos. Perhaps the Linux version is using hardware acceleration?

I'm curious of something you could try, it might be a bit left-field though.

If you install xmoto via pkg, and then open it using a terminal i.e. sudo pkg install -y xmoto && xmoto do you get "Segmentation fault (core dumped) or does the game load ok?
Thanks for the Linuxulator tip. I'll report back when I try xmoto.
 
Just to clarify:

After disabling the dGPU in BIOS, the laptop runs the same as in Windows 10, i.e. it's silent and temperatures are good. However, one issue is making the OS unusable right now: no hardware acceleration on video. FreeBSD takes up about 600% more CPU than Windows to play the exact same video in a web browser (Windows uses 6-7%, while FreeBSD uses 45-50%). Under such circumstances, it's normal for the computer to get very hot, especially in hot weather.

I had the same problem with Arch Linux a couple years ago. My solution back then was to simply watch videos on my phone instead. But now I'm thinking: if I want to use FreeBSD or Linux as a daily-driver desktop OS, then I should aim for a genuine desktop experience. Why resort to workarounds, like not using YouTube, or loading YouTube videos into MPV, when I can simply get HW to work in a browser!

In my experience so far, KDE is not CPU-hungry, although RAM usage is indeed high. When I used Arch, I tried the "rat" (XFCE) before quickly moving to a dwm + st combo because it looked cooler. The price for minimalism was that I had to set everything myself: backlight controls, compositing etc. I still have PTSD from that, so this time I said: screw it, I'm installing KDE, which will do all of those things for me out-of-the-box.

Thanks for the Linuxulator tip. I'll report back when I try xmoto.
Interesting, let's see where this rabbit hole takes us.

I've found looking at RAM usage a bit misleading. KDE might well be caching itself for better responsiveness. I've known a variety of systems to hog a modest percentage of memory, as it is there and available, it might as well be used, to save on trips to storage etc. - Memory Pressure is a better measure, albeit harder to define.

Another thing you could try, before I get in trouble, is the Fedora Linux Workstation Live USB. Would isolate and rule out certain scenarios if you were scientific about isolating the cause.
 
KDE might well be caching itself for better responsiveness.

KDE is massively bloated with a ton of dependencies and background services that it "needs" (or just runs by default). Hence, in terms of 'responsiveness' it can never be anywhere near a lightweight DE like LXDE or XFCE, no matter how much memory it will hog...
As for CPU/GPU load all the bling bling of KDE also adds to unnecessary resource (and battery) usage - again: for better power efficiency use a DE that doesn't bloat everything with unnecessary visual effects.
 
Another thing you could try, before I get in trouble, is the Fedora Linux Workstation Live USB.
Apparently GPU acceleration no longer works out of the box in Fedora, they removed support for H.264 due to copyright fears. Fedora users have to install some additional drivers manually, like most of the Linux world. I installed Arch instead and set up HW acceleration fairly easily. I followed a guide for enabling VA-API on 4th gen Intel Haswell processors, so that eliminated the process of trial and error.

Currently in the Linux world, GPU acceleration works fine in Firefox by changing some settings (switch to Webrender + EGL). On my Arch installation, YT runs on 6-7% CPU. Linux Chromium is not worth it currently; per the official thread on the Arch forums, if you manage to enable VA-API after weeks or months of testing flags and environment variables, there's a chance you'll run into new problems, such as a memory leak bug or an update breaking VA-API for the umpteenth time.

I'm marking this thread as solved since the original problem (dGPU running for no reason) is fixed. In summary:

1. Turn off the dGPU in BIOS if your computer heats up but CPU usage is low.
2. Research and install the right combination of drivers for your processor, i.e. the right combination for HW acceleration.
3. Stick to Firefox and configure it for VA-API, as it is not optimized out of the box.
4. Install the H264ify browser extension, which will tell YouTube to restrict the codec to H.264.
 
3. Stick to Firefox and configure it for VA-API, as it is not optimized out of the box.
Interesting findings. How do you do this? Is it a reconfig and compile job from ports, or is it a configuration within the browser itself?

Edit: I just checked, on my FreeBSD laptop that gets scalding hot, Firefox is using hardware acceleration. I"ve tried adding the browser extension, and installed ffmpeg, so will see how it goes. Got it running a Full HD video now, will give it 10 minutes and see if it cooks.
 
No change. Still got very hot. Definitely using the correct drivers and firmware (AMD Turks chipset) - it doesn't have integrated graphics, just the one dGPU.

I think I'm going to retire FreeBSD from this particular machine and leave it to the desktops that have better airflow for cooling, and don't cause me skin problems on my thighs!
 
it doesn't have integrated graphics, just the one dGPU.
AMD dGPU's simply run much hotter. I tested my dGPU with Windows recently (I almost always use the iGPU) and playing any kind of video with it instantly makes the fans roar. With proprietary drivers!
installed ffmpeg
Firefox will ignore your system's ffmpeg library and use it's own bundled version, unless you disable media.ffvpx.enabled. You could try some FF optimizations and see if it helps with temps:

Type about:config in the address bar and change the following flags:
gfx.webrender.all -> true
media.ffmpeg.vaapi.enabled -> true
media.ffvpx.enabled -> false
media.rdd-vpx.enabled -> false
media.hardware-video-decoding.force-enabled -> true
media.ffmpeg.vaapi-drm-display.enabled -> type this, then click the "+" sign to enable it
(Optional: in my testing, toggling webgl.disabled to true also shaves off 3-4% percent of CPU, with the downside of not having WebGL).

The default compositor (Webrender) performs quite poorly unless you couple it with EGL rendering. You can do that by adding the following environment variable to your system: export MOZ_X11_EGL=1. After rebooting, this variable should show up in Firefox when you visit about:support and look under "Environment Variables". Note: as of Firefox 88, setting gfx.x11-egl.force-enabled to true (in about:config) will do the same thing as setting this environment variable. I've done both steps either way. Also, a few months ago there was a bug where VA-API didn't work unless you also set this environment variable: MOZ_DISABLE_RDD_SANDBOX=1. The bug is fixed now.

Some other things you could try:

YouTube
When playing a video, click on the gear icon and make sure Ambient Mode is disabled. This setting will appear if you use dark mode.
Block 60fps using the enhanced-h264ify browser extension.

Try other types of decoding
See if some fellow AMD users have found solutions for that GPU's heat problem. If you can't find something, you could, as a workaround, try software decoding and compare the temps.

System
Make sure vainfo is not returning errors.
Install bsdfan with pkg install and enable it to see if thermals are improved.
Uninstall deprecated and problematic drivers. Use the modesetting driver.
Tweak your power saving settings.

Hacky workaround
Open YT videos with MPV. Requires installing yt-dlp. Videos are loaded by typing mpv "YourLinkHere" in the terminal.

The following MPV config uses about 3% CPU on my system if playing H.264 video:
Code:
gpu-dumb-mode=yes
vd-lavc-dr=no
hdr-compute-peak=no
hwdec=vaapi
demuxer-max-bytes=10M
vo=gpu

I also add this to the yt-dlp config to only download h.264, 720p, 30fps video:
Code:
-S vcodec:h264,res:720,fps:30
 
Back
Top