Python tensorflow cuda

Hi all i want to try some coding with python tensorflow in cuda mode but all failed.

I have install python-tensorflow-cuda 2.15.0-6

The python tensorflow package is reporting missing build flags if i have well understand.

In python on cli trying just one tf instance give this:

import tensorflow as tf


2024-04-13 20:26:40.802157: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered

2024-04-13 20:26:40.802204: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered

2024-04-13 20:26:40.803005: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered

2024-04-13 20:26:40.809798: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.

To enable the following instructions: SSE3 SSE4.1 SSE4.2, in other operations, rebuild TensorFlow with the appropriate compiler flags.

I have try many several reinstall and others trick but all failed !.
So finally i have to build myself the package with the goods flags ?

Have a nice day.


Moderator edit: In the future, please use proper formatting: [HowTo] Post command output and file content as formatted text

post the output of

echo $XDG_SESSION_TYPE && glxinfo | grep server

and

inxi --admin --verbosity=7 --filter --no-host --width

and

pamac search cuda | grep Inst
 $XDG_SESSION_TYPE && glxinfo | grep server

 x11
 server glx vendor string: NVIDIA Corporation
 server glx version string: 1.4
 server glx extensions:


$  inxi --admin --verbosity=7 --filter --no-host --width

 System:
   Kernel: 6.6.26-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
     clocksource: tsc avail: hpet,acpi_pm
     parameters: BOOT_IMAGE=/boot/vmlinuz-6.6-x86_64
     root=UUID=w quiet apparmor=1
     nvidia_drm.modeset=1 security=apparmor udev.log_priority=3
   Desktop: GNOME v: 45.4 tk: GTK v: 3.24.41 wm: gnome-shell
     tools: gsd-screensaver-proxy avail: light-locker dm: GDM v: 45.0.1
     Distro: Manjaro base: Arch Linux
 Machine:
   Type: Desktop System: Hewlett-Packard product: HP Z800 Workstation v: N/A
     serial: <superuser required> Chassis: type: 6 serial: <superuser required>
   Mobo: Hewlett-Packard model: 0AECh v: D serial: <superuser required>
     part-nu: FF825AV uuid: <superuser required> BIOS: Hewlett-Packard
     v: 786G5 v03.60 date: 02/24/2016
 Battery:
   Message: No system battery data found. Is one present?
 Memory:
   System RAM: total: 96 GiB available: 94.37 GiB used: 19.51 GiB (20.7%)
   Message: For most reliable report, use superuser + dmidecode.
   Array-1: capacity: 104 GiB note: est. slots: 13 modules: 13

     manufacturer: JEDEC ID:80 AD part-no: serial: <filter>
   Device-11: CPU1 DIMM5 type: DDR3 detail: synchronous registered (buffered)
     size: 8 GiB speed: 1333 MT/s volts: N/A width (bits): data: 64 total: 72
     manufacturer: JEDEC ID:80 2C part-no:  serial: <filter>
   Device-12: CPU1 DIMM6 type: DDR3 detail: synchronous registered (buffered)
     size: 8 GiB speed: 1333 MT/s volts: N/A width (bits): data: 64 total: 72
     manufacturer: JEDEC ID:80 AD part-no:  serial: <filter>
   Device-13: SYSTEM ROM type: Flash detail: non-volatile size: 2 MiB
     speed: N/A volts: N/A width (bits): data: 2 total: 2 manufacturer: N/A
     part-no: N/A serial: N/A
 CPU:
   Info: model: Intel Xeon X5675 bits: 64 type: MT MCP SMP arch: Nehalem
     level: v2 built: 2008-10 process: Intel 45nm family: 6 model-id: 0x2C (44)
     stepping: 2 microcode: 0x1F
   Topology: cpus: 2x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
     L1: 2x 384 KiB (768 KiB) desc: d-6x32 KiB; i-6x32 KiB L2: 2x 1.5 MiB (3 MiB)
     desc: 6x256 KiB L3: 2x 12 MiB (24 MiB) desc: 1x12 MiB
   Speed (MHz): avg: 2024 high: 3064 min/max: 1596/3060 boost: enabled
     scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1598 2: 1598
     3: 1596 4: 1596 5: 1596 6: 1596 7: 3063 8: 1596 9: 3064 10: 3063 11: 3063
     12: 1596 13: 1598 14: 1598 15: 1596 16: 1598 17: 1598 18: 1596 19: 3063
     20: 1596 21: 1596 22: 3064 23: 1596 24: 3063 bogomips: 147101
   Flags: acpi aes aperfmperf apic arat arch_perfmon bts clflush cmov
     constant_tsc cpuid cx16 cx8 dca de ds_cpl dtes64 dtherm dts epb ept est
     flexpriority flush_l1d fpu fxsr ht ibpb ibrs ida lahf_lm lm mca mce mmx
     monitor msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm
     pdpe1gb pebs pge pni popcnt pse pse36 pti rdtscp rep_good sep smx ssbd sse
     sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc vme vmx vnmi
     vpid xtopology xtpr
   Vulnerabilities:
   Type: gather_data_sampling status: Not affected
   Type: itlb_multihit status: KVM: VMX disabled
   Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
     vulnerable
   Type: mds status: Vulnerable: Clear CPU buffers attempted, no microcode;
     SMT vulnerable
   Type: meltdown mitigation: PTI
   Type: mmio_stale_data status: Unknown: No mitigations
   Type: reg_file_data_sampling status: Not affected
   Type: retbleed status: Not affected
   Type: spec_rstack_overflow status: Not affected
   Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
     prctl
   Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
     sanitization
   Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;
     STIBP: conditional; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not
     affected
  Type: srbds status: Not affected
   Type: tsx_async_abort status: Not affected
 Graphics:
   Device-1: NVIDIA GA102 [GeForce RTX 3090] driver: nvidia v: 550.67
     alternate: nouveau,nvidia_drm non-free: 545.xx+ status: current (as of
     2024-02; EOL~2026-12-xx) arch: Ampere code: GAxxx process: TSMC n7 (7nm)
     built: 2020-2023 pcie: gen: 1 speed: 2.5 GT/s lanes: 16 link-max: gen: 4
     speed: 16 GT/s ports: active: none off: DP-1,DP-2,DP-3 empty: HDMI-A-1
     bus-ID: 0f:00.0 chip-ID: 10de:2204 class-ID: 0300
   Display: x11 server: X.Org v: 21.1.12 with: Xwayland v: 23.2.6
     compositor: gnome-shell driver: X: loaded: nvidia
     unloaded: modesetting,nouveau alternate: fbdev,nv,vesa
     gpu: nvidia,nvidia-nvswitch display-ID: :1 screens: 1
   Screen-1: 0 s-res: 3200x1080 s-dpi: 96 s-size: 847x286mm (33.35x11.26")
     s-diag: 894mm (35.2")
   Monitor-1: DP-1 note: disabled pos: left model: NEC LCD195VXM+
     serial: <filter> built: 2009 res: 1280x1024 hz: 60 dpi: 86 gamma: 1.2
     size: 376x301mm (14.8x11.85") diag: 482mm (19") ratio: 5:4 modes:
     max: 1280x1024 min: 640x480
   Monitor-2: not-matched mapped: DP-3 size-res: N/A modes: N/A
   Monitor-3: not-matched mapped: DP-4 pos: primary,right res: 1920x1080
     hz: 60 dpi: 92 size: 531x299mm (20.91x11.77") diag: 609mm (23.99") modes: N/A
   API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2
     drv: swrast gbm: drv: nvidia surfaceless: drv: nvidia x11: drv: nvidia
     inactive: wayland,device-1
   API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.67 glx-v: 1.4
     direct-render: yes renderer: NVIDIA GeForce RTX 3090/PCIe/SSE2
     memory: 23.44 GiB
   API: Vulkan v: 1.3.279 layers: 14 device: 0 type: discrete-gpu
     name: NVIDIA GeForce RTX 3090 driver: nvidia v: 550.67 device-ID: 10de:2204
     surfaces: xcb,xlib
 Audio:
   Device-1: Intel 82801JI HD Audio vendor: Hewlett-Packard
     driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:3a3e
     class-ID: 0403
   Device-2: NVIDIA GA102 High Definition Audio driver: snd_hda_intel
     v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 16 link-max: gen: 4
     speed: 16 GT/s bus-ID: 0f:00.1 chip-ID: 10de:1aef class-ID: 0403
   API: ALSA v: k6.6.26-1-MANJARO status: kernel-api with: aoss
     type: oss-emulator tools: alsactl,alsamixer,amixer
   Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
   Server-2: JACK v: 1.9.22 status: off tools: cadence,jack_control,qjackctl
   Server-3: PipeWire v: 1.0.3 status: off tools: pw-cli
   Server-4: PulseAudio v: 17.0 status: active with: 1: pulseaudio-alsa
     type: plugin 2: pulseaudio-jack type: module tools: pacat,pactl
 Network:
   Device-1: Broadcom NetXtreme BCM5764M Gigabit Ethernet PCIe
     vendor: Hewlett-Packard driver: tg3 v: kernel pcie: gen: 1 speed: 2.5 GT/s
     lanes: 1 port: N/A bus-ID: 01:00.0 chip-ID: 14e4:1684 class-ID: 0200
   IF: enp1s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
   IP v4: <filter> type: dynamic noprefixroute scope: global
     broadcast: <filter>
   IP v6: <filter> type: dynamic noprefixroute scope: global
   IP v6: <filter> type: noprefixroute scope: link
   Device-2: Broadcom NetXtreme BCM5764M Gigabit Ethernet PCIe
     vendor: Hewlett-Packard driver: tg3 v: kernel pcie: gen: 1 speed: 2.5 GT/s
     lanes: 1 port: N/A bus-ID: 02:00.0 chip-ID: 14e4:1684 class-ID: 0200
   IF: enp2s0 state: down mac: <filter>
   Info: services: NetworkManager, sshd, systemd-timesyncd, wpa_supplicant
   WAN IP: <filter>
 Bluetooth:
  Message: No bluetooth data found.
 Logical:
   Message: No logical block device data found.
 RAID:
   Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0 port: c0c0
     bus-ID: 00:1f.2 chip-ID: 8086:2822 rev: class-ID: 0104


 Swap:
  
 USB:
   Hub-1: 1-0:1 info: full speed or root hub ports: 2 rev: 1.1
     speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 chip-ID: 1d6b:0001
    class-ID: 0900
   Hub-2: 2-0:1 info: full speed or root hub ports: 2 rev: 1.1
     speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 chip-ID: 1d6b:0001
     class-ID: 0900
   Hub-3: 3-0:1 info: full speed or root hub ports: 2 rev: 1.1
     speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 chip-ID: 1d6b:0001
     class-ID: 0900
   Hub-4: 4-0:1 info: full speed or root hub ports: 6 rev: 2.0
     speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
     class-ID: 0900
   Hub-5: 5-0:1 info: full speed or root hub ports: 6 rev: 2.0
     speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
     class-ID: 0900
   Hub-6: 6-0:1 info: full speed or root hub ports: 2 rev: 1.1
     speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 chip-ID: 1d6b:0001
     class-ID: 0900
   Device-1: 6-2:2 info: Microsoft Natural Ergonomic Keyboard 4000 V1.0
     type: keyboard,HID driver: microsoft,usbhid interfaces: 2 rev: 2.0
     speed: 1.5 Mb/s (183 KiB/s) lanes: 1 mode: 1.0 power: 100mA
     chip-ID: 045e:00db class-ID: 0300
   Hub-7: 7-0:1 info: full speed or root hub ports: 2 rev: 1.1
     speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 chip-ID: 1d6b:0001
     class-ID: 0900
   Device-1: 7-2:2 info: Pixart Imaging Optical Mouse type: mouse
     driver: hid-generic,usbhid interfaces: 1 rev: 1.1 speed: 1.5 Mb/s (183 KiB/s)
     lanes: 1 mode: 1.0 power: 100mA chip-ID: 093a:2510 class-ID: 0301
   Hub-8: 8-0:1 info: full speed or root hub ports: 2 rev: 1.1
     speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1 chip-ID: 1d6b:0001
     class-ID: 0900
   Hub-9: 9-0:1 info: hi-speed hub with single TT ports: 2 rev: 2.0
     speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
     class-ID: 0900
   Hub-10: 10-0:1 info: super-speed hub ports: 2 rev: 3.1
     speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
     class-ID: 0900
   Hub-11: 11-0:1 info: hi-speed hub with single TT ports: 1 rev: 2.0
     speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
     class-ID: 0900
   Hub-12: 11-1:2 info: VIA Labs Hub ports: 4 rev: 2.1
     speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 power: 100mA
     chip-ID: 2109:3431 class-ID: 0900
   Hub-13: 11-1.2:3 info: VIA Labs VL813 Hub ports: 4 rev: 2.1
     speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 2109:2813
     class-ID: 0900
    Hub-14: 12-0:1 info: super-speed hub ports: 4 rev: 3.0
     speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 1d6b:0003
     class-ID: 0900
   Hub-15: 12-2:2 info: VIA Labs VL813 Hub ports: 4 rev: 3.0
    speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 2109:0813
     class-ID: 0900
 Sensors:
   System Temperatures: cpu: 35.0 C mobo: N/A gpu: nvidia temp: 37 C
   Fan Speeds (rpm): N/A gpu: nvidia fan: 0%
 Info:
   Processes: 499 Power: uptime: 6h 29m states: freeze,mem,disk suspend: deep
     avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
     suspend, test_resume image: 37.71 GiB services: gsd-power,
     power-profiles-daemon, upowerd Init: systemd v: 255 default: graphical
     tool: systemctl
    Packages: 3614 pm: dpkg pkgs: 0 pm: pacman pkgs: 3610 libs: 531
     tools: gnome-software, octopi, pacaur, pamac, yay pm: flatpak pkgs: 4
     Compilers: clang: 16.0.6 gcc: 13.2.1 alt: 12 Shell: Zsh v: 5.9
     running-in: gnome-terminal inxi: 3.3.33

 pamac search cuda | grep Inst

 lib32-icu  74.2-1 [Installés]                                           multilib
 icu  74.2-1 [Installés]                                                     core
 tensorflow-cuda  2.15.0-6 [Installés]                                      extra
 python-tensorflow-cuda  2.15.0-6 [Installés]                               extra
 python-pytorch-cuda  2.2.0-2 [Installés]                                   extra
 python-pycuda  2022.2.2-4 [Installés]                                      extra
 python-cuda  12.1.0-2 [Installés]                                          extra
 ollama-cuda-git  0.1.32.gcb03fc95-1 [Installés]                              AUR
 magma-cuda  2.7.2-3 [Installés]                                            extra
 koboldcpp-cuda  1.62.2-1 [Installés]                                         AUR
 cuda-tools  12.3.2-1 [Installés]                                           extra
 cuda  12.3.2-1 [Installés]                                                 extra


Please edit your last reply accordingly.

well so far the basics are okay, the nvidia gpu is active, the packages are installed. but if you check with an internet-search-engine for

Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered

you’ll find a lot of answers. so far it is not an manjaro-related problem. i would suggest that you search for this and get more information in forums of python and cuda/nvidia to solve the configuration.

Excuse me ! I have bad click to fast to post ! And you are too fast to view and haven’t time to finish the re edit formatting. apologised. Wonderfull POwer Yochanan. regards;

Thanks Olli !
I have ever search about this but anything work. So i must mistake something . But i have this working since some weeks before…but i have done so many things since this time. So i was thinking perhaps a problem with an eventually upgraded package. But you says definitely not. So i continue to investigate.

please be aware that using pip and python in an excessive way can always end up in a clash. it happens too often that using this python packages end up in a broken system. i can give you only this tips you should search for:
first:
always use virtual python environments using the “venv” method
second:
use a virtual machine and install your test-bench inside there. use kvm/qemu (yes it’s more than a little bit work to get used to it). then do a gpu-passtrough (in this case your virtual machine uses the real-gpu for access) and you can use cuda.
you install a basic working vm (virtual-machine) and always start with a copy of your preconfigured vm. THEN you can play with it and if it crashes have a smile, delete the broken vm and start with a new copy.


https://www.youtube.com/@PavolElsig/videos