How to build master (2.92) with Optix enable?

I do not have RTX card, but have geforce then I need to build with options I suppose,.
After download “optix tool kit” from Nvidia , I followed wiki then could find “CmakeCache.txt” and edit it.
like this

OPTIX_INCLUDE_DIR:PATH=C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.2.0/include
WITH_CYCLES_DEVICE_OPTIX:BOOL=ON

But even though I edit it and save, then try to use “make release” command in console it simply ignore optix setting, (seems not use the update setting)

I do not know many about Cmake etc, (so just use bat command which wiki dsicribe for win PC) with some options. but how I can build with Optix correctly? I hope to know most easy way ^^;

I try" Manual CMake Setup " to build but when I “Configure” from Cmake CGI UI,
everytime it stop and show error “Configuring incomplete, errors occurred!”

I already have git then if I use batch command (make update, make release" it can build without problem, but I need to change configure for Optix (path) then may need to build with Cmake. So what is wrong about my set up of Cmake CGI?

I set “Source” as my local blender git source directory. and make new build directory, out side of the git directory. like this pic, then when I try to “Configure”, error occured

Hope to know correct way to build with Cmake (and change optix path )

Or I suppose if there is other setting file, which can set Optix path.
Because when I delete build directory, then make release , it seems check file and say There is no Optix path. (Cuda path seems recognized without any setting)

But I do not know which setting file is used for the batch "Make release.

In Cmake tick the Advanced checkbox up right. This reveals some more settings, including the path to Optix. First tick with Optix and run configure. It needs to run once. Now in the search field type in Optix. And you should find two entries. The checkbox to activate Optix, and the path variable. Now you just have to add the path here.

At Windows you can also add the path to the system variables when you install Optix. Then the path should be automatically found. And you don’t need to readd it in Cmake every time you clean the target folder.

Kind regards
Arunderan

optix

2 Likes

Thanks. I almost giveng up. I may try again. Then do I need to set the build directory, as you input? (when I use batch "make release"I see the release buidl directory is auto set, then I hoped to change it as more simple deirectory name like optix-test etc)

Anyway I read Cmake manuall more. (or I can not build as I need) and if I still see problem ask here again. thanks you.

The directory shown here is the default directory when you install Optix 7.0 at Windows. But this directory can differ. You need to fix it to your installation path. Or as told, add it to the system path variables. There is a newer Optix version around, 7.5. I don’t know if 7.5 already works with Blender, i still use 7.0. And at Linux you have a completely different path.

Yes I see, I know the directory which I installed optix tool kit. But I do not know clear the build directory name, as you set " build_windows_Release_x64_vc16_Release" .
So I hoped if I can use different directory name, (if I can), but when I set it as different name, I see erroer,
so now simply use same build directory.
btw now I could configure and generate, then try to compile with Cmake. (now I am waiting to finish) thanks

And yes I worrry, if 7.5 cause error or not ^^; (I happend to downlaod the version,) if it not work, re-download again, 7.0.

The binary folder is something completely different, and has nothing to do with Optix. It is where Blender gets compiled then.
The folder build_windows_Release_x64_vc16_Release is what Blender has created by running make update and make in the console. All the required files are already created.
That you get an error when you want to install elsewhere is most likely caused by that you have chosen an empty target directory. You first need to configure all settings and to build the solution file again. That’s the configure and generate buttons in Cmake.

Oh and Cuda 11 is not supported yet from what i know. Use 10.2 or better version 10.1. I had visible render artifacts with 10.2.

1 Like

Thanks I finally could compile and build. with re-install optix 7.0 , I have already installed cuda (then it seems auto find path without problem , so I need not change configure)

I still do not know what actually need, (eg cmake command to build , just copy and paste wiki discribed, )

but anyway follow your detail pic helped me a lot. thanks. ^^

1 Like

Sorry one last question. If I up-date local git of the master, after that do I need to build with cmake command line again? I suppose if I use batch “make release” to build, which already offered, may remove my current optix setting right?

And hope to know correct way to use Cmake (not use batch command) to build. without open windows visual studio.

At current I use “cmake --build . --target INSTALL --config [CONFIG]” which wiki discribed,in the build directory. (I keep to use default directory which auto generated before with batch command for" release")

So I need to use the cmake command again ? (I do not know detail of each option, like target INSTALL etc,^^; but hope to know up-date and complie + build correctly with keep same configure (activate optix) (sorry ask many quesiton,)

if you used make.bat to create your project, you should have a rebuild.cmd in your build folder to rebuild from the command line.

Do I need to use rebuild.cmd for my purpose?
I suppose you may need to detail what I hoped to know,

  1. I have used “make update” and “make release” (I suppose they are bat command which you kindly offred for basic user) to build .

  2. To build optix enable version, I download and install optix 7.0 run time from Nvidia (only the version seems work when build, or failed for me) in default path.

  3. But even though I install optix, I could not activate optix when I use “make release”.
    So I assume I need to change configure. But I failed to configure from Cmake GUI. so I asked how it work.

  4. Though I still not understand clear, but I could change cmake configure and set Optix path and activate it.

After configure and generate CMake files in build directory, I try to use “cmake --build . --target INSTALL --config release… it seems compile and build blender with optix.

  1. I update git master , by “make update”

  2. what step do I need, to build correctly with keep optix for up-date? Once I change configure of Cmake, (in step 4) I can use “make release” with keep optix enable?
    or Do I need to use Cmake command to build? or I need to use the rebuild.cmd for the purose?

(I do not know, but about other brahch which I manage with git work tree, it seems auto activate and find optix path correctly without any change. so I suppose basically if I download optix, make build will work without problem?

I have a environment variable set OPTIX_ROOT_DIR=f:\OptiXSDK7.0.0\include

with that set make release should pickup on optix with no further changes

you could also run

set OPTIX_ROOT_DIR=f:\OptiXSDK7.0.0\include
make release

(you do have to fix the path to the optix sdk, and yes the variable is called root, but it has to point to the include dir…)

Yes I know, I need to set the include path of OPTIX.
then which file I can change the enviroment variables OPTIX_ROOT_DIR
to use make release? without use set in console?

it is same, when I change the
C:…\blender-git\blender\build_files\cmake\config\blender_release.cmake
as you discribed,

set(WITH_CYCLES_DEVICE_OPTIX ON CACHE BOOL “” FORCE)
set(OPTIX_ROOT_DIR=C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.0.0\include)
?

(I suppose wiki discribed change cmake configuration, means change this config file, then maybe cmake gui can change configure, though sometimes I failed it)

Cuda11.1 is supported now.I have build with Cuda 11.1 with success.The render times are faster too now.
Notice that Cuda 11.1 is only working with sm_52 and higher.Nvidia from Maxwell and above like GTX970.

1 Like

@ pixelgrip, Great! Thanks for the info :slight_smile:

@ TakeshiFunahashi You could run the make release once, then open cmake again to set the path there. Configure, generate. And then do a make again (not make release since this would use the release settings again and may overwrite your changes). Then everything should fit.

Thanks! my discribed way seems worked too.
(edit config\blender_release.cmake) maybe when I “make release” cmake seems use the config I suppose, at current it is ok)

I could build Cuda 11.1 too. though I still not see clear difference with my old gtx 980ti ^^;

Ahhh that was my fault too, had the same problem and set OPTIX_INCLUDE_DIR as windows environment var, with no sucess. Is a bit weard …

Hi , I‘m going crazy triying to build with optix.
I did exactly what you recommendet , using version 7.0.0
set OPTIX_ROOT_DIR as mentioned.
make release still says:
Cant find Optix ( missing OPTIX_INCLUDE_DIR

As last help I set both OPTIX_INCLUDE_DIR. and OPTIX_ROOT_DIR to same existing path. c:\OptiXSDK7.0.0\include
where I installed it, but with no sucess , What am I missing ?

I don’t know, you basically shared “it doesn’t work” which is on the hard side of things to troubleshoot.

can you share the output of dir c:\OptiXSDK7.0.0\include\optix.h ?