eGPU randomly recognized at boot - Akitio + Nvidia 1060GTX on MacMini with Ubuntu 19.04

Hi. I made (almost) successfully the transition from a Win10 partition to an Ubuntu 19.04 setup on my MacMini i7-3615QM.

The only thing still not working properly is the detection of my GTX 1060 as an eGPU on an “Akitio Thunder2 Box”.

After installing the 430.40 drivers and disabling the Nouveau ones, my system recognizes and utilizes the eGPU randomly. I mean, sometimes at boot time it is using the eGPU GTX1060, but other times not, using the integrated Intel graphics. I do have two monitors, one connected to the Intel output and the other connected to the eGPU graphic-card.

If I type:

$ sudo prime-select nvidia

, I get:

Info: the nvidia profile is already set

I also tried to install the 430.40.run drivers but I get:

ERROR: Unable to load the 'nvidia-drm' kernel module. PKCS#7 signature not signed with a trusted key.

Even so, after restart it is loading the eGPU. After another restart, not loading the eGPU, and so on. When the system is loading the eGPU I can run even the most demanding games from Steam, so the eGPU it’s working (from time to time). I just need to make this setup to permanently recognize the eGPU every time I’m booting on Ubuntu.

I am new with Linux, just started to learn and some help will be appreciated.

P.S. Forgot to mention that at the boot time the computer get a little bit stuck with an error message on the monitor connected to the internal Intel graphic-card with the following error messege:

-No video mode activated.\n -Can't find command hwmatch

After a few seconds I can see image into the monitor connected to the Intel graphic-card output or on the monitor connected to the Nvidia eGPU one. But it is purely random, so I can’t anticipate which one will run.
nvidia-bug-report_Intel_loaded.log.gz (127 KB)
nvidia-bug-report_1060-Loaded.log.gz (1.14 MB)

Please run nvidia-bug-report.sh as root in the failed and working case and attach the resulting .gz files to your post. Hovering the mouse over an existing post of yours will reveal a paperclip icon.
https://devtalk.nvidia.com/default/topic/1043347/announcements/attaching-files-to-forum-topics-posts/

Hi @generix. Thank you for your reply. I will attach the requested logs.

I do made an upgrade of drivers to the newest 435.17 and the same problem persist. Random load between Intel and Nvidia driver at boot.

Best regards.
nvidia-bug-report_Intel_loaded.log.gz (127 KB)
nvidia-bug-report_1060-Loaded.log.gz (1.14 MB)

The 1060 wants a memory window of 256MB (BAR1). In the working case, the upstream PCI root bridge at 00:01.0 gets assigned a large enough resource window by the uefi so it works, in the failing case that window is too small. This is some Apple HW specific failure, see:
https://github.com/Dunedan/mbp-2016-linux/issues/60

@generix Thank you for the answer.

Do you know some boot arguments or something similar that can fix this issue? How can I assign a bigger memory window?

The resources get assigned by the uefi which is in your case locked, Apple proprietary, no dice.
The kernel parameters to try are mentioned in the github issue report, e.g. pci=realloc.
The other method, to remove and add back the pci device, is also mentioned in that thread.

Hi @generix. I made some tests and seems that the

pci=realloc

boot argument for groob at boot time is making my MacMini to recognize and initialize directly the eGPU. Thank you for the help. Hopefully this solution will last.