[SOLVED] Installing nVidia drivers with Optimus support, startx gives error "no screens found"
SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Installing nVidia drivers with Optimus support, startx gives error "no screens found"
Just spent most of the day seeing if I could figure this out on my own. I feel like I did reasonably well for a first attempt, but X will not start and I haven't been able to figure out how to fix it...so here we go!
I have a Dell XPS 17 laptop that has both Intel and nVidia graphics with Optimus. I spent some time reading the Slackware documentation, along with the instructions on SlackBuilds.org before attempting the procedure.
Here's a summary of what I did:
1) Install xf86-video-nouveau-blacklist package from /extra on the Slackware disc
2) Install nvidia-kernel from SlackBuilds
3) Install libvdpau from SlackBuilds
4) Install nvidia-driver with COMPAT32="yes" from SlackBuilds
5) Copy /usr/share/X11/xorg.conf.d/10-nvidia.conf to /etc/X11/xorg.conf.d/
After doing this, everything seemed to be ok. I saw no errors during boot, and I also saw a message that the nvidia module had been loaded successfully. I saw no mention of nouveau anywhere, indicating it had been successfully disabled.
Now, when I run startx, it fails with the following error:
Fatal server error:
no screens found
My first thought was that maybe because of the Optimus hardware, the config file may need some additional information, so I tried to run the X -configure command mentioned in the wiki, and got the following error:
Number of created screens does not match number of detected devices.
Again making me think something with the Optimus is preventing it from working. After some more reading, I tried running xorgsetup, which created a new xorg.conf file that was much larger than I've seen in the past (a few hundred lines if I recall correctly) and it had numerous entries in the Screen subsection (I recall at least 7, could have been more.) Most of the examples I've seen around the net had far less information in them, so I was immediately skeptical of this.
Oddly enough, with this huge xorg.conf file, I was able to run startx and get into KDE. However, as soon as I tried to open a terminal, everything froze. I couldn't switch to another terminal or kill X with Ctrl-Alt-Backspace, had to do a hard shutdown.
So then, I thought that maybe bumblebee might help with the multiple screen confusion, and I followed this guide to try to get it installed (taking careful attention to use the COMPAT32="yes" option for everything that needed it.) I also made sure to use the nvidia driver I downloaded from SlackBuilds, and changed the version number in the bumblebee.Slackbuild script accordingly, so as not to be mixing different driver versions, which seems obviously undesirable. I skipped the kernel section of the guide, since I already did this earlier and it appears to be working.
So I restarted again, ran startx...exact same error, no change.
It seems that the xorg.conf needs a very specific setup for Optimus laptops, but I haven't been able to find any documentation that addresses this specifically. I also saw several places that mentioned xorg.conf was deprecated in favor of some new files under /etc/X11/xorg.conf.d/ that matched the naming convention for the file automatically generated by the nvidia driver, but I'm a little confused on exactly which config file is the "correct" one?
OK, after a few more hours of troubleshooting I discovered a few interesting things.
First, I attempted to run slackpkg clean-system, and the proceeded to install Bumblebee again, this time with the intention of letting it use its own nvidia driver. While compiling the VirtualGL dependency, it stopped with an error that it couldn't find libGL.so. I traced this to being an OpenGL library that sounded like something that would be installed with a default system. This compiled fine earlier with no errors, so I guess something happened after removing all these packages.
In order to rule out any other possibilities, I just went ahead and did a full reformat/reinstall. While I was cloning the Bumblebee from github, I thought to myself that I better run KDE on a stock nouveau driver just to make sure it works ok. To my surprise, it did not! It froze before even getting to the desktop, had to do another hard shutdown. I restarted and tried again, this time making it to an open terminal window, and after typing one character, it hard froze again.
So it seems I have some other graphics problem going on that I wasn't aware of, and I need to solve this before trying to install the nvidia driver again. I've been working exclusively at the command for the last few weeks, but I distinctly remember using KDE a month or so ago and it worked fine with no freezing problems, so something must have changed since then.
I'm running a totally default Slackware 14 install, with only the following changes:
multilib, with appropriate slackpkg blacklists
slackpkg upgrade-all, fully up to date with kernel 3.2.45
One last thing I tried was adding [Compositing]Enabled=false into ~/.kde/share/config/kwinrc, but that didn't change anything either.
I looked through /var/log/Xorg.0.log for any clues, but everything looks ok as far as I can tell. The only thing I saw that jumped out at me was the fbdev module couldn't be opened because it didn't exist, but the intel modules are loaded and working.
I guess at this point I'm leaning towards either the kernel upgrade from 3.2.29 to 3.2.45 or the terminus fonts causing the issue, but is there anything else that could cause this that I'm unaware of?
I just happened to wander into this thread right after posting this, and several pages in some people were reporting this very issue, with freezing in X with intel graphics.
It sounds like rolling back to 3.2.29, or upgrading to the 3.8 series in -current is resolving this issue for everyone, so that seems like my next course of action.
It might take me a few days to figure out how to do this, so I'll report back as soon as I can figure it out.
Last edited by flokofcgulls; 06-02-2013 at 10:40 PM.
I managed to figure out how to download and install the 3.8.13 kernel from Slackware -current and get it working, so I didn't have to build one from scratch (sounds like fun but not quite ready for that yet!) I tested X and the freezing problem seems to be gone, so I was ready to try the Bumblebee install again.
I followed the instructions on the Optimus page in the Slackware docs again, and I did notice something I did incorrectly the first time. I had installed the packages with the installpkg, rather than upgradepkg --install-new, and that may have contributed to my earlier issues, got that straight now! I also didn't realize that Bumblebee included the nvidia driver, so trying to do them separately may have also caused an issue.
I was also able to compile VirtualGL with no issues this time around. It seems that installing all the Bumblebee packages, then running a slackpkg clean-system to remove them, did something with the libGL.so that made it unavailable. A system reformat/reinstall fixed the problem, but I'm sure there was probably a better way to fix it.
I also noticed that the Slackware docs did not mention installing libvdpau, which is required for the nvidia-bumblebee package to compile. Luckily I recalled this step from the SlackBuilds documentation, and added it in after VirtualGL, not sure if it was omitted intentionally, but if not it might need an update.
So after getting them all installed, I ran the following commands:
Attempting to start bumblebeed fails, and gives the following error:
/etc/rc.d/rc.bumblebeed: line 40: 2574 Segmentation fault "$BIN" --daemon
I believe a Segmentation fault indicates that the program attempted to write outside of its allowed memory space if I recall correctly. I took a look inside the script and line 40 is the definition of a short method called start(), but I haven't learned the syntax for these scripts yet so I wasn't able to make any reasonable guesses as to what might be the issue.
I checked X one last time after this, and it's still working ok. I ran glxgears and got a solid 60fps, so I believe the nvidia driver might be working, but I'm not sure if that alone is conclusive.
So I've made some good progress, I think if I can figure out this bumblebee issue I might have this one solved.
Anyone have any ideas what would cause this?
Last edited by flokofcgulls; 06-03-2013 at 11:52 PM.
Did you use libbsd > 0.4.2? For some reason libbsd 0.5.* also gives me segfaults when running the bumblebee daemon.
Also, there's a pre-built libvdpau that is shipped with the nvidia-bumblebee driver which is why I did not include compiling and building libvdpau (and as far as I know, libvdpau was only needed if you're going to use nouveau, or at least that's what the README says.
I did indeed use libbsd-0.5.1, as that was what came down with the Bumblebee-Slackbuilds GIT repository.
I tried your suggestion by removing libbsd-0.5.1 with removepkg. I then downloaded libbsd-0.4.2 from SlackBuilds.org, and installed it with upgradepkg --install-new.
Then I tried to start rc.bumblebeed again...and it worked! No more segmentation fault! =)
I then went into X and ran glxspheres both with and without the optirun command, and sure enough it was switching between the Intel and nVidia GPU for rendering, so I think it's all working correctly now!
As for your comment about libvdpau, the only reason it came to my attention was because nvidia-bumblebee failed to compile without it, I don't recall the exact error but it was clearly complaining about that, and after installing it, it compiled with no problems. I also see it listed as a dependency for the nvidia-driver on SlackBuilds.
So for anyone who happens across this thread in the future, here's a brief summary of what happened:
1) I installed nvidia-driver and dependencies from SlackBuild, which resulted in the "no screens found" error.
2) I then tried to install bumblebee after the fact, which did no good.
3) I then tried to do a rollback with slackpkg clean-system, and in doing so caused an issue with libGL.so no longer being found.
4) I didn't know how to fix the libGL.so problem, so I reformatted/reinstalled.
5) I then followed this guide, which installs both bumblebee and the nvidia driver together.
6) After doing this, I couldn't start rc.bumblebeed due to a segmentation fault error.
7) I removed the libbsd-0.5.1 package, and installed libbsd-0.4.2 in its place, which resolved the segmentation fault error.
8) Tested bumblebee in X and all is well!
Now, for TommyC7, I have one final question...how did you figure out that the newer libbsd package was causing the segmentation fault error? I would have never guessed that, so I'm super-curious about your troubleshooting technique on this issue.
I'm not sure how common this issue is, but it might be nice to have listed under the troubleshooting section on the Slackware Docs page for this procedure, along with clarifying the libvdpau requirement. I don't know what the official procedure is for recommending an update to the Slackware documentation, so I'll just put the idea out there.
Well I'm the original author of that wiki/docu page and I started using modified SlackBuilds awhile back.
I have a script that's run on some sites to check for new packages and libbsd at the time had been one. I built the new package and noticed none of the major library versions that bumblebee relies on had changed so it didn't seem like it needed a rebuild. So I just restarted the daemon and got the same problem you did.
I'll look into that libvdpau thing later, but at the moment I'm quite busy with other things.
The SlackBuilds used for bumblebee aren't provided by me so unfortunately I can't help too much there other than to say you should modify the version as you already did.
Thanks for the info, I was wondering if there was some way I could have figured out to look for something like that, but I guess you just happen to be in the right place at the right time.
I didn't even realize you were the author of that page, I had to scroll way down and found your name at the bottom. Thanks for putting that together, greatly appreciated!
I'm actually working on documentation on setting up my laptop with a fully functional Slackware system, since I have sort of a complex setup it's helping me keep everything straight since I'm learning as I go, and I'm sure I won't remember all these steps whenever I have to do it again someday!
Once its finished I'd like to put it up here in some form, since I've received so much help here, its my way of returning the favor. I doubt I have enough experience to be editing the official wiki pages just yet...maybe someday.