blacklist drivers in host OS

Thanks for following up @gelbal and @alexgg.

@gelbal, the spin.sh script was just echo-ing some text and sleeping while true; do echo "spinning"; sleep 5; done.

@alexgg that makes sense why the blacklist of nouveau will not work.

I made some progress that I’d like to share in case someone else encounters the issue with failing to remove the nouveau drivers. The short description is that in addition to stopping plymouth for the splash display, I had to also disable the virtual console. I believe that is the only other item that was utilizing the nouveau drivers and preventing their removal. I included the relevant docker-compose, dockerfile and spin script for reference below.

docker-compose.yml

version: '2'
networks: {}
volumes:
  resin-data: {} 
services:
  gpu:
    build: ./gpu
    volumes:
      - 'resin-data:/data'
    restart: "no"
    privileged: true
    network_mode: host
    labels:
      io.balena.features.kernel-modules: '1'
      io.balena.features.firmware: '1'
      io.balena.features.dbus: '1'
      io.balena.features.supervisor-api: '1'
      io.balena.features.balena-api: '1'

Dockerfile.template

FROM balenalib/genericx86-64-ext-ubuntu:bionic
RUN install_packages dbus
ENV UDEV=1
COPY spin.sh /
CMD ["/spin.sh"]

spin.sh

#!/bin/bash

## Disable all display elements that could prevent removal of nouveau module
# Stop plymouth service used for splash screen display
DBUS_SYSTEM_BUS_ADDRESS=unix:path=/host/run/dbus/system_bus_socket dbus-send \
    --system --dest=org.freedesktop.systemd1 --type=method_call --print-reply \
    /org/freedesktop/systemd1   org.freedesktop.systemd1.Manager.StartUnit \
    string:"plymouth-quit.service" string:"replace"
# Disable virtual console
echo 0 > /sys/class/vtconsole/vtcon0/bind
# Wait some time for plymouth and virtual console to stop
echo "Waiting to stop display services.."
sleep 2

# Remove the nouveau modules
rmmod nouveau 

# TODO: Insert nvidia drivers and run application...
while true; do
  echo "spinning..."
  sleep 5
done

The above example solves my nouveau removal problem.

1 Like