Software rendering mode AMD and RT-preempt kernel

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
blazini36

Software rendering mode AMD and RT-preempt kernel

Post by blazini36 »

I'm using Mint for LinuxCNC to control a machine. On the first one I built it was with a PC using an Intel processor wit intel Graphics and LMDE2. I built a new one using an AMD A10 9700 APU, tried just swapping the HDD to the new PC (which works more frequently than not) and got the "software rendering mode popup for Cinnamon.

So I decided to setup Mint 18.3 from scratch. The stock kernel 4.10 does not display the software rendering error. When I built the RT-preempt kernel I had used before (4.9.35 RT25) I get the software rendering message again when it's booted from. Now I can pretty much narrow this down to the kernel. I'm wondering if I missed a kernel module or something in menuconfig. AFAIK 4.10 does not have an RT patch and 4.9 isn't much older so it should work. I'm not sure if there's any way to compare the stock kernel config to my RT kernel config to see what I'm missing.

Any ideas?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Hoser Rob
Level 20
Level 20
Posts: 11806
Joined: Sat Dec 15, 2012 8:57 am

Re: Software rendering mode AMD and RT-preempt kernel

Post by Hoser Rob »

I'm not so sure at all it's the kernel, but you need to post more system info. Copy/paste this to the terminal and copy/paste the text output here:

Code: Select all

inxi -Fxz
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
blazini36

Re: Software rendering mode AMD and RT-preempt kernel

Post by blazini36 »

I had to make the assumption that it has something to do with the kernel vs the AMD graphics. This has happened with LMDE2 and Mint 18.3 using this RT preempt kernel but not with the stock kernels. I briefly tried to use the proprietary drivers but that never seems to go well. It seems you might be right if "driver:unloaded" means anything.

Stock kernel

Code: Select all

bla@bla ~ $ inxi -Fxz
System:    Host: bla Kernel: 4.10.0-38-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.6.6 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.3 Sylvia
Machine:   Mobo: TAR model: X370GTN
           Bios: American Megatrends v: 5.12 date: 06/23/2017
CPU:       Quad core AMD A10-9700 RADEON R7 10 COMPUTE CORES 4C+6G (-MCP-) cache: 4096 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 27946
           clock speeds: max: 3500 MHz 1: 1400 MHz 2: 1900 MHz 3: 2400 MHz
           4: 2400 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Carrizo bus-ID: 00:01.0
           Display Server: X.Org 1.18.4 drivers: ati,amdgpu (unloaded: fbdev,vesa,radeon)
           Resolution: 1920x1080@60.00hz
           GLX Renderer: Gallium 0.4 on AMD CARRIZO (DRM 3.9.0 / 4.10.0-38-generic, LLVM 4.0.0)
           GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes
Audio:     Card-1 Advanced Micro Devices [AMD] Device 157a
           driver: snd_hda_intel bus-ID: 00:09.2
           Card-2 Advanced Micro Devices [AMD/ATI] Kabini HDMI/DP Audio
           driver: snd_hda_intel bus-ID: 00:01.1
           Sound: Advanced Linux Sound Architecture v: k4.10.0-38-generic
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e000 bus-ID: 05:00.0
           IF: enp5s0 state: down mac: <filter>
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: d000 bus-ID: 0e:00.0
           IF: enp14s0 state: down mac: <filter>
           Card-3: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: c000 bus-ID: 10:00.0
           IF: enp16s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 480.1GB (10.1% used)
           ID-1: USB /dev/sda model: 2115 size: 240.1GB
           ID-2: /dev/sdb model: SanDisk_SDSSDA24 size: 240.1GB
Partition: ID-1: / size: 37G used: 7.5G (22%) fs: ext4 dev: /dev/sdb1
           ID-2: /home size: 55G used: 103M (1%) fs: ext4 dev: /dev/sdb5
           ID-3: swap-1 size: 10.00GB used: 0.00GB (0%) fs: swap dev: /dev/sdb6
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 23.0C mobo: N/A gpu: 0.0
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 229 Uptime: 37 min Memory: 1034.0/2894.3MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
) inxi: 2Á

Code: Select all

RTpreempt Kernel
bla@bla ~ $ inxi -Fxz
System:    Host: bla Kernel: 4.9.35-rt25mah x86_64 (64 bit gcc: 5.4.0)
           Desktop: Cinnamon 3.6.6 (Gtk 3.18.9-1ubuntu3.3)
           Distro: Linux Mint 18.3 Sylvia
Machine:   Mobo: TAR model: X370GTN
           Bios: American Megatrends v: 5.12 date: 06/23/2017
CPU:       Quad core AMD A10-9700 RADEON R7 10 COMPUTE CORES 4C+6G (-MCP-) cache: 4096 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm) bmips: 27947
           clock speeds: max: 3500 MHz 1: 1900 MHz 2: 1900 MHz 3: 1900 MHz
           4: 1900 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Carrizo bus-ID: 00:01.0
           Display Server: X.Org 1.18.4 drivers: fbdev,ati (unloaded: vesa,radeon)
           Resolution: 1920x1080@77.00hz
           GLX Renderer: Gallium 0.4 on llvmpipe (LLVM 4.0, 128 bits)
           GLX Version: 3.0 Mesa 17.0.7 Direct Rendering: Yes
Audio:     Card-1 Advanced Micro Devices [AMD] Device 157a
           driver: snd_hda_intel bus-ID: 00:09.2
           Card-2 Advanced Micro Devices [AMD/ATI] Kabini HDMI/DP Audio
           driver: snd_hda_intel bus-ID: 00:01.1
           Sound: Advanced Linux Sound Architecture v: k4.9.35-rt25mah
Network:   Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e000 bus-ID: 05:00.0
           IF: enp5s0 state: down mac: <filter>
           Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: d000 bus-ID: 0e:00.0
           IF: enp14s0 state: down mac: <filter>
           Card-3: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: c000 bus-ID: 10:00.0
           IF: enp16s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:    HDD Total Size: 480.1GB (10.1% used)
           ID-1: /dev/sda model: SanDisk_SDSSDA24 size: 240.1GB
           ID-2: USB /dev/sdb model: 2115 size: 240.1GB
Partition: ID-1: / size: 37G used: 7.5G (22%) fs: ext4 dev: /dev/sda1
           ID-2: /home size: 55G used: 103M (1%) fs: ext4 dev: /dev/sda5
           ID-3: swap-1 size: 10.00GB used: 0.00GB (0%) fs: swap dev: /dev/sda6
Sensors:   System Temperatures: cpu: 0.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 250 Uptime: 1 min Memory: 589.7/2892.5MB
           Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Software rendering mode AMD and RT-preempt kernel

Post by catweazel »

blazini36 wrote: Mon Feb 12, 2018 12:26 am Now I can pretty much narrow this down to the kernel. I'm wondering if I missed a kernel module or something in menuconfig.
Did you copy the config from a working kernel into the root of the kernel sources prior to make menuconfig?

Code: Select all

cp /boot/config-`uname -r` ./.config
Additionally, why do you feel that you need a realtime kernel as opposed to a lowlatency kernel? If you can make do with a lowlatency kernel then you only need to download and install an ubuntu mainline kernel. For example:

Code: Select all

linux-headers-4.14.18-041418_4.14.18-041418.201802071730_all.deb
linux-headers-4.14.18-041418-lowlatency_4.14.18-041418.201802071730_amd64.deb
linux-image-4.14.18-041418-lowlatency_4.14.18-041418.201802071730_amd64.deb

Code: Select all

sudo dpkg -i linux-*
The only caveat is that these kernels are for testing and not intended for production, though I think that's a nice way of saying that if you use them then you're on your own if you need support.

If you decide to stick with a realtime kernel then you have another problem to solve. You won't get any benefit for your CNC program unless you can figure out how to permanently set it to run in RT whenever it's executed. For example:

Code: Select all

PID=$(ps -ef | grep CNC )   
chrt -p $PID
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
blazini36

Re: Software rendering mode AMD and RT-preempt kernel

Post by blazini36 »

catweazel wrote: Mon Feb 12, 2018 8:29 pm
blazini36 wrote: Mon Feb 12, 2018 12:26 am Now I can pretty much narrow this down to the kernel. I'm wondering if I missed a kernel module or something in menuconfig.
Did you copy the config from a working kernel into the root of the kernel sources prior to make menuconfig?

Code: Select all

cp /boot/config-`uname -r` ./.config
No, I initially downloaded kernel source and patched it with the matching RT preempt patch. I did not copy any configs. I'm not sure how I'd go about that because a different kernel version would have different menu items correct? And the preempt patch adds options for preemptive behavior. I suppose the only "working " kernel I would have to go against would be a generic kernel. Any ideas on how I can copy the 4.10 config into the 4.9rt kernel without causing issues?


catweazel wrote: Mon Feb 12, 2018 8:29 pm
Additionally, why do you feel that you need a realtime kernel as opposed to a lowlatency kernel? If you can make do with a lowlatency kernel then you only need to download and install an ubuntu mainline kernel. For example:

Code: Select all

linux-headers-4.14.18-041418_4.14.18-041418.201802071730_all.deb
linux-headers-4.14.18-041418-lowlatency_4.14.18-041418.201802071730_amd64.deb
linux-image-4.14.18-041418-lowlatency_4.14.18-041418.201802071730_amd64.deb

Code: Select all

sudo dpkg -i linux-*
LinuxCNC requires RT preemt, Rtai, or Xenomai depending on the hardware. I'm not an RT kernal wizard, but I've never once seen the mention of substituting the RT kernels with a low latency kernel. Stock LinuxCNC distributions are usually packaged with Debian Wheezy or Ubuntu with either RTAI or RT-Preempt. Unfortunately I do not like Plain Debian and I've grown to dislike Ubuntu. I use Mint on everything else and I actually had everything working in LMDE2 on previous PC. That PC was just not fast enough to deal with image processing the way I needed it to. I'm building this system from scratch, and at the moment I see this as a minor issue, just one of those things you have to deal with in Linux from time to time.

I actually posted in the LinuxCNC forums asking this question to see if a LL kernel is even an option. I do know that the kernels your referring to are generally known as soft-realtime kernels while the ones I mentioned are known as hard real-time. I've seen 1 or 2 comparisons from others that showed jitter to be quite a bit higher on LL kernels than RT. I do not really know what hardware they were using though. For now I just want to see if I can fix this GFX issue and move on. It would be pretty easy to test a LL kernel down the road if I was so inclined.
catweazel wrote: Mon Feb 12, 2018 8:29 pm
If you decide to stick with a realtime kernel then you have another problem to solve. You won't get any benefit for your CNC program unless you can figure out how to permanently set it to run in RT whenever it's executed. For example:
LinuxCNC envokes "Halrun" when it starts this sets up the RT behavior
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Software rendering mode AMD and RT-preempt kernel

Post by catweazel »

blazini36 wrote: Mon Feb 12, 2018 9:56 pm
catweazel wrote: Mon Feb 12, 2018 8:29 pm
blazini36 wrote: Mon Feb 12, 2018 12:26 am Now I can pretty much narrow this down to the kernel. I'm wondering if I missed a kernel module or something in menuconfig.
Did you copy the config from a working kernel into the root of the kernel sources prior to make menuconfig?

Code: Select all

cp /boot/config-`uname -r` ./.config
No, I initially downloaded kernel source and patched it with the matching RT preempt patch. I did not copy any configs. I'm not sure how I'd go about that because a different kernel version would have different menu items correct? And the preempt patch adds options for preemptive behavior. I suppose the only "working " kernel I would have to go against would be a generic kernel. Any ideas on how I can copy the 4.10 config into the 4.9rt kernel without causing issues?
Boot into a 4.10 kernel then, from the kernel sources directory:

Code: Select all

cp /boot/config-`uname -r` ./.config
That will copy the config for the running kernel, then you use menuconfig to make any other changes you need. It shouldn't affect your patch but copy the config first then apply the patch. What this method should do is guarantee that your shiny new RT kernel will have exactly the same configuration as your running kernel, plus or minus any additional changes you make. In the end, I'm suggesting this approach as one way to avoid driver issues. It shouldn't matter that you're copying a 4.10 config to a 4.9 kernel, and at worst, if it doesn't work, you'll only have to unpack the kernel sources into a clean directory.

Fair enough on the need for a RT kernel, btw.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
blazini36

Re: Software rendering mode AMD and RT-preempt kernel

Post by blazini36 »

catweazel wrote: Mon Feb 12, 2018 10:09 pm
blazini36 wrote: Mon Feb 12, 2018 9:56 pm
catweazel wrote: Mon Feb 12, 2018 8:29 pm

Did you copy the config from a working kernel into the root of the kernel sources prior to make menuconfig?

Code: Select all

cp /boot/config-`uname -r` ./.config
No, I initially downloaded kernel source and patched it with the matching RT preempt patch. I did not copy any configs. I'm not sure how I'd go about that because a different kernel version would have different menu items correct? And the preempt patch adds options for preemptive behavior. I suppose the only "working " kernel I would have to go against would be a generic kernel. Any ideas on how I can copy the 4.10 config into the 4.9rt kernel without causing issues?
Boot into a 4.10 kernel then, from the kernel sources directory:

Code: Select all

cp /boot/config-`uname -r` ./.config
That will copy the config for the running kernel, then you use menuconfig to make any other changes you need. It shouldn't affect your patch but copy the config first then apply the patch. What this method should do is guarantee that your shiny new RT kernel will have exactly the same configuration as your running kernel, plus or minus any additional changes you make. In the end, I'm suggesting this approach as one way to avoid driver issues. It shouldn't matter that you're copying a 4.10 config to a 4.9 kernel, and at worst, if it doesn't work, you'll only have to unpack the kernel sources into a clean directory.

Fair enough on the need for a RT kernel, btw.
I tried that command and I didn't quite understand the output. I actually used "make oldconfig" but you definately pointed me in the right direction. Rebooted into new RT kernel and the software rendering message is gone. Thanks.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Software rendering mode AMD and RT-preempt kernel

Post by catweazel »

blazini36 wrote: Tue Feb 13, 2018 1:39 am but you definately pointed me in the right direction. Rebooted into new RT kernel and the software rendering message is gone. Thanks.
Cool. I'm glad I could be an inspiration.

Cheers.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Locked

Return to “Graphics Cards & Monitors”