Trouble Making Projects in Fedora 8 with Cuda 1.1 /usr/bin/ld: cannot find -lGL

I am running Fedora 8 using Cuda 1.1 Toolkit and SDK, and I have the Nvidia driver 169.12 driver installed on my system with an 8800 GTS card. Installation and environmental variable setup went smoothly, but I cannot run make from any of the project folders. I am getting the following error:

[craig@localhost alignedTypes]$ make

/usr/bin/ld: cannot find -lGL

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/alignedTypes] Error 1

I have read the release notes and I am aware that I need to add a soft link. Here is my current configuration:

[craig@localhost alignedTypes]$ ls /usr/lib/libglut.so -all

lrwxrwxrwx 1 root root 12 2008-04-14 19:30 /usr/lib/libglut.so -> libglut.so.3

This has not fixed the problem. Can anyone else point me in the right direction?

Regards,

Craig

libGlut is not the same as libGL. libGL ships with the NVIDIA display driver. Did you install the official driver package from NVIDIA’s website?

No. I thought that the driver that came with Fedora would work.

I have downloaded the driver from the cuda website and tried to install it from runlevel 3 by booting Fedora into the command line. Each time I run the driver installer, it says that there is no interface for the distribution and then it attempts to download the files from the nvidia site. Unfortunately, it fails to connect to the ftp site and the installation fails. How can I enable internet access in Fedora from runlevel 3 so it can download the necessary drivers? Or is there a way to download the required files beforehand?

If the driver fails to download the kernel module, it usually just builds it with gcc. You shouldn’t need that ftp download to work in order to get the drivers installed.

Thanks for the tip. I clicked ‘no’ when it asked to download the driver and it proceeded to install the driver without any hiccups. However, after installing the driver, I get the following error message when I boot Fedora 8:

Checking for module nvidia.ko     [FAILED]

This is followed by warning messages regarding the face that nvidia.ko is not present. My system then continues to boot, but the display is really f**ked up. There is a band of digital noise at the top of the screen and the desktop is not centered on the display and wraps around the screen, where the icons which are normally on the left have wrapped around such that they appear on the right. Also, all of my windows appear at the top left of my screen and have no title bar, so I can’t move then or close them, except using the menu. Its really weird. I’m guessing that if I sort out the nvidia.ko problem then this will go away. Any ideas?

Thanks,

Craig

Ok, I think I’ve sorted out the

Checking for module nvidia.ko     [FAILED]

error. Please note when I install fedora, I installed driver 169.12, but that was the incorrect version (for cuda). Unfortunately, the installer did not completely remove the files related to that version. However, I’ve read else where that some people with the ‘nvidia.ko’ problem could fix it by installing kmod-nvidia. However, that was installed with the 169.12 driver so I removed it before running the 169.09 driver installer from the terminal.

sudo yum remove kmod-nvidia

I got a number of errors when I ran the installer for 169.09. Here are the errors from the /var/log/nvidia-installer.log, which I’ve attached:

-> Uninstalling NVIDIA Accelerated Graphics Driver for Linux-x86 (1.0-16909

   (169.09)):

-> Unable to restore symbolic link

   /usr/lib/xorg/modules/extensions/nvidia/libglx.so -> libglx.so.169.12 (No

   such file or directory).

ERROR: Unable to create

       '/usr/lib/xorg/modules/extensions/nvidia/libglx.so.169.12' for copying

       (No such file or directory)

WARNING: Unable to restore file

         '/usr/lib/xorg/modules/extensions/nvidia/libglx.so.169.12'.

ERROR: Unable to create '/usr/lib/nvidia/libGL.so.169.12' for copying (No such

       file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/libGL.so.169.12'.

-> Unable to restore symbolic link /usr/lib/nvidia/libnvidia-cfg.so.1 ->

   libnvidia-cfg.so.169.12 (No such file or directory).

ERROR: Unable to create '/usr/lib/nvidia/libGLcore.so.169.12' for copying (No

       such file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/libGLcore.so.169.12'.

ERROR: Unable to create '/usr/lib/nvidia/libcuda.so.169.12' for copying (No

       such file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/libcuda.so.169.12'.

-> Unable to restore symbolic link /usr/lib/nvidia/libGL.so -> libGL.so.169.12

   (No such file or directory).

-> Unable to restore symbolic link /usr/lib/nvidia/libcuda.so ->

   libcuda.so.169.12 (No such file or directory).

-> Unable to restore symbolic link /usr/lib/nvidia/libcuda.so.1 ->

   libcuda.so.169.12 (No such file or directory).

-> Unable to restore symbolic link /usr/lib/nvidia/libGL.so.1 ->

   libGL.so.169.12 (No such file or directory).

-> Unable to restore symbolic link /usr/lib/nvidia/libXvMCNVIDIA_dynamic.so.1

   -> libXvMCNVIDIA.so.169.12 (No such file or directory).

ERROR: Unable to create '/usr/lib/nvidia/libnvidia-cfg.so.169.12' for copying

       (No such file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/libnvidia-cfg.so.169.12'.

-> Unable to restore symbolic link /usr/lib/nvidia/libXvMCNVIDIA.so ->

   libXvMCNVIDIA.so.169.12 (No such file or directory).

ERROR: Unable to create '/usr/lib/nvidia/libXvMCNVIDIA.so.169.12' for copying

       (No such file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/libXvMCNVIDIA.so.169.12'.

-> Unable to restore symbolic link /usr/lib/nvidia/libGLcore.so ->

   libGLcore.so.169.12 (No such file or directory).

-> Unable to restore symbolic link /usr/lib/nvidia/libGLcore.so.1 ->

   libGLcore.so.169.12 (No such file or directory).

ERROR: Unable to create '/usr/lib/nvidia/libnvidia-tls.so.169.12' for copying

       (No such file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/libnvidia-tls.so.169.12'.

-> Unable to restore symbolic link /usr/lib/nvidia/libnvidia-tls.so.1 ->

   libnvidia-tls.so.169.12 (No such file or directory).

ERROR: Unable to create '/usr/lib/nvidia/tls/libnvidia-tls.so.169.12' for

       copying (No such file or directory)

WARNING: Unable to restore file '/usr/lib/nvidia/tls/libnvidia-tls.so.169.12'.

-> Unable to restore symbolic link /usr/lib/nvidia/tls/libnvidia-tls.so.1 ->

   libnvidia-tls.so.169.12 (No such file or directory).

ERROR: Unable to create '/lib/modules/2.6.24.4-64.fc8/extra/nvidia/nvidia.ko'

       for copying (No such file or directory)

WARNING: Unable to restore file

         '/lib/modules/2.6.24.4-64.fc8/extra/nvidia/nvidia.ko'.

-> done.

-> Uninstallation of existing driver: NVIDIA Accelerated Graphics Driver for

   Linux-x86 (169.09) is complete.

Despite these errors, the installation continues and completes successfully, and I no longer get the nvidia.ko error. The system now boots without any errors.

BUT! I still have no title bar for my windows, and I cannot move the windows in Fedora! Why is this happening? Not sure if this helps, but here is a screen grab of my nvidia driver information:

(Notice that there is no title bar on this window. Luckily there is a quit button so I can close the windows. Because I cannot use ‘alt-tab’ to change between windows and I also can not click on a window to bring it to the front.)

Does anyone know how I can get my title bars back? I think I’m really close to getting my installation to work.
nvidia_installer.txt (36 KB)

Ok, I’ve figured out that the problem that I was having with the missing title bars was related to the compiz effects. After I installed the 169.12 driver, I enabled the desktop effects (rotating cube and wobbly windows). However, after I uninstalled the driver and installed the 169.09 driver, the compiz desktop effects were still trying to engage and this was causing the title bars disappear. Apparently, the 169.09 driver is incompatible with compiz (or at least the version I have installed on my machine). Now when I try to run a simple example I get this:

[craig@localhost alignedTypes]$ make

/usr/bin/ld: cannot find -lGLU

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/alignedTypes] Error 1

This looks similar to the problem I was having in the first thread. Is there another driver I’ve forgotten to install (again).

Regards,

Craig

Odd, both 169.09 and 169.12 should support CUDA. Are you saying that the Fedora installed drivers didn’t work with CUDA? (As opposed to the ones you installed directly from NVIDIA) Then it is likely a bug with Fedora not installing libcuda.so from the drivers. Since you’ve solved this portion of the problem, it’s a moot point, but you could check if there is already a bug in the fedora bug tracker and submit one if there isn’t.

Anyways, about your latest GLU problem: you need to install the GLU development libraries: the package to install with yum is probably named something like libGLU-devel (someone who knows more about fedora, correct me if I’m wrong). Silly RPM based distributions seem to think that no-one would ever want to actually compile code on their machines and split every library into the package needed by other software, and the -devel package needed to compile programs.

No, I’m saying that the Fedora installed driver (actually it comes from livna, which is the “official” non-free repository for NVIDIA drivers) does not include all the libraries needed by cuda (see reply #2 above, and obviously this one). So yes, the 169.12 driver did not work because it was missing the libraries I required. At least that is the way I read reply #2. Also, the 169.09 driver is the only one listed on the nvidia web page so I thought that was the only one which would work? Is that not true?

I did a search and came across this package:

[craig@localhost ~]$ yum search libGlU

mesa-libGLU.i386 : Mesa libGLU runtime library

mesa-libGLU.i386 : Mesa libGLU runtime library

mesa-libGLU.i386 : Mesa libGLU runtime library

glusterfs-libs.i386 : GlusterFS Library and Translators

mesa-libGLU-devel.i386 : Mesa libGLU development package

mesa-libGLU-devel.i386 : Mesa libGLU development package

so I installed the ‘mesa-libGLU-devel.i386’ package, and the problem regarding ‘-lGLU’ has gone away. Now I have a new error:

[craig@localhost alignedTypes]$ make

/usr/bin/ld: cannot find -lcutil

collect2: ld returned 1 exit status

make: *** [../../bin/linux/release/alignedTypes] Error 1

Which library am I missing now. I tried a search for ‘cutil’, but that only brings up some python library. Why doesn’t the driver installer automatically configure all this stuff? It seems kind of silly to have to jump though all these hoops.

Regards,

Craig

All released drivers after 169.09 support CUDA 1.1. If the livna installed drivers do not install libcuda.so and related header files, it is a livna bug.

cutil is build in the SDK. To compile it (and all the samples), just run make from the root SDK dir. To compile just cutil, cd to the “common” directory of the SDK and run make there.

I think you’re just having bad luck with all these problems cropping up. It’s not really supposed to be complicated :) Usually the driver install goes smoothly. The SDK build is a little more complicated than it needs to be, and could be documented better.

Ha! Ha! Yes! I ran make from the SDK root and now I can ‘make’ projects. Thanks a lot for your help. Now I can finally do some work! I was programming strictly using the emulator because I didn’t have a 8 series graphics card. I just got a new 8800 GTS 512 card and I’ve been having a really difficult time installing the £$%^ thing.

Regarding the Livna driver, I downloaded the NVIDIA 169.12 driver from the NVIDIA home page, and installed it to see if it would work. It works fine, but I still cannot enable compiz effects. No big deal, but its kind of silly that it doesn’t work. I’ve got one of the best graphics cards on the market, but I can’t enable desktop effects. :wacko: I’ll try to figure out how to post a bug on the livna website regarding it.

Anyway, Thanks a lot for your help MisterAnderson42!

No problem.

About the desktop effects: did you tell the driver install to update the x.org config file? If so, it may not have set all the options you need for compiz to run. Here is a guide for setting those options [url=“http://gentoo-wiki.com/HOWTO_nVidia_GL_Desktop_Effects”]http://gentoo-wiki.com/HOWTO_nVidia_GL_Desktop_Effects[/url] . I know it is a gentoo guide, but most of the stuff is general to all distributions. If I had to guess, I bet the problem is one of the needed options is missing from /etc/X11/xorg.conf.

It looks like installing the official driver from the NVIDIA website does not work well with compiz desktop effects. However, I have figured out how to install the driver properly using the livna website, which works perfectly well with compiz. Basically you need to include the -devel and -lib packages when you install the driver. These install the cuda lib/header files in your installation. The reason why the livna driver doesn’t include these packages is because most people don’t need them. They just want the graphics card to work (not write cuda programs). If you want to read more about it, then take a look at the livna bug request I posted.

Here is the way I would go about installing the driver for Fedora 8 using the package manager and yum.

  1. Go to the package manager and install the nvidia driver (make a note of the package name listed). example:

  2. Open a terminal and type the package name noted earlier and add -devel and -libs at the end of the name. example:

[craig@localhost alignedTypes]$ sudo yum install xorg-x11-drv-nvidia-libs xorg-x11-drv-nvidia-devel

After that everything should work properly. Now that I’ve got that sorted I can rant.

[RANT]

The cuda website should have a wiki or at least a decent readme file on how to install Toolkit, SDK and the driver (both official driver and using package managers). I can’t believe I wasted a whole week trying to install this driver because the instructions for installing the tool kit and sdk do not include how to setup and configure the driver. I think there should be instructions for each particular linux distro. I’m sure there is a guy at NVIDIA that could go though the installation for each distro and then put together a list of instructions on it. It would be best if they had this on a wiki so that users (such as myself) could add corrections to said instruction when they came across them!

[/RANT]

So there isn’t any livna bug in this case.

The xorg-x11-drv-nvidia and xorg-x11-drv-nvidia-devel provide the libcuda.so and the related header in respectively in %{_libdir}/nvidia. and %{_includedir}/nvidia. So you need to add theses directory in the appropriate flags.

Now, what could be improved here is pkg-config support. If nVidia can provide something like a nVidia-libGL.pc or else. Any project could find the nVidia libraries and headers for the non-replacement location. (and the Nvidia installer location if used).

I could understand that nVidia answer that “this is not our problem”. This indeed, in a problem for distribution to check the general coherence between each projects. We (at rpm.livna.org) follow the same guidelines as the fedoraproject.org; thus, we forbid replacement of officials packages (mesa-libGL in this case).

Note: A known problem with using an alternative location remains that some project define rpath while linking with system-wide libraries (or with scripts). This make the project to use and hardcoded location for the libGL. This is forbidden by the fedoraproject packaging guideline (probably others), and rpath must be avoided (most of the time).

(see chrpath and/or tweak launch scripts).

Note2: Installing the nVidia driver from livna is done from theses steps:

  • (optionnal) but would be better: run into init 3

  • Install livna-release that fit to the fedora version

  • Install kmod-nvidia or kmod-nvidia-96xx or kmod-nvidia-legacy (will be renamed 71xx) with yum (it will bring all dependencies)

  • On x86_64 system, you may need the xorg-x11-drv-nvidia-libs.i386 fro x86 apps.

  • REBOOT! (this is not for fun, you have to reboot to: first, boot on the last kernel that has nvidia.ko installed by the kmod; second, unload the mesa libGL that may remains loaded into memory to use the nVidia libGL)

  • Keep your hands off from xorg.conf (this one is really hard) - livna-config-display will tweak it for you, so it can work “out of the box” with compiz for example.

Thanks for your input on this Nicolas (I’m guessing you’re the same person why responded to my bug request at livna?). I see you’ve posted your commit at the exact same time as me. External Image Please look over my comments and add corrections as necessary. I think you’ve added a few extra steps in yours, which I did not. If I had time I’d start from scratch to see what works and what doesn’t, but I really need to get back to my programming!

OK, so I stand corrected. For the record, I’ve never built a system with an rpm based linux distribution, so I wouldn’t know. I run gentoo, where libraries and headers are always installed. But, being an experienced linux user, I would never have thought to look to install several seperate packages just to get all the NVIDIA drivers installed.

About most users “not needing” cuda: that may be true at this time. But, by the same token it is my opinion that if I were to install a driver for a card that I would be able to use all features of that card without having to install several other non-obvious driver related packages. But then this is just the difference in philosophy between gentoo/rpm distributuions, so I am not starting an argument.

I agree with Craig_Moore that the problem here is documentation. Even just mentioning the installation of the multiple livna packages in the CUDA FAQ on the forums would go a long way toward helping the situation.

Indeed, that’s different philosophies. So FYI; fedora, as most pre-built distributions (including debian based one’s) are splitting files suitable as runtime from those suitable for development (-devel in rpms; -dev in debs). In the livna case, all files for driver use (including cuda support) are in xorg-x11-drv-nvidia. Users that don’t want the compat 32bit libraries on x86_64 are allowed not to have it installed.

For the reason why the -devel part isn’t mentioned. Most of advanced users prefers to use yumex. yumex show the -devel packages when nvidia in searched.