From: Vermaas, Josh (vermaasj_at_msu.edu)
Date: Fri Jul 26 2024 - 10:21:01 CDT

Hi Chris,

For a57, you NEED OptiX 6.5.0 or earlier. NVIDIA changed the API for OptiX pretty substantially, and while John has a re-apied source somewhere, it isn't released for public consumption. This has a few other quirks when you compile with CUDA 12:

CUDA 12 removed the deprecated float_as_int and int_as_float functions, and instead everyone is supposed to use __float_as_int and __int_as_float. This is great and all, except that since public versions of VMD use the API from OptiX 6.5, the header still references float_as_int and int_as_float, which means that compilation with CUDA 12 no longer works out of the box, as nvcc gets angry at OptiXShaders.cu. This is my fix, which is a little macro definition in OptiXShaders.cu before loading in optixu/optixu_math_namespace.h

//Workaround for CUDA 12 together with OptiX 6.5
#if __CUDACC_VER_MAJOR__ >= 12
#define float_as_int __float_as_int
#define int_as_float __int_as_float
#endif

#include <optixu/optixu_math_namespace.h>

-Josh

On 7/26/24, 2:33 AM, "owner-vmd-l_at_ks.uiuc.edu <mailto:owner-vmd-l_at_ks.uiuc.edu> on behalf of Chris Taylor" <owner-vmd-l_at_ks.uiuc.edu <mailto:owner-vmd-l_at_ks.uiuc.edu> on behalf of cht_at_imipolex-g.com <mailto:cht_at_imipolex-g.com>> wrote:

Using the vmd-1.9.4a57 VMD source and this compiler:

Apptainer> /usr/local/cuda/bin/nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Mar_28_02:18:24_PDT_2024
Cuda compilation tools, release 12.4, V12.4.131
Build cuda_12.4.r12.4/compiler.34097967_0

These are my configure.options:
LINUXAMD64 CUDA MPI LIBOPTIX LIBPNG ZLIB TCL PTHREADS

I downloaded and configured in NVIDIA-OptiX-SDK-7.5.0-linux64-x86_64 and I get this error building:

Compiling VMDMPI.C --> VMDMPI.o ...
echo "Compiling " OptiXDisplayDevice.C " --> " OptiXDisplayDevice.o " ..."; \
g++ -m64 -fno-for-scope -Wno-deprecated -Wall -Wno-unknown-pragmas -O6 -ffast-math -DARCH_LINUXAMD64 -DVMDCUDA -DMSMPOT_CUDA -DVMDMPI -DVMDLIBOPTIX -DVMDLIBPNG -DVMDTHREADS -DWKFTHREADS -DUSEPOSIXTHREADS -D_REENTRANT -DVMDZLIB -DVMDQUICKSURF -DVMDWITHCARBS -DVMDPOLYHEDRA -DVMDSURF -DVMDMSMS -DVMDNANOSHAPER -DVMDLATTICECUBES -DVMDTCL -DVMDSTATICPLUGINS -I/opt/ompi/include -I/opt/NVIDIA-OptiX-SDK-7.5.0-linux64-x86_64/include -I/usr/local/cuda/include -I/usr/include/libpng16/ -I/usr/include -I/usr/local/include -I../plugins/include -I../plugins/LINUXAMD64/molfile -I. -c OptiXDisplayDevice.C -o ../LINUXAMD64/OptiXDisplayDevice.o
Compiling OptiXDisplayDevice.C --> OptiXDisplayDevice.o ...
In file included from OptiXDisplayDevice.C:79:
OptiXRenderer.h:84:10: fatal error: optix_math.h: No such file or directory
84 | #include <optix_math.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:510: OptiXDisplayDevice.o] Error 1
FATAL: While performing build: while running engine: exit status 2

I downloaded NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64 and 'optix_math.h' seems also to be missing:

$ find NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64 -name optix_math.h
<nothing>

Maybe I have a dumb configuration error? What would be a good way for me to troubleshoot- in NVIDIA-OptiX-SDK-6.5.0-linux64 optix_math.h exists:
$find NVIDIA-OptiX-SDK-6.5.0-linux64 -name optix_math.h
NVIDIA-OptiX-SDK-6.5.0-linux64/include/optix_math.h

? Thanks