When installing the CUDA developement package then when you like to run the Steam to play some games most likely you will see steam updating itself and the windows close.
When you will run steam from the terminal you will notice this errors
SteamUpdateUI: An X Error occurred
If you need CUDA and STEAM there is solution the issue if with the OpenGL 32bit library
- Download CUDA installation file (file is 4Gb so look for the space)
wget wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run
- Add executable attribute to downloaded file
chmod a+x cuda_11.4.2_470.57.02_linux.run
- Remove all the nvidia from the system
sudo apt-get purge nvidia*
- Then we need to install base mesa drivers with the OpenGL
sudo apt-get install --reinstall xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
- Now we need to reconfigure the X server
sudo dpkg-reconfigure xserver-xorg
- Now to reboot system and when starting of Ubuntu please select “Advanced options for Ubuntu”
- with next window please choose latest version of kernel with additional label “(recovery mode)”
- when the dialog will show then please choose “Drop to root shell prompt”
- now we need to run the CUDA installation by executing downloaded files (yes we need to installed when the X server is not in use otherwise the drivers will be not installed)
./cuda_11.4.2_470.57.02_linux.run
first screen after long waiting is licence and we need to type “accept”
- Next screen is what elements will be installed we not changing on selections and move to “Options”
- When in option we need to choose “Driver Options”
- On this screen we need to select “Do not install any of the OpenGL-related driver files”
- After the selection we need to go back to the install screen by selecting “Done”
- Once we in the first screen please select “Install” and wait for it to finish.
- When the CUDA install process will finish then please type “reboot” in terminal. after reboot finish you should be able to open steam and play games