Skip to content

Instantly share code, notes, and snippets.

@TimSC
Created November 3, 2021 02:53
Show Gist options
  • Save TimSC/ef924b1c4df1245aedab14d42598b72d to your computer and use it in GitHub Desktop.
Save TimSC/ef924b1c4df1245aedab14d42598b72d to your computer and use it in GitHub Desktop.
Install 32 bit nvidia gl driver
# https://askubuntu.com/a/1337205/294281
import os
import stat
import glob
from pathlib import Path
import shutil
if __name__=="__main__":
ver = "495.29.05"
pth = "/home/tim/Downloads/NVIDIA-Linux-x86_64-{}.run".format(ver)
f = Path(pth)
f.chmod(f.stat().st_mode | stat.S_IEXEC)
os.system(pth+" -x")
pth2 = "./NVIDIA-Linux-x86_64-{}/32".format(ver)
fiPatterns = ["libEGL*", "libGLESv*", "libGLX*", "libnvidia-egl*", "libnvidia-gl*","libnvidia-tls*"]
for fiPattern in fiPatterns:
for file in glob.glob(pth2+"/"+fiPattern):
print(file)
shutil.copy(file, "/usr/lib32")
os.chdir('/usr/lib32')
os.symlink("libEGL_nvidia.so.{}".format(ver), "libEGL_nvidia.so.0")
os.symlink("libGLESv1_CM_nvidia.so.{}".format(ver), "libGLESv1_CM_nvidia.so.1")
os.symlink("libGLESv2_nvidia.so.{}".format(ver), "libGLESv2_nvidia.so.2")
os.symlink("libGLX_nvidia.so.{}".format(ver), "libGLX_indirect.so.0")
os.symlink("libGLX_nvidia.so.{}".format(ver), "libGLX_nvidia.so.0")
os.system("ldconfig")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment