-
-
Save zas/205372c824decb8e121baec2f86e1415 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
cd | |
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/sklgucver61.tar.bz2 && \ | |
tar xvjf sklgucver61.tar.bz2 && cd skl_guc_ver6_1/ && sudo ./install.sh | |
cd | |
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kbldmcver101.tar.bz2 && \ | |
tar xjvf kbldmcver101.tar.bz2 && cd kbl_dmc_ver1_01/ && sudo ./install.sh | |
cd | |
sudo update-initramfs -u -k all |
@UrbanVampire, about the architecture detection we could try something simple like this:
if [[ $(lscpu | grep -i x86_64 | wc -l) -eq 1 ]]; then
# This architecture is 64 bit
else
# This architecture is 32 bit
fi
I was pretty sure that I could get this kind information from the file /proc/cpuinfo
also but I could not find any relevant and precise values that we could use to detect the architecture better. I've also looked at some other files in /proc
but could not anything else that could do the job so maybe lscpu
is the simplest way.
I can try to run strace lscpu
and see if it query some files that we could use instead of calling lscpu
directly.
Ok I've tried with strace lscpu 2>&1 | grep -vi "No such" | grep -i "openat"
and the file /proc/cpuinfo
is used but also many other ones:
$ strace lscpu 2>&1 | grep -vi "No such" | grep -i "openat"
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libsmartcols.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/kernel_max", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/possible", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/present", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/topology/thread_siblings", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/topology/core_siblings", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/topology/core_id", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/topology/physical_package_id", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index0/type", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index0/level", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index0/size", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index0/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index1/type", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index1/level", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index1/size", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index2/type", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index2/level", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index2/size", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index2/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index3/type", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index3/level", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index3/size", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq", O_RDONLY|O_CLOEXEC) = 3
... (removed to reduce redondant lines due to multi cores)
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/topology/thread_siblings", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/topology/core_siblings", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/topology/core_id", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/topology/physical_package_id", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cache/index0/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cache/index1/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cache/index2/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cache/index3/shared_cpu_map", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cpufreq/cpuinfo_max_freq", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/cpu/cpu7/cpufreq/cpuinfo_min_freq", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/sys/devices/system/node", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/share/locale-langpack/fr/LC_MESSAGES/util-linux.mo", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 4
openat(AT_FDCWD, "/sys/devices/system/node/node0/cpumap", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/sys/kernel/osrelease", O_RDONLY) = 3
openat(AT_FDCWD, "/sys/firmware/dmi/tables/DMI", O_RDONLY) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/proc/bus/pci/devices", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/bus/pci/devices", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/bus/pci/devices", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/self/status", O_RDONLY) = 3
Yes, I'm having a cpu with 8 cores, that's why the list of open files goes from
0
to7
π
@Jiab77, Sorry for late answer, it was a hard week on work.
No, you did it
Oh, c'mon, it was you who found nvidia workaround. Not to mention that I wouldn't even start working without your original script.
I got both on my system for example but the lib64 folder is almost empty and just contains a symlink to a file stored in /lib sweat_smile but I'm using an Ubuntu based Linux distrib so maybe it can be different on original Ubuntu or any other Linux distribs.
AFAIK, the "firmware" folder is placed in "/lib" on both 32 and 64 systems. But after recent patches "/lib" is moved to "/usr/lib" on some systems. So, maybe it's better to extract destination path from original "Possible missing hardware" message.
maybe lscpu is the simplest way.
I think the arch
command is the simplest way. But there's other thing: latest 32-bit drivers on nvidia site is 390.143. I'm not really sure what FW version is needed for 32-bit kernels. Anyway we need some experiments to understand:
- Are the firmware files the same in 32 and 64 nvidia driver versions?
- Will 64-bit nvidia 'run' script unpack files on a 32-bit system?
- Can nvidia 'run' script be unpacked with a regular untar?
I'm also wondering if we should move to case / esac instead of multiplying if
Now we have only 2 options, nvidia and NOT nvidia,, but i'll think about it.
ask you to make a new project on github
I have zero experience with github but i'll try :)
@Jiab77
https://github.com/UrbanVampire/missing-firmware-fix
Just fixed false "Already installed" for now.
1. Are the firmware files the same in 32 and 64 nvidia driver versions? 2. Will 64-bit nvidia 'run' script unpack files on a 32-bit system? 3. Can nvidia 'run' script be unpacked with a regular untar?
Well, answer to "2" and "3" is "no". At least I haven't found a way to extract files from the installer using standard archivers. And the 64-bit installer uses 64-bit binary stub, so it won't run on a 32-bit systems. It means that "1" is doesn't matter cos' we cannot use 64 installer on 32 system.
The rest is easy: just download installer from "Linux-x86" or "Linux-x86_64" folder of nVidia site according to system architecture.
The code is updated.
I think for now my job is done here.
BTW, don't You wanna add German of French README translation? Sorry, don't know what Your native language is.
@Jiab77, Sorry for late answer, it was a hard week on work.
@UrbanVampire, No worries, it's pretty same on my side, I'm also overloaded of work... that's why I'm replying you just now π
Oh, c'mon, it was you who found nvidia workaround. Not to mention that I wouldn't even start working without your original script.
Well, it was pretty simple to be honest but do the job to automate the whole process as you did is not the same at all!
AFAIK, the "firmware" folder is placed in "/lib" on both 32 and 64 systems. But after recent patches "/lib" is moved to "/usr/lib" on some systems. So, maybe it's better to extract destination path from original "Possible missing hardware" message.
Yes you're right and I saw in the code that you managed it very well. π€
I think the
arch
command is the simplest way. But there's other thing: latest 32-bit drivers on nvidia site is 390.143. I'm not really sure what FW version is needed for 32-bit kernels. Anyway we need some experiments to understand:
Thanks a lot for that, I was not aware about the arch
command and it's much better than parsing lscpu
output π
I have zero experience with github but i'll try :)
You did it very well for the less I could see π I've stared the project already and added on my watch list π
I think for now my job is done here.
BTW, don't You wanna add German of French README translation? Sorry, don't know what Your native language is.
Well, I'm a native French speaker but I'm not really sure that would be useful to translate it in French honestly as many French native speakers that work in the computer domain knows reading English already and if they don't then they should learn it, it will give them a much wider source of knowledge π
BTW, let's keep in touch somewhere else, what do you think? write me an email if interested π
Thanks a lot guys. Great script!!!
Thank you Gentlemen.....excellent
@UrbanVampire, as you mainly did the whole magic, I was wondering to first, ask you to make a new project on github and host the code of this script for better maintenance and probably access, to others willing to improve it. what do you think about that?
Here is a slightly modified version just to keep track of everything you've added in the script:
I'm also wondering if we should move to
case
/esac
instead of multiplyingif [[ "$FWFileName" == *"firmware"* ]]; then
to manage many other missing firmware as you did for nVidia, like for your missing rtl* firmware files?This way we could manage several missing ones like that:
I don't have your
bash
scripting skills so I'm not really sure that is possible anyway πoh, and for someone that claims to be a Linux beginner, you're just impressive! I'm feeling like knowing nothing π