Duke-RT icon indicating copy to clipboard operation
Duke-RT copied to clipboard

[Feature] Linux support

Open cscd98 opened this issue 7 months ago • 17 comments

Raze version

No response

Which game are you running with Raze?

Duke Nukem 3D

What Operating System are you using?

Linux x86_64

If Other OS, please describe

No response

Is your feature request related to a problem? Please describe.

Would love to see Linux support

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Add any other context or screenshots about the feature request here.

No response

cscd98 avatar Apr 26 '26 07:04 cscd98

Edited: I've been poking at this a lot, and this is what I've gotten to. I can get Raze to launch with the .cmd file by working around the .ps1 file, but because the renderer requires the RT option as the api, it just causes a hard crash. Proton can't seem to hand off vulkan translation to Raze. It's probably for similar reasons Super Mario 64 RTX (the D3D12 requirement) will not work on Linux.

RoaminLime avatar May 01 '26 21:05 RoaminLime

Oh wow, thanks for giving it a try @RoaminLime! You can actually force launching with Vulkan rather than D3D12 - maybe that will work for you? If you run from command line, run like so:

launch-duke-rt.cmd +set vid_preferbackend 4 +set nri_api vulkan

For a permanent package edit, change the second to last line of launch-duke-rt.cmd from:

"%RAZE_EXE%" -gamegrp "%DUKE_RT_GRP%" -file "%OVERLAY_DIR%" %GAME_ARGS%

to:

"%RAZE_EXE%" -gamegrp "%DUKE_RT_GRP%" -file "%OVERLAY_DIR%" +set vid_preferbackend 4 +set nri_api vulkan %GAME_ARGS%

Note that you'll lose the ability to use FSR3 framegen with Vulkan, but it should otherwise work!

postmemetic avatar May 11 '26 02:05 postmemetic

"+set vid_preferbackend 4" I'm unsure of why this is what causes the crashing, but when it's set, it crashes with a fatal error.

Log started: 2026-05-10 22:46:56 OS: Windows 10 (NT 10.0) Build 19045

I_InitInput I_StartupMouse I_StartupKeyboard I_StartupXInput I_StartupRawPS2 I_StartupDirectInputJoystick NRI adapter[0]: NVIDIA GeForce RTX 3080 10GB (vendor=NVIDIA, video=10.24 GiB, shared=23.36 GiB, graphicsQueues=16) NRI CreateDevice config: api=vulkan nri_validation=off api_validation=off dred=off NRI error: VK::NVIDIA GeForce RTX 3080 10GB - nri::DeviceVK::ResolveInstanceDispatchTable(): Failed to get instance function: 'vkGetMemoryWin32HandlePropertiesKHR' (DeviceVK.hpp:1752) <---This could be the culprit

RoaminLime avatar May 11 '26 02:05 RoaminLime

+set vid_preferbackend 4 is what makes it select the RT back-end. Thanks for sharing output. I'll test things out on my end again and see if I can reproduce. I don't have a Linux device to test on but will see if the issue repros on Windows.

postmemetic avatar May 12 '26 02:05 postmemetic

Right, with Failed to get instance function: 'vkGetMemoryWin32HandlePropertiesKHR', I think it's pointing out that for it to work, I'd need my card to return something when I enter "vulkaninfo | grep VK_KHR_external_memory_win32" into the terminal, but since nothing appears, and it shouldn't be expected to since it's not a legitimate Windows instance, at least in this method of implementing ray tracing, it's likely not going to work through proton.

In my experience, I have been able to get things like Doom RTX or Xash3d with Half Life to work in Proton. I thought there could be a chance, but I wasn't able to get it to work.

RoaminLime avatar May 12 '26 03:05 RoaminLime

Oh I hadn't seen Xash3d, but it looks like it's built by the same dev that made RTGL, which is what Doom RTX uses. I know RTGL uses Vulkan as well. When I get a spare moment, I'll compare the way they use Vulkan to my approach and see how it differs. Thanks again for trying stuff out - I really appreciate you taking a look and sharing your findings!

postmemetic avatar May 12 '26 03:05 postmemetic

No problem. I appreciate that you're willing to look into it. The fact that Raze is willing to boot even if it's without the RT option working gives me some optimism that a chance it will work in the future is a possibility.

RoaminLime avatar May 12 '26 03:05 RoaminLime

Sorry for any Confusion, it's RoaminLime. I just remembered an old github password. I tried Episode 2. Can't get this one to boot at all vulkan or not.

RoaminGrape avatar Jun 03 '26 01:06 RoaminGrape

Oh thanks for the follow-up! I've heard that some users are getting issues with texture counts. I wonder if that's what's effecting E2? If I address that issue elsewhere, I'll follow up here to let you know it's ready to retest.

postmemetic avatar Jun 12 '26 19:06 postmemetic

unfortunately for linux + proton, ive tried several of the RT/RTX remix variants of doom, quake, etc

i dont have an nvidia gpu which may be the main issue but getting any of them to run on AMD+proton has been futile even compiling some of them for native linux builds

good luck if anyone with Nvidia + proton gets it running successfully.

So, a couple things. I now have SuperMario64 Render96 with RTX working now. I played around with some dll renaming to see if there's any budging, and it seems that so long as both NRI.dll and libxess.dll both exist in the game root, the game crashes. If either of them are the only one existing in root, the game boots with a black window.

CrashReport.zip

duke-rt.log

RoaminGrape avatar Jul 31 '26 05:07 RoaminGrape

native linux support is now in! this is built for X only. enjoy!

https://github.com/postmemetic/Duke-RT/releases/tag/0.5.4

postmemetic avatar Oct 11 '26 02:10 postmemetic

ill give it a test after thoroughly reading the python script and Let it do it myself. and then re-write my own bash script to remove the Let it do the things

i totally get why simply running a script to get it up and running is useful and preferred it gets players into the game with the least effort and friction

Hell has frozen over, and I have added native Linux support! I do not know what I'm doing in regards to Linux development

since we'll be your test subjects. if it wasnt so complicated id even compile the source code myself the nature of these "nvidia RTX" projects tends to be ... not as straight forward i used to test RAZE builds (gzdoom fork) long ago so it should be pretty basic to building that.

and maybe i can get it running with AMD proton-wine would be preferred, then i can use optiscaler injection to override the dlss features with FSR

but I have altered my renderer to function without quite so many deeply embedded Windows-isms. much appreciated for this aspect. its all so true

next it would be ideal to remove the "nvidia-isms" to make it RT agnostic. AMD is perfectly capable of running RT, frame gen, upscaling, etc.

https://github.com/postmemetic/Duke-RT/discussions/38

ill redirect further discussion to the ... discussion

native linux support is now in! this is built for X only. enjoy!

0.5.4 (release)

Note that Fedora 45 has gotten rid of X11 entirely for both GNOME and KDE (it's not available in packages anymore), so anyone upgrading to Fedora 45 won't be able to run Duke-RT unless they install a desktop environment that still runs on X11. This is because both upstream GNOME and KDE both rid of X11 support (for KDE, this happened last month and Fedora 45 packaged it).

Calinou avatar Nov 05 '26 22:11 Calinou

xwayland handles that. "in theory" for backwards compatibility with X11

Surely native wayland seems better suited to a release in 2026?

cscd98 avatar Nov 08 '26 11:11 cscd98

Granted, I didn't do a whole postmortem of which display driver it ran, but it seemed as if it were running via Wayland on my distro even though it was claimed to be bork by the Wayland icon when not fullscreened in gamescope.

RoaminGrape avatar Nov 08 '26 18:11 RoaminGrape