Witko / nvidia-xrun

Utility to run separate X with discrete nvidia graphics with full performance
GNU General Public License v2.0
488 stars 69 forks source link

Replace sleep BUS_RESCAN_WAIT_SEC with lspci-based GPU check; tweak MODULES_LOAD in config #133

Open masskonfuzion opened 5 years ago

masskonfuzion commented 5 years ago

@Witko et. al, I really love what you're doing with nvidia-xrun. This PR is the result of my playing around with the script & configs on my machine, trying to get things to work.

Background: I was getting sporadic general protection faults when running nvidia-xrun "as-is" from Git on my machine. Some salient specs:

Originally, I had been using the nvidia-xrun package from the Arch AUR, until it started to fail on me sporadicatlly. I then noticed that the AUR package was flagged out of date as of roughly a month ago, so I cloned the git repo to get the latest.

After deploying the scripts & configs manually from git, I was still getting sporadic GP faults. That led me to tinker.

I now seem to be able to start nvidia-xrun. I think the main issue was the nvidia_drm "modeset" option. But to be honest, I'm still not 100% sure of the interplay between, for example, nvidia_modeset and nvidia_drm modeset=1 vs. nvidia_drm with the modeset option omitted..

The other changes in this PR were maybe not strictly necessary. But as I was troubleshooting, I came to like the idea of using an lspci-based verification that the GPU came up, instead of the sleep-based approach. (My rationale was: I added sleeps/slowdowns, thinking maybe the GP faults were caused by a race condition of some sort -- that was the first thing I thought of to explain why sometimes nvidia-xrun would start my x session and window manager just fine, but other times it wouldn't. Truth told, I still can't explain it... ¯_(ツ)_/¯ )

Any feedback is welcome.