Screen flickering when running linux on dgpu only, mux laptop

So I have a lenovo legion y740, with an i7-9750h and a 2070 max-q. I am running gnome on X11. My laptop has a MUX switch that lets me switch between:

1)Dedicated GPU mode (laptop runs only on the nvidia card for better performance, Intel igpu is turned off, allows me to use gsync /nvidia optimus off)

  1. Hybrid mode (igpu + dgpu is turned on, helps in saving battery life/ nvidia optimus on )

Hybrid mode saves battery life as when heavy apps aren't running, it switches over to the igpu. This vs dgpu only mode where avg power draw is higher, performance is much better as nothing is routed through the igpu. Please see: Disabling Optimus = Better Gaming Performance! - YouTube

Now as i dual boot windows with linux and use windows only for gaming, i obviously prefer to use dgpu only mode in windows. But continuously having to go into my bios to switch to hybrid
mode to use linux is an irritation.

Now With proprietary drivers installed. I have no problem running on hybrid mode, everything works fine But when I go to my bios and turn on dgpu mode, arch boots but the screen starts flickering, the second there is any gpu load - more the load, the greater is the flicker.

I had a look at Hybrid graphics - ArchWiki And only the first part of the page offers any info about laptop that HAVE a MUX switch.

Note: there isn't any flickering while using nouveau drivers, but performance is worse and brightness is stuck at 100% (pretty sure there is a hack out there somewhere to fix this, but my main focus has been trying to run the proprietary drivers without flickering)

So far, here are the things that i have tried with both nvidia and nvidia-dkms drivers. I am currently using dkms.

1)Blacklisting nouveau drivers

2)Forcing full composition pipeline in nvidia server settings and running a script that enables it on start. Screen flickering persists.

3)Changing modeset to 1

i followed 2 and 3 from here:

Note: Windows had a similar problem back in Sept. 2020 that started with the release of 456.38 but that was promptly fixed through a driver update.

I apologize for the cross posting, my first post on this forum was closed regarding the same, you guys can delete it if you want, as this one is more upto date. I've posted on 4 forums, 4 subreddits and still haven't gotten a solution that works, so if anybody has even the faintest clue, please do help out!

Have you tried everything from here? : NVIDIA/Troubleshooting - ArchWiki

Force Composition Pipeline did work for me. I use nvidia-all drivers by TK-Glitch (version 465.31). Maybe you can give that a try?
Repository: GitHub - Frogging-Family/nvidia-all: Nvidia driver 460 to 396 series AIO installer

1 Like

mhwd - li
name version , freedriver , type
video-linux , 2021 .02. 19 true pci
nvidia-dkms 2021.12.19 false pci


yes, i have tried everything on the nvidia toubleshooting page on the arch wiki.
Force full composition pipeline does nothing for me.
I tried nvidia-all, its bascially the same as dkms, that too does nothing.

I don’t find anything new here comparing to your previous topic.
You have not answered the question:

IIRC you use not Garuda, post your

inxi -Faz

Just try Garuda or other Distro to check if it is Arch or only your installed system.

1 Like

I am using garuda at the moment. However Its not a garuda issue and i honestly couldnt care less about the distro as long as its arch based. The exact same thing happens on ubuntu, debian, opensuse, gentoo and everywhere else. Its an linux/nvidia issue/one specific to my laptop
also @petsam i have looked at my laptops manual, says nothing helpful about linux.
i am aware that vendors build laptops with ms in mind, was just trying my best to find a way to make prop drivers work.
Mux laptops aren't anything new, they've been around forever and only newer ones switched to optimus to help increase battery life. (which doesn't matter at all to me for the next 3 years)
Power consumption has nothing to do with anything in this case. Please read up on optimus and mux switches. having both cards on consumes less power on avg as the system balances between using the igpu and dgpu.
vs having the dgpu on all the time, where the igpu doesn't botteneck the dgpu letting it run far more smoothly
The only reason i want to run my laptop on dpgu mode is the performance boost, having igpu + dpgu running when battery life isnt taken into consideration is idiotic, and having to switch over to dgpu every time i boot into windows is a massive irritation.
Also its worth noting that i found a partial solution, where i run nouveau firmware. And although brightness gets stuck, i can fix that by using an xrandr brightness shortcut.

1 Like

It seems you know the technical stuff too well, so I wonder why do you pretend to ask for help, when you will consider any answer as worthless, based on your knowledge.
Haven’t you ever thought there is a slight possibility some other person might know something you don’t?
If you expect explanation for each advice given, do that also against a doctor, when you ask medical advice. Do you believe it is possible to get several years of others’ experience in an answer?

Also, you contradict yourself with what you explain above. The fact that you don’t realize it, does not mean it is not true.

It’s good you have found a workaround. Stay around the forum, so you can help others with the same issue :wink:

2 Likes

Sorry, i never meant to give the impression of being too cocky l, its only been a month since i started using linux.
Also I did consider the fact that you may be correct and in fact i tried to look up articles for laptops that have a multiplexer switch to find evidence for what you said.

ill try to explain what i found more clearly, i only request that you go through what i have written thoroughly.

Case 1 (hybrid mode /optimus on):
The integrated gpu and dedicated graphics card is running. Now most of the time it runs on the igpu for browsing, etc. as there is no need for the power that the dedicated graphics card brings.The dgpu SHOULD turn on and max out only for heavy workloads.
Note: The power draw of the igpu and cpu is counted against the processors tdp, meaning that the greater the igpu's usage, the lesser work the actual cpu can do, for the same thermal limit and power draw.
When i now run a heavy game, say the witcher 3 at max settings, The igpu's usage should theoretically reduce to 0 and the dgpu and cpu should both climb to 100%, which is ideal, but what ends up happening on laptops is that the dgpu falls to say 60%, the igpu runs at 100% bottlenecking the dgpu (the path being followed is dgpu->igpu->display) which should have been at 100%, and the cpu, which should have also been running at 100% now runs at 60-70% with a lower clock speed as the igpu is also drawing power.

Case 2(Dedicated mode, igpu off): All your shit runs on the dgpu, browsers and even minesweeper which results in awful battery life usally around 30-40 minutes but the advantage with it is that now the cpu and dpgu can run unthrottled as
a) the igpu isn't taking away power that should have ideally gone to the cpu during a heavy workload.
b) it isnt throttling the dgpu because the path is now (dgpu -> display)
And so NOW the cpu and dgpu both run at 100% in a heavy workload unlike before where it was 60-cpu, 60-dgpu and 100-igpu.

Please, please see this, i hate repeating this constantly:
This laptop was intended to be a desktop replacement, and not a college or work laptop, so its plugged in 24/7, and battery life is not ever taken into consideration. When i was using windows, it was permenantly on dgpu mode but ever since i switched to linux, i have to continuously shut down my laptop go into bios and change to dgpu when i want to play and igpu when i want to use linux. I really hate doing this. I would prefer if both ran only on dgpu mode 24/7.

Also, i'd like to mention here that the main focus of this issue was the "FLICKERING" that was occuring on dgpu mode, not on the reason and history behind me wanting to use dgpu mode, but we seem to have gotten stuck on this arbitrary point, so here is the explanation.

TLDR: I couldnt give less of a shit about battery life, or about the total power draw because this laptop has been connected to its 230W brick for the last year and will remain like this for the next 4 years, until i go to college.

If this has been cleared out now, could we please try and troubleshoot the actual problem, because i have combed the entire internet and not found a single thing that helps, i am positive that there is a solution but don't know enough about linux to troubleshoot it myself.

Again, I apologize for being rude and stoic, that was never my intention, its only that this flickering is really beginning to get on my nerves. If you need any specific hardware configuration outputs / logs
please just ask, and i will gladly provide. Trust me, I truly do appreciate you all helping me!

Why would you use hybrid for Linux, when you don’t care about power consumption?
Use dGPU only mode and remove video-linux from MHWD GUI.
Reboot and try to troubleshoot.

As for helping you, you were asked to provide info, but you still forget.

1 Like

I dont use hybrid mode for linux, i just had to because of the flickering.)
Removed video-nvidia, installed video-nvidia-dkms, have changed nothing, flickering obviously present.
Inxi -faz output here: Inxi -faz - Pastebin.com

Why do you have to go to bios? Have you tried optimus-manager? It has a Hybrid solution which is even easier to switch between when using it with optimus-manager-qt. Just install both packages from the package manager and reboot. Then change the settings as needed. Optimus manager is compatible with the drivers I mentioned before. If using hybrid, you can set some apps to use the dgpu. If you don't then I think it by default opens them with the igpu.

So optimus manager, like you said, is a perfectly viable solution if you want to run your laptop in hybrid graphics. And I've used it before and it works well.
Long story short, I don't want to simply because I game on windows which has a substantial performance gain on dgpu mode and i dont care about battery life, making hybrid mode altogether unnecessary. On linux, i was only forced to use it because of the flickering.
Please have a look at my older replies, I've explained why in detail.

Verify nouveau is blacklisted.
Check journal and Xorg logs for error messages.
Search error messages at Archwiki (nvidia troubleshooting) and the web.
Test solutions to find the right one.

Good luck! :beach_umbrella:

2 Likes

Hey, so i did all that you mentioned, and had no such luck with the screen flickering, it still persists:
I blacklisted free drivers, changed modeset to 1, uninstalled video-linux, forced early KMS, nothing works.
But i found 2 things new and one of them very weird:

  1. My horizontal sync was at 164.0 -164.0 in my nvidia config file, although my max refresh rate is only 144.0 . So i changed "164.0-164.0" to 144.0,rebooted and nothing happened.
  2. Really really strange, No flickering occurs when on battery / laptop isn't charging.
    Not too sure what charging has to do with anything display related, but maybe you guys have an idea? No flickering ever occurs on windows, so i don't know whether its a hardware or software issue at this point.

Hey I have exactly the same laptop and the same problem. It used to work in nvidia 450 drivers after that this problem came . To fix it u can use optimus-manager it uses xrandr and sets sinks etc which force render on dgpu and then use igu to finally display, I know this ain't what we want but it works and has really great performance after all u won't be gaming on linux so 10-20 frames doesn't matter. Regarding bios settings ye that's still a mess some ppl have pointed out using external monitor can fix it .
Lemme know if u find something

Do you have tlp installed?

This sounds like something tlp is sometimes responsible for creating with its power saving configuration settings.

1 Like

Does it make sense to use older drivers then?
Also the solution you mentioned, it is for switchable mode right? could you please send links to said solution?

Nope, I don't have tlp installed.

The optimus-manager one? Yes it does require u to run on Intel gpu but u can force render on dgpu instead of igpu from optimus-manager settings( if u feel lag) it will redirect it to screen using igpu. Regarding old drivers ye doesn't make sense but they used to work , and the monitor one does work I tried that yesterday the laptop screen kept flickering while external monitor worked. Regarding links I found it in nvidia forums it had one line works on 450 and external monitor and nvidia hasn't fixed it since

It wasn't actually the performance boost so much on Linux, as it was not having to enter the bios when I booted up windows.
Basically I don't want to switch to igpu mode until like 2023-2024 because my laptop will always be plugged in.
Nouveau drivers do work without flickering but they keep crashing for some reason. Brightness is stuck but easily resolvable through the xrandr hack.
Maybe I'll just find a way to fix it.