Installing AMDGPU-PRO Ubuntu Driver under Slackware 14.2?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
diff --git a/unfinished/amdgpu-pro-driver/16.50/amdgpu-pro-driver.SlackBuild b/unfinished/amdgpu-pro-driver/16.50/amdgpu-pro-driver.SlackBuild
index c07f2f1..cb7783d 100755
--- a/unfinished/amdgpu-pro-driver/16.50/amdgpu-pro-driver.SlackBuild
+++ b/unfinished/amdgpu-pro-driver/16.50/amdgpu-pro-driver.SlackBuild
@@ -99,7 +99,7 @@ rmdir -p --ignore-fail-on-non-empty $PKG/usr/lib/${DRIARCH}-linux-gnu/dri/
# Then we need to create a symlink because libglx.so has a hardcoded location
# for amdgpu_dri.so that doesn't conform to Slackware standards. Thanks to AUR!
mkdir -p $PKG/usr/lib/x86_64-linux-gnu
-ln -s $PKG/usr/lib${LIBDIRSUFFIX}/xorg/modules/dri/ $PKG/usr/lib/x86_64-linux-gnu/dri
+ln -s usr/lib${LIBDIRSUFFIX}/xorg/modules/dri/ usr/lib/x86_64-linux-gnu/dri
# Make sure 10-amdgpu-pro.conf points to correct location based on ARCH
sed -i "s|/usr/lib|/usr/lib${LIBDIRSUFFIX}|g" $PKG/usr/share/X11/xorg.conf.d/10-amdgpu-pro.conf
This makes the doinst.sh contain:
Code:
( cd usr/lib/x86_64-linux-gnu ; rm -rf dri )
( cd usr/lib/x86_64-linux-gnu ; ln -sf usr/lib64/xorg/modules/dri/ dri )
I'm still trying to figure out how to properly create symlinks in SlackBuilds. There seems to be many different ways to do it. I think this next one will work properly. Try it out.
Back to the segfault, I did find this page that provides a way for debug output with drm, but I'm not sure if it outputs it to to the X log or somewhere else. But I'm not even sure if it would provide anything meaningful, since it seems to be related to libglx.
Code:
echo 1 | sudo tee /sys/module/drm/parameters/debug
When you get that segfault, do you get any output in dmesg?
Ok, after a ton of digging through random github pages, I think I have the dkms thing figured out. I'm still working on how to build it within the SlackBuild so it can be packaged properly, but that will be later.
As of right now, you'll need dkms installed from SBo. Then run the newly updated SlackBuild as normal (make sure you grab the patches directory... there's a lot of them).
Once that is done, and the package is built and installed, you should be able to run
Code:
dkms install -m amdgpu-pro -v 16.50-362463
That should get you the amdgpu.ko module in /lib/modules/4.4.14/updates/. I think dkms runs depmod after it's built, then you probably just need to reboot to load the new, updated module.
If, for some reason, it complains that is can't find the source, you can try
Code:
dkms add /usr/src/amdgpu-pro-16.50-362463
I hope this works... if it doesn't, hopefully you can figure out where I messed it up so I can fix the instructions (and hopefully eventually work them into the SlackBuild).
Ok, after a ton of digging through random github pages, I think I have the dkms thing figured out. I'm still working on how to build it within the SlackBuild so it can be packaged properly, but that will be later.
As of right now, you'll need https://slackbuilds.org/repository/1...ent/dkms/]dkms installed from SBo. Then run the newly updated SlackBuild as normal (make sure you grab the patches directory... there's a lot of them).
Once that is done, and the package is built and installed, you should be able to run
Code:
dkms install -m amdgpu-pro -v 16.50-362463
That should get you the amdgpu.ko module in /lib/modules/4.4.14/updates/. I think dkms runs depmod after it's built, then you probably just need to reboot to load the new, updated module.
If, for some reason, it complains that is can't find the source, you can try
Code:
dkms add /usr/src/amdgpu-pro-16.50-362463
I hope this works... if it doesn't, hopefully you can figure out where I messed it up so I can fix the instructions (and hopefully eventually work them into the SlackBuild).
You don't really need dkms, you can compile module:
Code:
make -C /lib/modules/\`uname -r\`/build M=/usr/src/amdgpu-pro-16.50-362463
then install:
make -C /lib/modules/\`uname -r\`/build M=/usr/src/amdgpu-pro-16.50-362463 modules_install
#or
strip --strip-debug /usr/src/amdgpu-pro-16.50-362463/amd/amdgpu/amdgpu.ko
cp /usr/src/amdgpu-pro-16.50-362463/amd/amdgpu/amdgpu.ko /lib/modules/`uname -r`/extra
depmod -a
but kernel already includes amdgpu module, so you should remove it, if you compile this one.
It works for me without compiling this module. I have 4.9.6 kernel and slackware64 14.2
But there are some problems, libdrm and mesa (you still need libglapi.so from mesa package) package need to be removed to make it work,
otherwise wrong shared library is loaded for example /usr/lib64/libdrm_amdgpu.so.1 instead of amd one in /opt/amdgpu-pro/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1
and xorg server crashes.
I don't know if there is a way to give priority to some library folder.
Maybe if I put them first in /etc/ld.so.conf, for now I just add include /etc/ld.so.conf.d/*.conf to the end and copy AMD file to /etc/ld.so.conf.d/amdgpu-pro-x86_64.conf, will try this tomorrow.
So if I remove this packages, driver seems to work.
I have R9 290x in this computer and OpenGL, OpenCL works, Vulkan seems to work, some samples don't run, but I didn't have time to look more into this.
I had already tried building the source without dkms, but I get the following: Turns out, I had to have it in /usr/src, rather than within the tmp directory for the package compilation.
And that's good to know the dkms-built module isn't needed... I wasn't sure if it was different enough than the one provided by Slackware to be required by amdgpu-pro.
I'll do some digging and see if I can find a way to set priority for certain locations. That would hopefully prevent needing to remove any stock packages to run this.
Thanks for testing. And feel free to throw up any logs you think might help me in figuring this out.
It works for me without compiling this module. I have 4.9.6 kernel and slackware64 14.2
But there are some problems, libdrm and mesa (you still need libglapi.so from mesa package) package need to be removed to make it work,
otherwise wrong shared library is loaded for example /usr/lib64/libdrm_amdgpu.so.1 instead of amd one in /opt/amdgpu-pro/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1
and xorg server crashes.
I don't know if there is a way to give priority to some library folder.
Maybe if I put them first in /etc/ld.so.conf, for now I just add include /etc/ld.so.conf.d/*.conf to the end and copy AMD file to /etc/ld.so.conf.d/amdgpu-pro-x86_64.conf, will try this tomorrow.
So, I'm debating between two options. One, I could add /opt/amdgpu-pro/lib/x86_64-linux-gnu/ to the beginning of /etc/ld.so.conf in a doinst.sh. Or, two, I could re-symlink /usr/lib64/libdrm_amdgpu.so.1 to the file in /opt/. It is already a symlink to /usr/lib64/libdrm_amdgpu.so.1.0.0, but I'm not sure if others would reference the other libdrm_amdgpu files in /usr/lib64/.
And I ended up checking the modinfo output of the original module and the amdgpu-pro module, and there is some difference in the output. I'm not sure if there is a big difference, but it does reference more firmware files, adds more aliases (likely to support extra cards) and has more parm options.
Granted, this is based on module the provided in the 4.4 kernel series, so a 4.9 kernel series module might have even more options than the one provided in the driver, but I don't have it to check.
but kernel already includes amdgpu module, so you should remove it, if you compile this one.
Its better to just override the module location than remove modules from the kernel. That way it can be easily switched back for testing or if something goes wrong. See depmod.d (5).
I have examples of such in my nouveau-reclocking and xpad slackbuilds, they will create a file in /etc/depmod.d/, for example.
/etc/depmod.d/xpad-4.9.5.conf
Code:
override xpad 4.9.5 extra
Then you install the new module in /lib/modules/$KERNEL/extra/
From tldp.org: "LD_LIBRARY_PATH You can temporarily substitute a different library for this particular execution. In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories; this is useful when debugging a new library or using a nonstandard library for special purposes. The environment variable LD_PRELOAD lists shared libraries with functions that override the standard set, just as /etc/ld.so.preload does."
Overriding with LD_LIBRARY_PATH doesn't work. Well it works, library from /opt/amdgpu-pro/lib/x86_64-linux-gnu seems to be correctly loaded according to Xorg log, but I still get crash. Will try to find out later, what exactly is the problem.
Code:
(EE) Backtrace:
(EE) 0: /usr/libexec/Xorg (xorg_backtrace+0x41) [0x580ba1]
(EE) 1: /usr/libexec/Xorg (0x400000+0x184ac9) [0x584ac9]
(EE) 2: /lib64/libpthread.so.0 (0x7f11a5a95000+0x113b0) [0x7f11a5aa63b0]
(EE)
(EE) Segmentation fault at address 0x0
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(II) AMDGPU(0): AMDGPULeaveVT_KMS
(II) AMDGPU(0): Ok, leaving now...
(EE) Server terminated with error (1). Closing log file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.