compiling Radiance 64-bit?

Hello Radiance Users, Abusers and Confusers,

Please excuse my ignorance, but assuming one has a computer with a 64-bit operating system (SuSe Linux) installed, can Radiance be compiled as a 64-bit application? And if so, has anyone done it? What's the makefile look like? The reason I ask is that I'm looking at possibly building up a quad system (two dual-core cpus) and with the potential for four jobs running at once I think I need more addressable memory. As I understand it, with a 32-bit application you're limited to 4GB total, whereas with everything 64-bit, the system can address 8GB of RAM. Since I rarely see jobs needing more than 2GB of RAM, I figure having 8GB available for a maximum of four jobs means no job would likely ever run out of RAM and start paging. Maybe my first question should really be: am I thinking about this correctly? =8-)

Any input appreciated. (I think I need coffee.)

- Rob

Hi Rob,

I think that you would need to add some of the following to the "MACH= ..." line of the rmake file:

    * -m64

This will produce code specific to x86-64.

There are a variety of additional compile options that can be considered (32 or 64 bit). I would check out Mark Stock's Benchmark Page to get a sense of some things that people have tried:

    http://mark.technolope.org/pages/rad_bench.html

-Jack

Rob Guglielmetti wrote:

···

Hello Radiance Users, Abusers and Confusers,

Please excuse my ignorance, but assuming one has a computer with a 64-bit operating system (SuSe Linux) installed, can Radiance be compiled as a 64-bit application? And if so, has anyone done it? What's the makefile look like? The reason I ask is that I'm looking at possibly building up a quad system (two dual-core cpus) and with the potential for four jobs running at once I think I need more addressable memory. As I understand it, with a 32-bit application you're limited to 4GB total, whereas with everything 64-bit, the system can address 8GB of RAM. Since I rarely see jobs needing more than 2GB of RAM, I figure having 8GB available for a maximum of four jobs means no job would likely ever run out of RAM and start paging. Maybe my first question should really be: am I thinking about this correctly? =8-)
Any input appreciated. (I think I need coffee.)

- Rob

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

I got it compiled without any troubles on my family's Sempron 64 (MythTV
box). It's running the unofficial AMD64 port of Debian, which is a full
64-bit port i.e not simply running 32-bit userland programs on a 64-bit
kernel. Everything is compiled to use the extra registers and SSE2, etc.

I simply changed the OPT line in the rmake file:
OPT=-O4 -march=athlon64 -msse2 -mfpmath=sse -ftree-vectorize
-falign-functions=8 -ffast-math

That's for GCC 4.0 and is hopefully making some use of SSE2 to speed
things up. In simple tests, the little 1800MHz Sempron 64 with 128KB of
cache is about 10% faster than my 1900MHz Athlon XP with 512KB of cache.

As for memory, it depends on what you're doing. Are you dealing with
complex geometry or large textures?

Hope that helps,
bye

···

On Wed, 03 May 2006 09:20:53 -0600 Rob Guglielmetti <[email protected]> wrote:

Hello Radiance Users, Abusers and Confusers,

Please excuse my ignorance, but assuming one has a computer with a
64-bit operating system (SuSe Linux) installed, can Radiance be compiled
as a 64-bit application? And if so, has anyone done it? What's the
makefile look like? The reason I ask is that I'm looking at possibly
building up a quad system (two dual-core cpus) and with the potential
for four jobs running at once I think I need more addressable memory.
As I understand it, with a 32-bit application you're limited to 4GB
total, whereas with everything 64-bit, the system can address 8GB of
RAM. Since I rarely see jobs needing more than 2GB of RAM, I figure
having 8GB available for a maximum of four jobs means no job would
likely ever run out of RAM and start paging. Maybe my first question
should really be: am I thinking about this correctly? =8-)

Any input appreciated. (I think I need coffee.)

- Rob

Ian Tester wrote:

I got it compiled without any troubles on my family's Sempron 64 (MythTV
box). It's running the unofficial AMD64 port of Debian, which is a full
64-bit port i.e not simply running 32-bit userland programs on a 64-bit
kernel. Everything is compiled to use the extra registers and SSE2, etc.

I simply changed the OPT line in the rmake file:
OPT=-O4 -march=athlon64 -msse2 -mfpmath=sse -ftree-vectorize
-falign-functions=8 -ffast-math

Thanks for the responses, Ian & Jack! So tell me Ian, does your family complain when they go to watch television and find an rpict process on the screen instead? :wink:

- Rob

No. I haven't used it in a while, and it was always over SSH from my
machine. When I did use it to do a render it was usually at night or
running with a very high nice level.

BTW, Jacks response mentioned adding -m64 to the command line. I don't
need that since I'm running the all-64-bit AMD64 Debian port and gcc
generates 64-bit binaries by default. You'll have to check what your
distro has set up.

bye

···

On Wed, 03 May 2006 13:35:30 -0600 Rob Guglielmetti <[email protected]> wrote:

Ian Tester wrote:

>I got it compiled without any troubles on my family's Sempron 64 (MythTV
>box). It's running the unofficial AMD64 port of Debian, which is a full
>64-bit port i.e not simply running 32-bit userland programs on a 64-bit
>kernel. Everything is compiled to use the extra registers and SSE2, etc.
>
>I simply changed the OPT line in the rmake file:
>OPT=-O4 -march=athlon64 -msse2 -mfpmath=sse -ftree-vectorize
>-falign-functions=8 -ffast-math
>
>
Thanks for the responses, Ian & Jack! So tell me Ian, does your family
complain when they go to watch television and find an rpict process on
the screen instead? :wink:

regarding [Radiance-general] compiling Radiance 64-bit?:

Please excuse my ignorance, but assuming one has a computer with a
64-bit operating system (SuSe Linux) installed, can Radiance be compiled
as a 64-bit application?

Yes, I've built radiance 64bit for both Sparc and Opteron.

As I understand it, with a 32-bit application you're limited to 4GB
total, whereas with everything 64-bit, the system can address 8GB of
RAM. Since I rarely see jobs needing more than 2GB of RAM, I figure
having 8GB available for a maximum of four jobs means no job would
likely ever run out of RAM and start paging.

Correct and radiance gets no where near 2GB. (At least I run out of
CPU long before the model is that big.)

Why do you think radiance needs to be 64bit? On both and Sparc and
the AMD64 the 32bit binaries ran quicker. Only if it needs to
address >2G of memory does it *need* to be 64bit. *Some* programs
run quicker 64 bit but *most* *don't*, combine with larger executable
files and increased memory usage I found radiance is best 32 bit.

It stands to reason for 64bit programs to be slower because they have
to use twice the memory to store memory pointers. Ah you say, doesn't
64bit mean it can use 64bit registers for other things? (Like 64bit
ints and 64bit doubles.) Well nothing stops that happening in 32bit
mode if the chip and compilers are well designed, that's what
sparcv8plus+vis is all about. 32/64bit is the memory address mode
not the chip registers. Some say those extra registers are only used
on AMD64s in 64bit mode; I say I've benchmarks radiance both ways
and 64 bit was not quicker.

Don't confuse running 32bit Pentium compatible binaries on a AMD64
with 32bit binaries optimised for AMD64 on the AMD64.

James.

···

On 03/05/06, 16:20:53, Rob Guglielmetti <[email protected]> wrote

Correct and radiance gets no where near 2GB. (At least I run out of
CPU long before the model is that big.)

I totally agree there: It's still the CPU speed that's limiting.

Why do you think radiance needs to be 64bit? On both and Sparc and
the AMD64 the 32bit binaries ran quicker. Only if it needs to
address >2G of memory does it *need* to be 64bit. *Some* programs
run quicker 64 bit but *most* *don't*, combine with larger executable
files and increased memory usage I found radiance is best 32 bit.

I am not sure how 'bitty' the floating point values are that RADIANCE
calculates. If they are 64-bit long, then you can actually expect a speed
improvement, me thinks.

It stands to reason for 64bit programs to be slower because they have
to use twice the memory to store memory pointers. Ah you say, doesn't
64bit mean it can use 64bit registers for other things? (Like 64bit
ints and 64bit doubles.) Well nothing stops that happening in 32bit
mode if the chip and compilers are well designed, that's what
sparcv8plus+vis is all about. 32/64bit is the memory address mode
not the chip registers. Some say those extra registers are only used
on AMD64s in 64bit mode; I say I've benchmarks radiance both ways
and 64 bit was not quicker.

There are benchmarks and there are benchmarks. The only way of finding out
wheter your particular application will benefit from going 64-bit is to
actually test it. Which is what I've done for you.

http://luminance.londonmet.ac.uk/pickup/rad_bench_sempron.html

So sit back, have a cup of coffee, and let the little grey cells do some
pondering.

Cheers

Axel

Hi list!

Correct and radiance gets no where near 2GB. (At least I run out of
CPU long before the model is that big.)

I totally agree there: It's still the CPU speed that's limiting.

I have a model that is getting close to 2GB here.

I am not sure how 'bitty' the floating point values are that RADIANCE
calculates. If they are 64-bit long, then you can actually expect a speed
improvement, me thinks.

Most floating point values are doubles, thus 64bit. Still, the whole
64bit-point is about address pointers. All the old "32-bit" cpus support
calculations on 64bit values - double floats are not that new (a SSE2
unit as found in recent 32bit intel cpus can even perform calculations
on 2 64bit values at once). So we are only talking about increasing the
amount of addressable memory here.

Correct me if I am wrong. I am not a cpu expert. But do not compile
Radiance in 64 bit if you do not need memory. If you do, take a look at
compilers. E.g. Sun has a free compiler that is known to produce 64 bit
code that can compete with 32 bit in speed.

Lars.

regarding Re: [Radiance-general] compiling Radiance 64-bit?:

> Why do you think radiance needs to be 64bit? On both and Sparc and
> the AMD64 the 32bit binaries ran quicker. Only if it needs to
> address >2G of memory does it *need* to be 64bit. *Some* programs
> run quicker 64 bit but *most* *don't*, combine with larger executable
> files and increased memory usage I found radiance is best 32 bit.

I am not sure how 'bitty' the floating point values are that RADIANCE
calculates. If they are 64-bit long, then you can actually expect a speed
improvement, me thinks.

People expect it but it's not so. You can still take advantage of the
better chip architecture when using 32bit addresses.

> It stands to reason for 64bit programs to be slower because they have
> to use twice the memory to store memory pointers. Ah you say, doesn't
> 64bit mean it can use 64bit registers for other things? (Like 64bit
> ints and 64bit doubles.) Well nothing stops that happening in 32bit
> mode if the chip and compilers are well designed, that's what
> sparcv8plus+vis is all about. 32/64bit is the memory address mode
> not the chip registers. Some say those extra registers are only used
> on AMD64s in 64bit mode; I say I've benchmarks radiance both ways
> and 64 bit was not quicker.

There are benchmarks and there are benchmarks. The only way of finding
out wheter your particular application will benefit from going 64-bit
is to actually test it. Which is what I've done for you.

http://luminance.londonmet.ac.uk/pickup/rad_bench_sempron.html

You are not comparing like with like. All you 32bit tests were done
on a i386 compatible kernel. Try a 32bit AMD64 radiance on a kernel
optimised for the AMD64 chip.

James.

···

On 04/05/06, 11:56:00, Axel Jacobs <[email protected]> wrote

On 04/05/06, 22:31:40, Lars "O." Grobe <[email protected]> wrote regarding Re:
[Radiance-general] compiling Radiance 64-bit?:

>> Correct and radiance gets no where near 2GB. (At least I run out of
>> CPU long before the model is that big.)
>
> I totally agree there: It's still the CPU speed that's limiting.

I have a model that is getting close to 2GB here.

And when it does you will have to use 64bit, a decision not base
on speed.

> I am not sure how 'bitty' the floating point values are that RADIANCE
> calculates. If they are 64-bit long, then you can actually expect a speed
> improvement, me thinks.

Most floating point values are doubles, thus 64bit. Still, the whole
64bit-point is about address pointers. All the old "32-bit" cpus support
calculations on 64bit values - double floats are not that new (a SSE2
unit as found in recent 32bit intel cpus can even perform calculations
on 2 64bit values at once). So we are only talking about increasing the
amount of addressable memory here.

Yes, yes, a 64bit CPU is not cobbled by a 32bit pointer any more than
using a short int turns a Pentium 3 in to a 80286.

Correct me if I am wrong. I am not a cpu expert. But do not compile
Radiance in 64 bit if you do not need memory. If you do, take a look at
compilers. E.g. Sun has a free compiler that is known to produce 64 bit
code that can compete with 32 bit in speed.

On Sparc most programs run slower 64bit (lame is the only one I know
that runs quicker), on the AMD64 chip the gap was much smaller. Lars,
you use Solaris? My test were done on Solaris 10 with the Sun Studio
10 compiler. Studio 11 is now free.

On Sparc it's clear what is happening because the vis extensions can
be used in 32bit mode: sparcv8plus+vis and sparcv8plus+vis2. I assume
something similar is happening on the AMD64s although the compiler
flags aren't as explicit and there is no isalist entry.

James.

James,

http://luminance.londonmet.ac.uk/pickup/rad_bench_sempron.html

You are not comparing like with like. All you 32bit tests were done
on a i386 compatible kernel. Try a 32bit AMD64 radiance on a kernel
optimised for the AMD64 chip.

I am not sure I'm with you. What is a 32bit AMD64 radiance?

What I've done is compare the default installations (other than for
Gentoo, for which there is no 'default' installation) with the boxstandard
kernel.

Axel

regarding Re: [Radiance-general] compiling Radiance 64-bit?:

>> http://luminance.londonmet.ac.uk/pickup/rad_bench_sempron.html
>
> You are not comparing like with like. All you 32bit tests were done
> on a i386 compatible kernel. Try a 32bit AMD64 radiance on a kernel
> optimised for the AMD64 chip.

I am not sure I'm with you. What is a 32bit AMD64 radiance?

Radiance optimised for the AMD64 chip but using a 32bit addresses.

What I've done is compare the default installations (other than for
Gentoo, for which there is no 'default' installation) with the
boxstandard kernel.

Start by just running your 32bit radiance on the same AMD64 kernel that
you did the 64bit test.

James.

···

On 06/05/06, 17:34:59, Axel Jacobs <[email protected]> wrote