7

Because the steam client for linux has 32-bit binaries only, I want to install libnvidia-gl:i386 on my 64-bit Ubuntu OS.

However, if I do this, the package manager wants to un-install cuda-11. However, I need cuda-11.

How can I have 64-bit and 32-bit versions of libnvidia-gl coexist without interfering with cuda?

$ sudo apt install libnvidia-gl-455:i386
...
The following additional packages will be installed:
  libnvidia-common-455 libnvidia-compute-455 libnvidia-decode-455 libnvidia-encode-455 libnvidia-fbc1-455
The following packages will be REMOVED:
  cuda-11-1 cuda-demo-suite-11-1 cuda-drivers cuda-drivers-455 cuda-runtime-11-1 libnvidia-gl-455 libnvidia-ifr1-455 nvidia-driver-455
The following NEW packages will be installed:
  libnvidia-gl-455:i386
The following packages will be upgraded:
  libnvidia-common-455 libnvidia-compute-455 libnvidia-decode-455 libnvidia-encode-455 libnvidia-fbc1-455
5 upgraded, 1 newly installed, 8 to remove and 34 not upgraded.
Need to get 42.2 MB of archives.
After this operation, 195 MB disk space will be freed.
Do you want to continue? [Y/n] 

3 Answers 3

4

Update Feb 2023: Nvidia has resumed supplying CUDA with 32bit libraries. It should just be a cause of using their repositories.

Steam and the majority of games on Linux rely on 32-bit OpenGL libraries being available. However, Nvidia planned to drop 32-bit support for CUDA for some time now. Luckily, the necessary 32-bit libraries can be manually installed to make Steam work.

I suggest you install both CUDA and the 64bit driver from the Nvidia repository first, then check what version of driver has been installed. Obviously, the 32-bit library files have to match the installed driver version. The appropriate files can be obtained by using the extract only option provided by the installer e.g. for 465.19.01 get the driver and do ./NVIDIA-Linux-x86_64-465.19.01.run -x

The i386 library files are in a folder named "32". To install the 32-bit library manually:

chmod u+x NVIDIA-Linux-x86_64-465.19.01.run
./NVIDIA-Linux-x86_64-465.19.01.run -x
cd NVIDIA-Linux-x86_64-465.19.01
cd 32
sudo cp libEGL* libGLESv* libGLX* libnvidia-egl* libnvidia-gl* libnvidia-tls* /usr/lib32

There are some symlinks that should be created (update version numbers as appropriate) (this step might not be necessary?):

cd /usr/lib32
sudo ln -s libEGL_nvidia.so.465.19.01 libEGL_nvidia.so.0
sudo ln -s libGLESv1_CM_nvidia.so.465.19.01 libGLESv1_CM_nvidia.so.1
sudo ln -s libGLESv2_nvidia.so.465.19.01 libGLESv2_nvidia.so.2
sudo ln -s libGLX_nvidia.so.465.19.01 libGLX_indirect.so.0
sudo ln -s libGLX_nvidia.so.465.19.01 libGLX_nvidia.so.0

If your /usr/lib32 is not checked for libraries, create the file /etc/ld.so.conf.d/nvidia32.conf with the content:

/usr/lib32

You will probably need to run this for the system to detect the new libraries:

sudo ldconfig
3
  • 2
    I've spent years trying to get Steam to work at the same time that the CUDA drivers are installed, and this is the only solution that has ever worked for me. One more thing to note is that the 32-bit libraries you install must be the exact same version as the CUDA driver; when it updates, you can find the specific version you need by searching here: nvidia.com/Download/Find.aspx?lang=en-us
    – Minneyar
    Jun 6, 2021 at 15:07
  • 1
    This is the only method that worked on Ubuntu 20.04 + CUDA 11. Thanks so much!! Jul 30, 2021 at 4:13
  • Confirm, this works like a charm! (I'm using 495.25 driver) In my case it was not necessary to create symlinks, ldconfig did it for me.
    – 18augst
    Jan 5, 2022 at 1:03
1

Here is a thread on steam's github page about this exact problem. There are some solutions/workarounds there, but I didn't have time to check them all (or didn't like workarounds that break package manager) and simply gave up on that for now. Right now I have v460 driver with additional :i386 libs (I added foreign architecture before) and removed CUDA for now.

The cleanest way in my opinion is to run a Rapids docker container with CUDA environment. This on the other hand forces you to learn docker, configure your new docker environment and may introduce some other docker related problems, but at least it's the one solution that keeps it all clean and separate from your raw system. In the github reply to this issue there is a further explanation on how to do it. If you don't really mind this setup, then It may be your way to go.

In my case there was also a problem with installing additional :i386 libs (they disabled the driver and removed :amd64 packages) because of some drivers and cuda repository conflict. I also had to purge nvidia with cuda completely, remove the cuda repository from /etc/apt/sources.list and install nvidia driver again (now with libnvidia-gl-460:i386). If you have problems you can always check status of your libs and drivers with:

apt-cache policy nvidia-driver-460 libnvidia-gl-460 libnvidia-gl-460:i386
3
  • Unfortunately, just linking to another article or thread is not a sufficient answer. Feb 21, 2021 at 16:03
  • Yeah, sorry about that. Can't comment on 1 reputation :/
    – Tooster
    Feb 21, 2021 at 16:15
  • The common solution is to paraphrase the solution described in the link.
    – Haem
    Feb 21, 2021 at 16:51
1

If you use the Nvidia drivers from the standard (proprietary/restricted) repos., they come with the 64 and 32 bit versions, and all the "glue" code to rebuild the Nvidia module when updates install a new kernel. steam is also offered in the standard repos, and there is no problem with "missing" librarlies when Nvidia drivers and steam are installed.

cuda should be thought of as just an application, with some strange, unnecessary package dependencies, like the Nvidia driver. While cuda is also offered in the standard repos, many times, you want/need a specific version of cuda (hardware limitations, etc.). If you use the Nvidia supplied installation methods for such an older/newer version, avoid the deb file with its unwanted dependencies on some random Nvidia driver, and use the .run file. No unwanted dependencies are introduced with the run file, you should skip any Nvidia driver offer, and may select a non-system installation location (so you may install multiple CUDA versions in different locations).

Specific installation instructions are offered in other answers on this site See:

How do I install NVIDIA and CUDA drivers into Ubuntu?

CUDA 10.2 - different installation paths

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .