Hi,
I have run the following commands to install GPU driver and CUDA:
sudo apt install nvidia-driver-440 sudo apt install nvidia-utils-440
Those upper commands have been executed successfully on wsl2.
If I then execute nvidia-smi, I got the following error message:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
I then run the following commands:
sudo dkms install -m nvidia -v 440.100
I got the following error messages:
Error! Your kernel headers for kernel 4.4.0-19041-Microsoft cannot be found. Please install the linux-headers-4.4.0-19041-Microsoft package, or use the --kernelsourcedir option to tell DKMS where it's located
Thanks,
Ardeal
ardeal
changed the title
Could I install GPU driver on WSL2?
Error! Your kernel headers for kernel 4.4.0-19041-Microsoft cannot be found
Jul 7, 2020
That kernel version indicates that you are using WSL1.
@DHowett ,
Thanks!
how to check I am using wsl1 or wsl2?
wsl -l -v
on windows and check the version column. 2 is WSL 2
NAME STATE VERSION
* Ubuntu-20.04 Stopped 2
@DHowett ,
Thanks!
I checked the version as follows:
wsl -l -v NAME STATE VERSION * Ubuntu-20.04 Running 1
I did install the update of WSL2 according to the page:
https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel
and set WSL 2 as default version:
wsl —set-default-version 2
wsl --set-default-version 2 For information on key differences with WSL 2 please visit https://aka.ms/wsl2
why is the version still 1 but not 2?
how could I change the version from 1 to 2?
Thanks,
wsl --set-version <distribution name> <versionNumber>
is the command to convert it wsl 2. So in your case, it’s
wsl --set-version Ubuntu-20.04 2
You installed distro before —set-default-version, that’s why it’s 1
@licanhua ,
Thanks!
I am also considering the issue you mentioned:
You installed distro before —set-default-version, that’s why it’s 1
now, I have already done that. If I run the command:
wsl —set-version Ubuntu-20.04 2
The ubuntu I have already installed will be migrate to wsl 2, right?
now, I have run the command wsl —set-default-version 2.
should I uninstall the old distro and reinstall ubuntu when the default version is 2?
Thanks,
NO, you don’t need to uninstall it.
wsl --set-version Ubuntu-20.04 2
convert the distro to WSL 2, this the command helps user to migrate distro from 1 to 2.
Thanks,
wsl --set-version Ubuntu-20.04 2 Conversion in progress, this may take a few minutes... For information on key differences with WSL 2 please visit https://aka.ms/wsl2 Conversion complete.
wsl -l -v NAME STATE VERSION * Ubuntu-20.04 Stopped 2
now I run command:
dkms install -m nvidia -v 440.100 Error! Your kernel headers for kernel 4.19.104-microsoft-standard cannot be found. Please install the linux-headers-4.19.104-microsoft-standard package, or use the --kernelsourcedir option to tell DKMS where it's located
I am still experiencing the issue.
4.4.0-19041
You are on 19041 (whether WSL1 or WSL2) and that version does not support NVIDIA CUDA. The Insiders prerelease of GPGPU support in WSL2 became available in 20150. Announcement with more links on that here. Even more here and here. Academically the headers error is #2363 et al. TL;DR the kernel-mode support is already baked into the WSL2 4.19.121 kernel so there is no nvidia module to install.
@therealkenc ,
Thanks!
should I uninstall the current versio(19041)n and re-install the version(20150)?
how to uninstall it? Is there any link about the method?
Thanks,
Landing page for Windows insiders is here. Instructions here. The insider blog is here. There is nothing to uninstall; it is a Windows update. Make sure to set «Windows Update» -> «Advanced Options» -> «Receive updates for other Microsoft Products» to ON which is a common gotcha.
@therealkenc ,
Thanks!
According to you instructions, I am going to install the insider preview version of the latest Window 10.
Does this mean that wsl 2 on the latest public release of Windows 10 does not support GPU /CUDA, only wsl 2 on 20150 preview version supports GPU/CUDA?
Thanks,
Thanks,
only the 20150 preview version support GPU/CUDA?
Yes. 20150 or better. CUDA is available only in the Dev Channel (formerly Fast Ring) as of this writing.
- Печать
Страницы: [1] 2 Все Вниз
Тема: проблема с заголовочниками ядра (Прочитано 2933 раз)
0 Пользователей и 1 Гость просматривают эту тему.
rampagety
Друзья, помогите решить проблему с заголовочниками ядра.
Руководствуясь данной статьей (https://askubuntu.com/questions/1007792/install-mercusys-wifi-adapter-in-ubuntu), устанавливал драйвера для вай фай адаптера. Выдает ошибку (Error! Your kernel headers for kernel 4.13.0-45-generic cannot be found.
Please install the linux-headers-4.13.0-45-generic package,
or use the —kernelsourcedir option to tell DKMS where it’s located)
Скачал данный драйвер для установки, но почему то не устанавливается, уже много разных источников перепробовал, на всех драйверах такой результат:
пишу: sudo apt install linux-headers-4.13.0-45-generic_4.13.0-45.50_16.04.1_i386.deb
выдаёт:
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package linux-headers-4.13.0-45-generic_4.13.0-45.50_16.04.1_i386.deb
E: Couldn’t find any package by glob ‘linux-headers-4.13.0-45-generic_4.13.0-45.50_16.04.1_i386.deb’
E: Couldn’t find any package by regex ‘linux-headers-4.13.0-45-generic_4.13.0-45.50_16.04.1_i386.deb’
P.S. началось с этой темы: https://forum.ubuntu.ru/index.php?topic=302579.0
P.S.S в системе соображаю слабо, поэтому прошу не ругать если я туплю
Heider
Не может найти пакет в репах. У меня тоже недавно были проблемы с русским зеркалом. Указал в sources.list немецкое и теперь все нормально.
rampagety
Не может найти пакет в репах. У меня тоже недавно были проблемы с русским зеркалом. Указал в sources.list немецкое и теперь все нормально.
А можно поподробнее, что сделать надо?)
Dzhoser
Heider
Читайте этот раздел справочного руководства.
Если же хотите, чтобы мы все сделали за Вас, то для начала покажите нам свой сорселист:
cat /etc/apt/sources.list
под спойлер.
А то ведь, может быть, проблема не в этом. Это я так, просто пытался угадать.
rampagety
Heider
эта прога пишет что у меня запущен 4.13.0.45.50, вроде как этот и нужен
Ну так проверьте:
apt show linux-headers-4.13.0-45-generic
и нам покажите
rampagety
эта прога пишет что у меня запущен 4.13.0.45.50, вроде как этот и нужен
Ну так проверьте:
apt show linux-headers-4.13.0-45-generic
и нам покажите
Package: linux-headers-4.13.0-45-generic
State: not a real package (virtual)
N: Can’t select candidate version from package linux-headers-4.13.0-45-generic as it has no candidate
N: Can’t select versions from package ‘linux-headers-4.13.0-45-generic’ as it is purely virtual
N: No packages found
Пользователь добавил сообщение 06 Января 2019, 17:03:16:
Читайте этот раздел справочного руководства.
Если же хотите, чтобы мы все сделали за Вас, то для начала покажите нам свой сорселист:
cat /etc/apt/sources.list
под спойлер.А то ведь, может быть, проблема не в этом. Это я так, просто пытался угадать.
Не стесняйтесь пользоваться форматированием. Пока поправил.
С уважением, Morisson
« Последнее редактирование: 07 Января 2019, 11:51:30 от Morisson »
Heider
N: No packages found
значит, я угадал. Нет этого пакета в русских зеркалах. У меня стоит корневое зеркало (без «ru» вначале доменного имени), мой apt этот пакет находит. Либо меняйте версию ядра, либо меняйте зеркало репозитория. Попробуйте, кстати, со старым ядром загрузиться. Возможно, для Вас это будет самым простым вариантом.
И поставьте dkms:
sudo apt install dkms
, тогда драйвер будет пересобираться автоматически при обновлении ядра.
rampagety
N: No packages found
значит, я угадал. Нет этого пакета в русских зеркалах. У меня стоит корневое зеркало (без «ru» вначале доменного имени), мой apt этот пакет находит. Либо меняйте версию ядра, либо меняйте зеркало репозитория. Попробуйте, кстати, со старым ядром загрузиться. Возможно, для Вас это будет самым простым вариантом.
И поставьте dkms:
sudo apt install dkms
, тогда драйвер будет пересобираться автоматически при обновлении ядра.
на зеркалах «ру» везде удалил, не работает, или туда вместо ру нужно что-то другое написать?
а с ядром не получается тоже манипуляция почему-то, скачал предыдущее, граб обновил, а когда ребут делаю, все равно ничего нового не появляется, и граб.кфг тоже менял
Heider
а с ядром не получается тоже манипуляция почему-то, скачал предыдущее, граб обновил, а когда ребут делаю, все равно ничего нового не появляется
Не нужно было устанавливать старое ядро. У Вас и так в системе есть старые ядра, старые ядра без команды не удаляются. Нужно было просто в грубе выбрать старое ядро. Там пункт меню называется как-то вроде: «Особые параметры Ubuntu», уже не помню точно, тогда открывается меню со списком всех ядер, выбрать постарше и попробовать.
Пользователь добавил сообщение 06 Января 2019, 19:22:11:
С новыми зеркалами поищите эти заголовки
apt show linux-headers-4.13.0-45-generic
« Последнее редактирование: 06 Января 2019, 19:22:11 от Heider »
rampagety
а с ядром не получается тоже манипуляция почему-то, скачал предыдущее, граб обновил, а когда ребут делаю, все равно ничего нового не появляется
Не нужно было устанавливать старое ядро. У Вас и так в системе есть старые ядра, старые ядра без команды не удаляются. Нужно было просто в грубе выбрать старое ядро. Там пункт меню называется как-то вроде: «Особые параметры Ubuntu», уже не помню точно, тогда открывается меню со списком всех ядер, выбрать постарше и попробовать.
Пользователь добавил сообщение 06 Января 2019, 19:22:11:
С новыми зеркалами поищите эти заголовки
apt show linux-headers-4.13.0-45-generic
а так я тоже пробовал, на каждом старом при выборе пишет что ядро не найдено нужно сначала его загрузить
С новыми зеркалами поищите эти заголовки
apt show linux-headers-4.13.0-45-generic
« Последнее редактирование: 07 Января 2019, 11:52:27 от Morisson »
Heider
Странно… У меня этот пакет показывает. Какая у Вас версия Ubuntu?
lsb_release -a
И ядра покажите, какие у Вас установлены:
ls /boot/vmlinuz*
может, Вы заголовки не от своего ядра лепите.
Пользователь добавил сообщение 06 Января 2019, 19:51:23:
Только выхлоп под спойлер прячьте, а то модеры не любят много текста.
rampagety
Странно… У меня этот пакет показывает. Какая у Вас версия Ubuntu?
lsb_release -a
И ядра покажите, какие у Вас установлены:ls /boot/vmlinuz*
может, Вы заголовки не от своего ядра лепите.
Пользователь добавил сообщение 06 Января 2019, 19:51:23:
Только выхлоп под спойлер прячьте, а то модеры не любят много текста.
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic&
/boot/vmlinuz-4.12.0-041200-generic
/boot/vmlinuz-4.12.14-041214-generic
/boot/vmlinuz-4.13.0-45-generic
/boot/vmlinuz-4.13.0-45-generic.efi.signed
/boot/vmlinuz-4.15.0-42-generic
/boot/vmlinuz-4.15.0-43-generic
« Последнее редактирование: 07 Января 2019, 11:52:45 от Morisson »
Heider
/boot/vmlinuz-4.15.0-43-generic
Версия заголовков должна соответсвовать версии ядра. Для вас подойдут заголовки:
sudo apt install linux-headers-4.15.0-43-generic
- Печать
Страницы: [1] 2 Все Вверх
Skip to content
Getting the following error may be deceiving:
Error! echo Your kernel headers for kernel 3.10.0-1062.1.1.el7.x86_64 cannot be found at /lib/modules/3.10.0-1062.1.1.el7.x86_64/build or /lib/modules/3.10.0-1062.1.1.el7.x86_64/source.
Because you may have already installed the kernel-headers package for the current kernel and still to get the same error. So what is missing?
In fact, the kernel headers for compiling a kernel module is in kernel-devel package.
[root@localhost ~]# yum install kernel-devel Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.wwfx.net * extras: mirror.wwfx.net * updates: mirror.wwfx.net Resolving Dependencies --> Running transaction check ---> Package kernel-devel.x86_64 0:3.10.0-1062.1.1.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================================================================================================ Package Arch Version Repository Size ============================================================================================================================================================================ Installing: kernel-devel x86_64 3.10.0-1062.1.1.el7 updates 18 M Transaction Summary ============================================================================================================================================================================ Install 1 Package Total download size: 18 M Installed size: 38 M Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. kernel-devel-3.10.0-1062.1.1.el7.x86_64.rpm | 18 MB 00:00:02 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : kernel-devel-3.10.0-1062.1.1.el7.x86_64 1/1 Verifying : kernel-devel-3.10.0-1062.1.1.el7.x86_64 1/1 Installed: kernel-devel.x86_64 0:3.10.0-1062.1.1.el7 Complete!
If you have used other Linux distribution the “kernel headers”/”linux headers” package just means what it is named. In the CentOS 7 world there are two packages:
[root@localhost ~]# yum info kernel-devel Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.wwfx.net * extras: mirror.wwfx.net * updates: mirror.wwfx.net Installed Packages Name : kernel-devel Arch : x86_64 Version : 3.10.0 Release : 1062.1.1.el7 Size : 38 M Repo : installed From repo : updates Summary : Development package for building kernel modules to match the kernel URL : http://www.kernel.org/ License : GPLv2 Description : This package provides kernel headers and makefiles sufficient to build modules : against the kernel package. [root@localhost ~]# yum info kernel-headers Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.wwfx.net * epel: mirrors.neterra.net * extras: mirror.wwfx.net * updates: mirror.wwfx.net Installed Packages Name : kernel-headers Arch : x86_64 Version : 3.10.0 Release : 1062.1.1.el7 Size : 3.7 M Repo : installed From repo : updates Summary : Header files for the Linux kernel for use by glibc URL : http://www.kernel.org/ License : GPLv2 Description : Kernel-headers includes the C header files that specify the interface : between the Linux kernel and userspace libraries and programs. The : header files define structures and constants that are needed for : building most standard programs and are also needed for rebuilding the : glibc package.
Seems this might be related to installing zed:
Code:
Start-Date: 2019-06-24 15:44:16
Commandline: apt install zfs-zed
Install: libmpc3:amd64 (1.0.3-1+b2, automatic), libmpx2:amd64 (6.3.0-18+deb9u1, automatic), linux-headers-4.9.0-9-common:amd64 (4.9.168-1+deb9u3, automatic), libmpfr4:amd64 (3.1.5-1, automatic), libfakeroot:amd64 (1.21-3.1, automatic), cpp-6:amd64 (6.3.0-18+deb9u1, automatic), binutils:amd64 (2.28-5, automatic), cpp:amd64 (4:6.3.0-4, automatic), libitm1:amd64 (6.3.0-18+deb9u1, automatic), sudo:amd64 (1.8.19p1-2.1, automatic), gcc:amd64 (4:6.3.0-4, automatic), libcilkrts5:amd64 (6.3.0-18+deb9u1, automatic), libasan3:amd64 (6.3.0-18+deb9u1, automatic), zfs-zed:amd64 (0.6.5.9-5), linux-compiler-gcc-6-x86:amd64 (4.9.168-1+deb9u3, automatic), dkms:amd64 (2.3-2, automatic), libisl15:amd64 (0.18-1, automatic), libtsan0:amd64 (6.3.0-18+deb9u1, automatic), libgcc-6-dev:amd64 (6.3.0-18+deb9u1, automatic), libubsan0:amd64 (6.3.0-18+deb9u1, automatic), make:amd64 (4.1-9.1, automatic), fakeroot:amd64 (1.21-3.1, automatic), gcc-6:amd64 (6.3.0-18+deb9u1, automatic), distro-info-data:amd64 (0.36, automatic), linux-headers-amd64:amd64 (4.9+80+deb9u7, automatic), linux-kbuild-4.9:amd64 (4.9.168-1+deb9u3, automatic), liblsan0:amd64 (6.3.0-18+deb9u1, automatic), libgomp1:amd64 (6.3.0-18+deb9u1, automatic), linux-headers-4.9.0-9-amd64:amd64 (4.9.168-1+deb9u3, automatic), spl-dkms:amd64 (0.6.5.9-1, automatic), lsb-release:amd64 (9.20161125, automatic), libatomic1:amd64 (6.3.0-18+deb9u1, automatic), libcc1-0:amd64 (6.3.0-18+deb9u1, automatic), zfs-dkms:amd64 (0.6.5.9-5, automatic)
End-Date: 2019-06-24 15:48:00
On my older systems, I have zed installed but no such dependencies were installed.
Code:
:~# dpkg --get-selections | grep -i spl
spl install
:~# dpkg --get-selections | grep -i zfs
libzfs2linux install
zfs-initramfs install
zfs-zed install
zfsutils-linux install
Anyhow, here is what I did to remove them:
«
# apt remove —purge zfs-dkms spl-dkms
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
dkms fakeroot gcc gcc-6 libasan3 libatomic1 libcc1-0 libcilkrts5 libfakeroot libgcc-6-dev libgomp1 libitm1 liblsan0 libmpx2 libtsan0 libubsan0
linux-compiler-gcc-6-x86 linux-headers-4.9.0-9-amd64 linux-headers-4.9.0-9-common linux-headers-amd64 linux-kbuild-4.9 sudo
Use ‘apt autoremove’ to remove them.
The following packages will be REMOVED:
spl-dkms* zfs-dkms*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 11.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 64506 files and directories currently installed.)
Removing zfs-dkms (0.6.5.9-5) …
——— Uninstall Beginning ———
Module: zfs
Version: 0.6.5.9
Kernel: 4.9.0-9-amd64 (x86_64)
————————————-
Status: Before uninstall, this module version was ACTIVE on this kernel.
zavl.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
zcommon.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
znvpair.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
zpios.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
zunicode.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
zfs.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
depmod…
Warning: Unable to find an initial ram disk that I know how to handle.
Will not try to make an initrd.
DKMS: uninstall completed.
——————————
Deleting module version: 0.6.5.9
completely from the DKMS tree.
——————————
Done.
Removing spl-dkms (0.6.5.9-1) …
——— Uninstall Beginning ———
Module: spl
Version: 0.6.5.9
Kernel: 4.9.0-9-amd64 (x86_64)
————————————-
Status: Before uninstall, this module version was ACTIVE on this kernel.
spl.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
splat.ko:
— Uninstallation
— Deleting from: /lib/modules/4.9.0-9-amd64/updates/dkms/
— Original module
— No original module was found for this module on this kernel.
— Use the dkms install command to reinstall any previous module version.
depmod…
DKMS: uninstall completed.
——————————
Deleting module version: 0.6.5.9
completely from the DKMS tree.
——————————
Done.
(Reading database … 63819 files and directories currently installed.)
Purging configuration files for zfs-dkms (0.6.5.9-5) …
root@p25:~# apt autoremove
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
dkms fakeroot gcc gcc-6 libasan3 libatomic1 libcc1-0 libcilkrts5 libfakeroot libgcc-6-dev libgomp1 libitm1 liblsan0 libmpx2 libtsan0 libubsan0
linux-compiler-gcc-6-x86 linux-headers-4.9.0-9-amd64 linux-headers-4.9.0-9-common linux-headers-amd64 linux-kbuild-4.9 sudo
0 upgraded, 0 newly installed, 22 to remove and 0 not upgraded.
After this operation, 98.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 63819 files and directories currently installed.)
Removing dkms (2.3-2) …
Removing fakeroot (1.21-3.1) …
update-alternatives: using /usr/bin/fakeroot-tcp to provide /usr/bin/fakeroot (fakeroot) in auto mode
Removing gcc (4:6.3.0-4) …
Removing linux-headers-amd64 (4.9+80+deb9u7) …
Removing linux-headers-4.9.0-9-amd64 (4.9.168-1+deb9u3) …
dpkg: warning: while removing linux-headers-4.9.0-9-amd64, directory ‘/lib/modules/4.9.0-9-amd64’ not empty so not removed
Removing linux-compiler-gcc-6-x86 (4.9.168-1+deb9u3) …
Removing gcc-6 (6.3.0-18+deb9u1) …
Removing libgcc-6-dev:amd64 (6.3.0-18+deb9u1) …
Removing libasan3:amd64 (6.3.0-18+deb9u1) …
Removing libatomic1:amd64 (6.3.0-18+deb9u1) …
Removing libcc1-0:amd64 (6.3.0-18+deb9u1) …
Removing libcilkrts5:amd64 (6.3.0-18+deb9u1) …
Removing libfakeroot:amd64 (1.21-3.1) …
Removing libgomp1:amd64 (6.3.0-18+deb9u1) …
Removing libitm1:amd64 (6.3.0-18+deb9u1) …
Removing liblsan0:amd64 (6.3.0-18+deb9u1) …
Removing libmpx2:amd64 (6.3.0-18+deb9u1) …
Removing libtsan0:amd64 (6.3.0-18+deb9u1) …
Removing libubsan0:amd64 (6.3.0-18+deb9u1) …
Removing linux-headers-4.9.0-9-common (4.9.168-1+deb9u3) …
Removing linux-kbuild-4.9 (4.9.168-1+deb9u3) …
Removing sudo (1.8.19p1-2.1) …
Processing triggers for libc-bin (2.24-11+deb9u4) …
Processing triggers for man-db (2.7.6.1-2) …
:~# reboot
[/code]