Hello,
I wanted to add here that I saw the same
Unknown symbol swiotlb_map_sg_attrs
issue from nvidia.ko(NVIDIA 390.42 GeForce GTX 860M driver) for the latest stable
4.16(https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.tar.xz). At first I thought, the
lib/swiotlb.c(which has swiotlb_map_sg_attrs() function)
was not built during the kernel build, so I explicitly cleaned and built
linux-4.16/lib/* directory(CONFIG_SWIOTLB enabled as well in kernel config)
and installed the kernel modules from therein onto the system
(/lib/modules/4.16.0/...)
.
Even then, nvidia.ko complained it couldn’t find swiotlb_map_sg_attrs(symbol). Then I
checked whether swiotlb_map_sg_attrs symbol was shown as defined(T) in any of the
linux-4.16/lib/*.ko(using nm tool)
None of them showed swiotlb_map_sg_attrs to be defined within them. So, that made me think
this swiotlb_map_sg_attrs symbol visibility might have changed in the latest 4.16 but it was
visible/exported in earlier kernels(4.15.15, 4.15.14, etc - for which I had no issues in
building, installing and using the same NVIDIA 390.42 GeForce GTX 860M driver). So, as
per one of the above comments, I disabled the logic which refers
swiotlb_map_sg_attrs in common/inc/nv-linux.h
and made the nv_dma_maps_swiotlb() to return NV_FALSE as swiotlb is not used anyway. Rebuilt
NVIDIA 390.42 GeForce GTX 860M driver
Installed, loaded the nvidia*.ko modules and that worked and is working without any issues
for the latest stable Linux kernel 4.16 for Ubuntu 17.10 x86_64.
Below are the specifics.
exp@exp:~$
exp@exp:~$ cat /proc/version
Linux version 4.16.0 (exp@exp) (clang version 5.0.0-3 (tags/RELEASE_500/final)) #1 SMP Mon Apr 2 20:39:22 PDT 2018
exp@exp:~$
exp@exp:~$
exp@exp:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.10
Release: 17.10
Codename: artful
exp@exp:~$
exp@exp:~$
exp@exp:~$
exp@exp:~$ nvidia-smi
Tue Apr 3 00:01:15 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.42 Driver Version: 390.42 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 860M Off | 00000000:01:00.0 Off | N/A |
| N/A 54C P0 N/A / N/A | 306MiB / 4046MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
exp@exp:~$
exp@exp:~$
exp@exp:~$ lsmod | grep nvidia
nvidia_uvm 815104 0
nvidia_drm 24576 2
nvidia_modeset 1105920 4 nvidia_drm
nvidia 14368768 230 nvidia_uvm,nvidia_modeset
ipmi_msghandler 61440 2 nvidia,ipmi_devintf
drm 454656 6 nvidia_drm,i915,drm_kms_helper
exp@exp:~$
exp@exp:~$
exp@exp:~$
exp@exp:~$ glxinfo | grep NVIDIA
server glx vendor string: NVIDIA Corporation
client glx vendor string: NVIDIA Corporation
OpenGL vendor string: NVIDIA Corporation
OpenGL core profile version string: 4.5.0 NVIDIA 390.42
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL version string: 4.6.0 NVIDIA 390.42
OpenGL shading language version string: 4.60 NVIDIA
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 390.42
exp@exp:~$
exp@exp:~$
exp@exp:~$ sudo dmidecode -t system | grep "Manufacturer:\|Version:"
Manufacturer: LENOVO
Version: Lenovo Y50-70 Touch
exp@exp:~$
By the way, in the above whole experience, I am using
clang/LLVM as the compiler/toolchain to build NVIDIA 390.42 GeForce GTX 860M driver(latest as of now)
and also
Linux kernel 4.16(and the earlier kernels : 4.15.7 and above) is being built by me using clang/LLVM
.
For any one interested in this clang/LLVM related kernel/NVIDIA driver details, I have written a report here –
Success : Ubuntu 17.10 x86_64 on LLVM/clang-built kernel with Nvidia 390.25 driver :
<a target='_blank' rel='noopener noreferrer' href='https://ubuntuforums.org/showthread.php?t=2386423'>https://ubuntuforums.org/showthread.php?t=2386423</a>
Cheers.
UPDATE : Above logic of disabling swiotlb specific code worked even with latest Nvidia v390.48 driver for Nvidia GeForce GTX 860M graphics card.
exp@exp:~$
exp@exp:~$ nvidia-smi
Fri Apr 6 01:53:20 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 390.48 Driver Version: 390.48 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 860M Off | 00000000:01:00.0 Off | N/A |
| N/A 60C P5 N/A / N/A | 790MiB / 4046MiB | 17% Default |
+-------------------------------+----------------------+----------------------+
exp@exp:~$
exp@exp:~$ ~/nvidia_driver_modules_version.sh
++ grep '^version='
+++ uname -r
++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia.ko
version=390.48
++ grep '^version='
+++ uname -r
++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia-drm.ko
version=390.48
++ grep '^version='
+++ uname -r
++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia-uvm.ko
++ grep '^version='
+++ uname -r
++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia-modeset.ko
version=390.48
exp@exp:~$
exp@exp:~$
exp@exp:~$ ~/nvidia-driver-compiler.sh
++ head -1
+++ uname -r
++ eclang /lib/modules/4.16.0/kernel/drivers/video/nvidia.ko
+++ grep 'clang version'
+++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia.ko
clang version 5.0.0-3 (tags/RELEASE_500/final)
++ head -1
+++ uname -r
++ eclang /lib/modules/4.16.0/kernel/drivers/video/nvidia-drm.ko
+++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia-drm.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)
++ head -1
+++ uname -r
++ eclang /lib/modules/4.16.0/kernel/drivers/video/nvidia-modeset.ko
+++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia-modeset.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)
++ head -1
+++ uname -r
++ eclang /lib/modules/4.16.0/kernel/drivers/video/nvidia-uvm.ko
+++ strings -a /lib/modules/4.16.0/kernel/drivers/video/nvidia-uvm.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)
exp@exp:~$