Can CUDA be installed on FreeBSD now ?

inside the centos distribution installed by shkhln a lot of components are missing.
I'm not doing anything unusual. If I don't have something I simply make a port for it on the spot using some existing linux-c7-* port as a template. That doesn't mean I want to submit those ports to the collection or maintain them.
 
ok. you can do whatever you want. But what I should I do now ? I've reached the end of your tutorial and I would like to know what to do to allow Blender to recognizes the CUDA libraries. I would like to render my projects using CUDA on FreeBSD. This would be very nice.
 
Maybe I have understood. The nvcc compiler is for you. But for me as final user,it is not useful,right ? According with the picture below,it just works like this. It seems that it recognizes CUDA without doing anything else. (In my case it does not work because I'm using the intel gpu as primary,I suppose). So,very very thanks. To be able to do this has been my first desire when I've jumped from Linux to FreeBSD. You are cool.

PS : maybe I will try to see if I can render even with the trial of Arnold / Maya 2022. So cool,man to use Maya on FreeBSD.


Screenshot_2022-07-20_21-52-00.jpg
 
In every 2nd thread of yours you tell us that you are poor and don't have money. But you can afford several thousands of Euros a year to run Maya? :-/

Do you really think that I can and I want to spend 2000 euros to buy the maya license ? Even if I was rich. I'm talking about the trial,that should be the student license. If should allow to use Maya for free for 1 year.
 
You aren't even starting Blender with the nv-sglrun script as you were explicitly told. What gives?

Code:
# ./nv-sglrun /compat/ubuntu/usr/bin/blender

/compat/ubuntu/usr/bin/blender: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory
 
Also try
Code:
% sh
$ env LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" blender

Code:
sh

env LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" blender
shim init

XDG_RUNTIME_DIR (/var/run/user/1001) is not owned by us (uid 0), but by uid 1001! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

and Blender started. I forgot to write sh :p
 
Code:
# nv-sglrun blender

shim init
XDG_RUNTIME_DIR (/var/run/user/1001) is not owned by us (uid 0), but by uid 1001! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don'tdo that.)

shim_openat is not implemented
0x815d3be24 <openat+0x44> at /usr/local/lib/libc6-shim/libc6.so
0x816c72cea <_nv011glcore+0x2922a> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c62213 <_nv011glcore+0x18753> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c716f8 <_nv011glcore+0x27c38> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x811c7ddce <vk_icdNegotiateLoaderICDInterfaceVersion+0x60e> at /root/.cache/nv-sglrun/78c27f68033b2
8c791e31ce5c83474e38a55302492834452fdbf39e3f210fb63_libGLX_nvidia.so.510.60.02.patched
0x811c7ee78 <vk_icdNegotiateLoaderICDInterfaceVersion+0x16b8> at /root/.cache/nv-sglrun/78c27f68033b
28c791e31ce5c83474e38a55302492834452fdbf39e3f210fb63_libGLX_nvidia.so.510.60.02.patched
0x811c6150c <glXCreateGLXPbufferSGIX+0x7eac> at /root/.cache/nv-sglrun/78c27f68033b28c791e31ce5c8347
4e38a55302492834452fdbf39e3f210fb63_libGLX_nvidia.so.510.60.02.patched
0x816c4a036 <_nv011glcore+0x576> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c4bdb9 <_nv011glcore+0x22f9> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c90047 <_nv012glcore+0x3397> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c4d9c5 <_nv011glcore+0x3f05> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x811c25423 <???> at /root/.cache/nv-sglrun/78c27f68033b28c791e31ce5c83474e38a55302492834452fdbf39e3f210fb63_libGLX_nvidia.so.510.60.02.patched
0x811c6095f <glXCreateGLXPbufferSGIX+0x72ff> at /root/.cache/nv-sglrun/78c27f68033b28c791e31ce5c83474e38a55302492834452fdbf39e3f210fb63_libGLX_nvidia.so.510.60.02.patched
0x3a298c4 <_ZN16GHOST_ContextGLX24initializeDrawingContextEv+0x3c4> at /usr/local/bin/blender-bin
0x3a2845c <_ZN15GHOST_WindowX1117newDrawingContextE25GHOST_TDrawingContextType+0x9c> at /usr/local/bin/blender-bin
0x3a24272 <_ZN12GHOST_Window21setDrawingContextTypeE25GHOST_TDrawingContextType+0x42> at /usr/local/bin/blender-bin
0x3a26086<_ZN15GHOST_WindowX11C1EP15GHOST_SystemX11P9_XDisplayPKciijj18GHOST_TWindowStatePS_25GHOST_TDrawingContextTypebbbbb+0x8d6> at /usr/local/bin/blender-bin
0x3a1c16a<_ZN15GHOST_SystemX1112createWindowEPKciijj18GHOST_TWindowState25GHOST_TDrawingContextType16GHOST_GLSettingsbbPK13GHOST_IWindow+0x9a> at /usr/local/bin/blender-bin
0x3a1a126 <GHOST_CreateWindow+0x46> at /usr/local/bin/blender-bin
0x28e9feb <wm_window_ghostwindows_ensure+0x23b> at /usr/local/bin/blender-bin
0x28e9e2d <wm_window_ghostwindows_ensure+0x7d> at /usr/local/bin/blender-bin
0x28a34d3 <WM_check+0xb3> at /usr/local/bin/blender-bin
0x28b5fde <wm_homefile_read_ex+0x81e> at /usr/local/bin/blender-bin
0x28d06f7 <WM_init+0x157> at /usr/local/bin/blender-bin

Assertion failed: (0), function shim_openat, file build/wrappers64.c, line 28381.
Abort trap (core dumped)
 
Code:
# ./nv-sglrun /compat/ubuntu/usr/bin/blender

/compat/ubuntu/usr/bin/blender: error while loading shared libraries: libtbb.so.2: cannot open shared object file: No such file or directory
We aren't talking about the Linux Blender package.

Code:
sh

env LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" blender
shim init

XDG_RUNTIME_DIR (/var/run/user/1001) is not owned by us (uid 0), but by uid 1001! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

and Blender started. I forgot to write sh :p
That's probably good enough, although I don't see the reason to run that application as root. Now you should see the GPU in the settings. What about the compiler?

Code:
Assertion failed: (0), function shim_openat, file build/wrappers64.c, line 28381.
Meh. Not relevant to this use case.
 
Code:
[marietto@marietto ~/Desktop/Files/CUDA/libc6-shim/bin]$ ./nv-sglrun /usr/local/bin/blender

shim init
shim_openat is not implemented
0x815d3c384 <openat+0x44> at /home/marietto/Desktop/Files/CUDA/libc6-shim/lib64/libc6.so
0x816c72cea <_nv011glcore+0x2922a> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c62213 <_nv011glcore+0x18753> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c716f8 <_nv011glcore+0x27c38> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x811c7ddce <vk_icdNegotiateLoaderICDInterfaceVersion+0x60e> at /compat/linux/usr/lib64/libGLX_nvidi
a.so.510.60.02
0x811c7ee78 <vk_icdNegotiateLoaderICDInterfaceVersion+0x16b8> at /compat/linux/usr/lib64/libGLX_nvid
ia.so.510.60.02
0x811c6150c <glXCreateGLXPbufferSGIX+0x7eac> at /compat/linux/usr/lib64/libGLX_nvidia.so.510.60.02
0x816c4a036 <_nv011glcore+0x576> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c4bdb9 <_nv011glcore+0x22f9> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c90047 <_nv012glcore+0x3397> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x816c4d9c5 <_nv011glcore+0x3f05> at /compat/linux/usr/lib64/libnvidia-glcore.so.510.60.02
0x811c25423 <???> at /compat/linux/usr/lib64/libGLX_nvidia.so.510.60.02
0x811c6095f <glXCreateGLXPbufferSGIX+0x72ff> at /compat/linux/usr/lib64/libGLX_nvidia.so.510.60.02
0x3a298c4 <_ZN16GHOST_ContextGLX24initializeDrawingContextEv+0x3c4> at /usr/local/bin/blender-bin
0x3a2845c <_ZN15GHOST_WindowX1117newDrawingContextE25GHOST_TDrawingContextType+0x9c> at /usr/local/b
in/blender-bin
0x3a24272 <_ZN12GHOST_Window21setDrawingContextTypeE25GHOST_TDrawingContextType+0x42> at /usr/local/
bin/blender-bin
0x3a26086 <_ZN15GHOST_WindowX11C1EP15GHOST_SystemX11P9_XDisplayPKciijj18GHOST_TWindowStatePS_25GHOST
_TDrawingContextTypebbbbb+0x8d6> at /usr/local/bin/blender-bin
0x3a1c16a <_ZN15GHOST_SystemX1112createWindowEPKciijj18GHOST_TWindowState25GHOST_TDrawingContextType
16GHOST_GLSettingsbbPK13GHOST_IWindow+0x9a> at /usr/local/bin/blender-bin
0x3a1a126 <GHOST_CreateWindow+0x46> at /usr/local/bin/blender-bin
0x28e9feb <wm_window_ghostwindows_ensure+0x23b> at /usr/local/bin/blender-bin
0x28e9e2d <wm_window_ghostwindows_ensure+0x7d> at /usr/local/bin/blender-bin
0x28a34d3 <WM_check+0xb3> at /usr/local/bin/blender-bin
0x28b5fde <wm_homefile_read_ex+0x81e> at /usr/local/bin/blender-bin
0x28d06f7 <WM_init+0x157> at /usr/local/bin/blender-bin
Assertion failed: (0), function shim_openat, file build/wrappers64.c, line 28381.
Abort trap

Code:
[marietto@marietto ~/Desktop/Files/CUDA/libc6-shim/bin]$ sh
marietto@marietto:~/Desktop/Files/CUDA/libc6-shim/bin $ env LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" blender
shim init


Screenshot_2022-07-21_00-55-20.jpg
 
Code:
# ./nv-sglrun clpeak

shim init

Platform: NVIDIA CUDA
Device: NVIDIA GeForce RTX 2080 Ti
Driver version  : 510.60.02 (FreeBSD)
Compute units   : 68
Clock frequency : 1545 MHz

Global memory bandwidth (GBPS)
float   : 505.37
float2  : 533.31
float4  : 549.07
float8  : 551.19
float16 : 490.40

Single-precision compute (GFLOPS)
float   : 16545.49
float2  : 16510.95
float4  : 16474.07
float8  : 16404.12
float16 : 16286.54

No half precision support! Skipped

Double-precision compute (GFLOPS)
double   : 517.78
double2  : 517.22
double4  : 515.99
double8  : 513.54
double16 : 508.64

Integer compute (GIOPS)
int   : 14938.30
int2  : 14721.25
int4  : 14851.60
int8  : 14891.99
int16 : 14646.05

Integer compute Fast 24bit (GIOPS)
int   : 14399.28
int2  : 14631.37
int4  : 14689.85
int8  : 14741.36
int16 : 14586.65

Transfer bandwidth (GBPS)
enqueueWriteBuffer              : 6.14
enqueueReadBuffer               : 6.51
enqueueWriteBuffer non-blocking : 6.03
enqueueReadBuffer non-blocking  : 6.41
enqueueMapBuffer(for read)      : 6.24
memcpy from mapped ptr        : 11.54
enqueueUnmap(after write)       : 6.50
memcpy to mapped ptr          : 11.46

Kernel launch latency : 5.64 us

Device: NVIDIA GeForce GTX 1060 3GB
Driver version  : 510.60.02 (FreeBSD)
Compute units   : 9
Clock frequency : 1708 MHz

Global memory bandwidth (GBPS)
float   : 149.99
float2  : 156.75
float4  : 159.40
float8  : 159.04
float16 : 103.58

Single-precision compute (GFLOPS)
float   : 4043.46
float2  : 4169.39
float4  : 4156.42
float8  : 4129.98
float16 : 4111.27

No half precision support! Skipped

Double-precision compute (GFLOPS)
double   : 133.86
double2  : 133.51
double4  : 133.19
double8  : 132.91
double16 : 131.64

Integer compute (GIOPS)
int   : 1355.11
int2  : 1348.88
int4  : 1350.11
int8  : 1256.30
int16 : 1231.96

Integer compute Fast 24bit (GIOPS)
int   : 1350.68
int2  : 1341.06
int4  : 1345.51
int8  : 1340.86
int16 : 1323.04

Transfer bandwidth (GBPS)
enqueueWriteBuffer              : 1.52
enqueueReadBuffer               : 1.64
enqueueWriteBuffer non-blocking : 1.50
enqueueReadBuffer non-blocking  : 1.63
enqueueMapBuffer(for read)      : 1.63
memcpy from mapped ptr        : 11.91
enqueueUnmap(after write)       : 1.53
memcpy to mapped ptr          : 12.02

Kernel launch latency : 6.94 us
 
I've applied the @monwarez patches and I gave a make : I didn't see errors. I hope that I made the right choice, shkhln...

If I remember correctly,blender will not recognize the Nvidia gpu until it becomes the main gpu and now my main gpu is the intel. There is a trick to do this but I don't remember.
 
Let's try env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" blender then.
 
No compatible GPUs found for Cycles. Requires NVIDIA GPU with compute capacibility 3.0.
I would like to exclude that this is not a specific behavior of Blender. Do you know another CG tool that could use the nvida gpu ? Maybe OBS,but there should be written somewhere,in the OBS parameters that it is using the nvidia gpu.
 
Bingo !
Code:
[marietto@marietto ~/Desktop/Files/CUDA/libc6-shim/bin]$ env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" obs

shim init

Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/local/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /usr/local/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/local/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
info: CPU Speed: 3600.00MHz
info: Physical Cores: 8, Logical Cores: 16
info: Physical Memory: 31615MB Total, 26159MB Free
info: Kernel Version: FreeBSD 13.1-RELEASE
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.14
info: Qt Version: 5.15.5 (runtime), 5.15.5 (compiled)
info: Portable mode: false
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/local/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_tbar_position_valueChanged(int)
QMetaObject::connectSlotsByName: No matching signal for on_actionShowTransitionProperties_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_actionHideTransitionProperties_triggered()
info: OBS 27.2.4 (freebsd)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
        samples per sec: 48000
        speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2
info: OpenGL loaded successfully, version 3.3.0 NVIDIA 510.60.02, shading language 3.30 NVIDIA via Cg compiler
info: ---------------------------------

So,the mystery is still unresolved. Why OBS detects the RTX-2080 Ti and blender does not.
 
This post might very well be unnecessary but just in case: I get the feeling that OP is running blender inside of Linux - either via a VM with patched GPU passthrough, via a Linux jail or just Linux compatibility layer.
At the same time, I feel like the efforts presented by shkhln are geared towards running Blender directly on FreeBSD.

Are you guys talking the same scenarios here?
 
This post might very well be unnecessary but just in case: I get the feeling that OP is running blender inside of Linux - either via a VM with patched GPU passthrough, via a Linux jail or just Linux compatibility layer.
At the same time, I feel like the efforts presented by shkhln are geared towards running Blender directly on FreeBSD.

Are you guys talking the same scenarios here?

Nope. I'm out of any jail and I don't use the Linuxlator. I've installed blender and obs from the freebsd ports.

Code:
[marietto@marietto ~/Desktop/Files/CUDA/libc6-shim/bin]$ uname -a
FreeBSD marietto 13.1-RELEASE FreeBSD 13.1-RELEASE n250232-e981f9a8e335 GENERIC amd64

[marietto@marietto ~/Desktop/Files/CUDA/libc6-shim/bin]$ env __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia LD_LIBMAP="`nv-sglrun printenv LD_LIBMAP | grep -v libGL`" blender
 
Back
Top