Can CUDA be installed on FreeBSD now ?

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.
You can see the switch from Linux to FreeBSD Blender between posts #34 and #35.

At the same time, I feel like the efforts presented by shkhln are geared towards running Blender directly on FreeBSD.
Indeed.
 
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.
If you have ffmpeg with nvenc enabled, you can have obs that use the nvidia gpu for encoding
Code:
...
info: NVENC support
info: FFMPEG VAAPI supported
...
1658407779332.png
 
If you have ffmpeg with nvenc enabled, you can have obs that use the nvidia gpu for encoding
Code:
...
info: NVENC support
info: FFMPEG VAAPI supported
...
View attachment 14443

How can I enable ffmpeg + nvenc ? because I can't choose the NVIDIA NVENC H.264 as encoder. I don't have that entry. I have ony : 1) FFMPEG VAAPI 2) X264
 
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`" blender -P blender-render

the script that doesnt produce errors (but the GPU is still not available) is :
Code:
import bpy

def enable_gpus(device_type, use_cpus=False):
    preferences = bpy.context.preferences
    cycles_preferences = preferences.addons["cycles"].preferences
    cycles_preferences.refresh_devices()
    devices = cycles_preferences.devices

    if not devices:
        raise RuntimeError("Unsupported device type")

    activated_gpus = []
    for device in devices:
        if device.type == "CPU":
            device.use = use_cpus
        else:
            device.use = True
            activated_gpus.append(device.name)
            print('activated gpu', device.name)

    cycles_preferences.compute_device_type = device_type
    bpy.context.scene.cycles.device = "GPU"

    return activated_gpus


enable_gpus("CUDA")
 
How can I enable ffmpeg + nvenc ? because I can't choose the NVIDIA NVENC H.264 as encoder. I don't have that entry. I have ony : 1) FFMPEG VAAPI 2) X264
You will have to build ffmpeg with nvenc support, for that what I did was to use the following repository as a reference: https://github.com/shkhln/revird-aidivn
I just pick the directory devel/nv-codec-headers, and multimedia/ffmpeg
And then I manually updated ffmpeg so that it is up to date with what we have in the port tree (I used a merge tool for that).
 
You will have to build ffmpeg with nvenc support, for that what I did was to use the following repository as a reference: https://github.com/shkhln/revird-aidivn
I just pick the directory devel/nv-codec-headers, and multimedia/ffmpeg
And then I manually updated ffmpeg so that it is up to date with what we have in the port tree (I used a merge tool for that).

I have no idea about how to "manually update ffmpeg" without more carefully informations. In the maintime I've cloned the code.
 
We done it. That's cool. Everyone is a monster here. I like this place. How many satisfactions you give to me from 1 year. This place became like my secondary home. Very thanks to every freebsd hackers and lovers. Maybe one day we will meet in the real life if there will be some FreeBSD event in Europe. Who knows.

Screenshot_2022-07-21_16-23-10.jpg
 
So,if to enable CUDA I can only install a 3d tool from the ports and I cannot install / run it within the linuxlator,I can't try to install maya and I can't try to render any project in maya using arnold and my GPU,because the installation of maya should be made inside the linuxulator chroot. But if you can allow me to invoke the blender (or any other 3d tool) executable from within the linuxulator,in this case I can enjoy myself installing a lot of funny 3d tools,including the unreal engine.
 
I read this thread three times and I didn't understand a bit.
To use Blender I dual boot into Linux, it would be cool using Blender + Cuda into FreeBSD.

If you recap step by step what you did to achieve your goal maybe other people can benefit from your experience.

My only concern is all these hoops might make Blender quite unstable to use in a real production... 🤔
 
How much experience do you have with FreeBSD ? I think that you should take some confidence with this os,before to try complicated configurations.
 
I won't follow your configuration because I don't get the point of many things you do, but this thread is messed up, if you recap and reorganize your stuff maybe some other person can benefit from your experience as you do from other places, think about it before to reply non-sense... 🤦‍♂️
 
Try this :

Code:
pkg install linux-nvidia-libs libc6-shim blender


copy the precompiled Cycles CUDA kernels located on the folder "/blender-3.2.1-linux-x64/3.2/scripts/addons/cycles/lib/"


of this zipped file : https://download.blender.org/release/Blender3.2/blender-3.2.1-linux-x64.tar.xz


into this folder :


/usr/local/share/blender/3.2/scripts/addons/cycles/lib


patch libc6-shim to implement openat : https://github.com/monwarez/libc6-shim/commit/7e3dffc13d33e03cd18904c6e711595b5ade72e0


git clone https://github.com/shkhln/libc6-shim.git


cd 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
 
Seriously,man : we have a different idea about what's the meaning of "spam". I suspect that you make some confusion between some expressed opinions,more or less consistent with the topic and the repeated and unwanted messages for commercial purposes. In my opinion,this is spam. And the messages,even if not strictly related to the topic,they lack of the commercial purpose,so they aren't spam,but some kind of "temporary digressions".
 
It is also physiological to talk about other aspects not strictly related to technicality, because we are not robots. Who spams wants to make money or he wants to cause annoyance to someone else. For these reasons the meaning assigned to the term spam is negative. Whoever talks about other things does so because his mind contains many more elements and interests than simple purely technical reasoning and these elements sooner or later,they will come out,no matter where you are. If they are deemed psychologically important, they will emerge.
 
Digression ended. I'm trying to launch maya (one year educational license for linux) using the same tecnique explained by shkhln because I would like that it recognises the CUDA libraries,but I'm doing something bad. Infact :
Code:
# export PATH="$PATH:/compat/ubuntu/usr/Autodesk/maya/bin"

mario@marietto:/home/marietto/Desktop/Files/CUDA/libc6-shim/bin # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin:/compat/ubuntu/usr/Autodesk/maya/bin

mario@marietto:/home/marietto/Desktop/Files/CUDA/libc6-shim/bin # ./nv-sglrun maya

/home/marietto/Desktop/Files/CUDA/libc6-shim/bin/with-glibc-shim:34:in `exec': No such file or directory - maya (Errno::ENOENT)
from /home/marietto/Desktop/Files/CUDA/libc6-shim/bin/with-glibc-shim:34:in `<main>'

buy why it says "No such file or directory" if I have saved the folder where is located the maya executable inside the current FreeBSD PATH ?

Infact the maya executable is located here : /compat/ubuntu/usr/local/bin/maya

when I invoke maya within the linux chroot as root this is what happens :

root@marietto:/usr/local/bin# ./maya
Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed

as normal user :

root@marietto:/usr/local/bin# su - marietto

$ maya

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

/usr/local/bin/maya: line 220: 73951 Aborted                 /usr/Autodesk/maya/bin/maya.bin

no way,but I think that all of those errors depend about my ignorance. I feel to be close to the solution,but I still need some help from you.
 
Back
Top