t2linux / T2-Ubuntu

Ubuntu for T2 Macs
597 stars 52 forks source link

AMD GPU driver install #23

Closed mahboobkarimian closed 3 years ago

mahboobkarimian commented 3 years ago

Problem: I've downloaded the official amd-gpu driver for Ubuntu from the AMD website (amdgpu-pro-20.20-1098277-ubuntu-20.04) and wanted to install it on my Macbook Pro 2019. With ./amdgpu-install -y --no-dkms it is working, Bu now I can not connect to tan external monitor anymore (can not be recognized by ubuntu). however for ./amdgpu-pro-install we can not use no-dkms option. I want pro-install to enable AMD VCE for encoding via Handbrake: https://handbrake.fr/docs/en/latest/technical/video-vce.html Using the latter command, I am getting this error.

Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Errors were encountered while processing:
 amdgpu-dkms
 amdgpu
 amdgpu-pro
 amdgpu-pro-lib32
E: Sub-process /usr/bin/dpkg returned an error code (1)

More info: When installing amdgpu-core_*.deb amdgpu-dkms_*.deb we are getting this error:

Deleting module version: 5.6.0.15-1098277
completely from the DKMS tree.
------------------------------
Done.
Unpacking amdgpu-dkms (1:5.6.0.15-1098277) over (1:5.6.0.15-1098277) ...
Setting up amdgpu-core (20.20-1098277) ...
Setting up amdgpu-dkms (1:5.6.0.15-1098277) ...
Loading new amdgpu-5.6.0.15-1098277 DKMS files...
Building for 5.7.19-mbp 5.8.16-mbp
Building for architecture x86_64
Building initial module for 5.7.19-mbp
ERROR (dkms apport): kernel package linux-headers-5.7.19-mbp is not supported
Error! Bad return status for module build on kernel: 5.7.19-mbp (x86_64)
Consult /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/make.log for more information.
dpkg: error processing package amdgpu-dkms (--install):
 installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 amdgpu-dkms

Looking at /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/make.log:

  CC [M]  /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu/amdgpu_trace_points.o
/var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu/amdgpu_bios.c: In function ‘amdgpu_read_platform_bios’:
/var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu/amdgpu_bios.c:200:9: error: implicit declaration of function ‘pci_platform_rom’ [-Werror=implicit-function-declaration]
  200 |  bios = pci_platform_rom(adev->pdev, &size);
      |         ^~~~~~~~~~~~~~~~
/var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu/amdgpu_bios.c:200:7: warning: assignment to ‘uint8_t *’ {aka ‘unsigned char *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  200 |  bios = pci_platform_rom(adev->pdev, &size);
      |       ^
  CC [M]  /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu/atombios_encoders.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:267: /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu/amdgpu_bios.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:488: /var/lib/dkms/amdgpu/5.6.0.15-1098277/build/amd/amdgpu] Error 2
make: *** [Makefile:1732: /var/lib/dkms/amdgpu/5.6.0.15-1098277/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.7.19-mbp'

What we can do to use this driver?

marcosfad commented 3 years ago

Hi, I think that the issue is:

ERROR (dkms apport): kernel package linux-headers-5.7.19-mbp is not supported
Error! Bad return status for module build on kernel: 5.7.19-mbp (x86_64)

But you can try following: https://math.dartmouth.edu/~sarunas/amdgpu.html I've use it some time ago before I got a NVIDIA card.