# [SOLVED] NVidia drivers after 396.24 and OpenCL

## BruceG

I've been using x11-drivers/nvidia-drivers for a couple of years to drive an application that makes extensive use of OpenCL (darktable). Every version up to and including 396.24-r1 works for OpenCL, but all versions 396.45 and later no longer work. The clinfo tool reports 0 platforms when it is broken, and darktable reports that opencl is not available.

I have compared the installed package before and after, and as far as I can tell all the same files are being installed (with different library version numbers, of course). I am of course rebooting as required between upgrades to load the new drivers in the kernel and X.

Is there any chance this is an issue with the Gentoo ebuild, or more likely a driver bug I should take up with NVidia?Last edited by BruceG on Thu Aug 30, 2018 2:34 am; edited 1 time in total

----------

## BruceG

Thanks to some of the comments in this thread on NVidia devtalk, I found and fixed the problem.

It turns out that the versions 396.24.02 and later of the driver require NUMA configuration in the kernel for Cuda and OpenCL to work. I only have a single CPU system, so it was never enabled. Enabling this kernel option and rebuilding the kernel and driver fixed the problem for me.

----------

## DawgG

tried your solution, but it does not work for me. i have NUMA in kernel

```
zgrep -i numa /proc/config.gz 

CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y

# CONFIG_NUMA_BALANCING is not set

CONFIG_NUMA=y

CONFIG_AMD_NUMA=y

CONFIG_X86_64_ACPI_NUMA=y

# CONFIG_NUMA_EMU is not set

CONFIG_USE_PERCPU_NUMA_NODE_ID=y

CONFIG_ACPI_NUMA=y
```

and loaded the nvidia-modules with nvidia-modprobe, but CUDA (ffmpeg with hevc_nvenc) does not work:

```
[hevc_nvenc @ 0x5563461d4260] Cannot init CUDA
```

do i need any other devnodes than these:

```
crw-rw---- 1 root video 195,   0 14. Sep 13:09 /dev/nvidia0

crw-rw---- 1 root video 195, 255 14. Sep 13:09 /dev/nvidiactl

crw-rw---- 1 root video 195, 254 14. Sep 13:09 /dev/nvidia-modeset
```

creating the devnode nvidia-uvm with mknod does make CUDA work either.

i'll try with an older driver - but is there another solution for this?

----------

## BruceG

You might need the -u option to nvidia-modprobe to set up the uvm devices. These are the nodes on my (working) system:

```
crw-rw---- 1 root video 195,   0 Aug 29 20:28 /dev/nvidia0

crw-rw---- 1 root video 195, 255 Aug 29 20:28 /dev/nvidiactl

crw-rw---- 1 root video 195, 254 Aug 29 20:28 /dev/nvidia-modeset

crw-rw-rw- 1 root root  245,   0 Aug 29 20:28 /dev/nvidia-uvm

crw-rw-rw- 1 root root  245,   1 Aug 29 20:28 /dev/nvidia-uvm-tools

```

----------

## DawgG

 *Quote:*   

> You might need the -u option to nvidia-modprobe 

 

already tried that - did not work.

i just did 

```
nvidia-modprobe -u
```

 (after manually unloading all nvidia-modules) but the devnodes are definitely not created; i only get the following:

```
crw-rw---- 1 root video 195,   0 14. Sep 16:39 /dev/nvidia0

crw-rw---- 1 root video 195, 255 14. Sep 16:39 /dev/nvidiactl
```

(i do not have to start x before, do i? doing this over ssh)

do i have to create them manually?

----------

## DawgG

with 

```
nvidia-modprobe -u -c 0 -m -c 1
```

 the device-nodes are created!

```
crw-rw---- 1 root video 195, 254 14. Sep 17:06 /dev/nvidia-modeset

crw-rw-rw- 1 root root  248,   1 14. Sep 17:10 /dev/nvidia-uvm

crw-rw-rw- 1 root root  248,   2 14. Sep 17:10 /dev/nvidia-uvm-tools

crw-rw---- 1 root video 195,   0 14. Sep 17:02 /dev/nvidia0

crw-rw---- 1 root video 195, 255 14. Sep 17:02 /dev/nvidiactl
```

but ffmpeg/hevc with CUDA still does not work:

```
[hevc_nvenc @ 0x563218c4f260] Cannot init CUDA

Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 
```

any advice?

----------

## hhfeuer

You also need CONFIG_CPUSETS set in kernel (same devtalk thread).

----------

## DawgG

@hhfeuer

 *Quote:*   

> You also need CONFIG_CPUSETS set in kernel

 

Yes! THANK YOU!

this definitely solved it - i can run ffmpeg on the GPU again.

----------

