# Nvidia driver installation problem



## sudheera (Apr 11, 2021)

Hello friends,

I have a TrueNAS 12.0 server which runs with no GUI. I plugged in Nvidia GTX 1050Ti to it in order to use in ffmpeg. After plugging in `pciconf -vl` gave me the following output


```
vgapci0@pci0:2:0:0:     class=0x030000 card=0x85d11043 chip=0x1c8210de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GP107 [GeForce GTX 1050 Ti]'
    class      = display
    subclass   = VGA
```

But I could not see anything here

```
root@freenas[~]# ls /dev | grep dr
root@freenas[~]#
```


Naturally, I thought I should install nvidia drivers and according to the handbook I ran `pkg install x11/nvidia-driver`. During the installation process I saw a message like this : `Xorg-server has been installed` even thought I do not need it. Full log : https://pastebin.com/raw/wP0ErAEZ

Installation completed successfully, but when I tried to load the kernel module I get errors like this


```
root@freenas[~]# kldload nvidia
kldload: an error occurred while loading module nvidia. Please check dmesg(8) for more details.
root@freenas[~]# dmesg| tail
KLD nvidia-modeset.ko: depends on nvidia - not available or version mismatch
linker_load_file: /boot/modules/nvidia-modeset.ko - unsupported file type
link_elf_obj: symbol sc_get_softc undefined
linker_load_file: /boot/modules/nvidia.ko - unsupported file type
link_elf_obj: symbol sc_get_softc undefined
linker_load_file: /boot/modules/nvidia.ko - unsupported file type
KLD nvidia-modeset.ko: depends on nvidia - not available or version mismatch
linker_load_file: /boot/modules/nvidia-modeset.ko - unsupported file type
link_elf_obj: symbol sc_get_softc undefined
linker_load_file: /boot/modules/nvidia.ko - unsupported file type
```


Any idea what I'm doing wrong here ? Thanks in advanced.



```
root@freenas[~]# pkg -v
1.14.5
```

freebsd version : 


```
root@freenas[~]# freebsd-version
12.2-RELEASE-p3
root@freenas[~]# uname -mrs
FreeBSD 12.2-RELEASE-p3 amd64
```

MB: Supermicro X9SCM


----------



## SirDice (Apr 11, 2021)

sudheera said:


> I have a TrueNAS 12.0 server which runs with no GUI.


GhostBSD, pfSense, TrueNAS, and all other FreeBSD Derivatives


----------



## scottro (Apr 11, 2021)

One reason for the link SirDice provided is that FreeBSD solutions may not work on a derivative. The handbook was out of date last I looked. I have a page, which, though written for 11.x is more recent. If they work the same way, then you can look at it. https://srobb.net/freebsdnvidia.html

There's a good chance there are differences in FreeNAS though, and you're better off asking on their support channels.


----------



## sudheera (Apr 11, 2021)

Thank you very much. I will take a look at both of them. Many thanks


----------



## mickey (Apr 12, 2021)

sudheera said:


> Installation completed successfully, but when I tried to load the kernel module I get errors like this
> 
> 
> ```
> ...


The nvidia driver contains a call to sc_get_softc() which is not available if your kernel was built without sc(4) support. The FreeBSD GENERIC kernel contains both, vt(4) and sc(4), so the problem does not surface there. To fix this problem you can either build a kernel that includes sc(4), or remove the call from the nvidia driver by building a patched version yourself:

```
--- src/nvidia/nvidia_os.c.orig 2019-01-28 23:36:03.483407000 +0100
+++ src/nvidia/nvidia_os.c      2019-01-28 23:37:32.796433000 +0100
@@ -800,6 +800,7 @@
         }
     }
 #endif
+#if 0
     {
         const sc_softc_t *sc = sc_get_softc(0, SC_KERNEL_CONSOLE);

@@ -823,6 +824,7 @@
             }
         }
     }
+#endif

     *pPhysicalAddress = 0;
     *pFbWidth = *pFbHeight = *pFbDepth = *pFbPitch = 0;
```


----------

