mGPU (Multi-GPU) AFR with RTX 2060 & D3D12 possible? - directx

Is it possible to do AFR in D3D12 with two RTX 2060 graphics cards?
I have a custom rendering framework that supports AFR with D3D12 but just read Nvidia dropped SLI support however I'm having trouble finding a clear answer as to what this means when it comes to D3D12 / Vulkan APIs. Did they drop just SLI driver support but Linked-GPU support still works as normal in D3D12?
If I buy two RTX 2060 graphics cards can I set them up as a "GPU 0 (Link 0) & GPU 1 (Link 0)" in Windows and then in D3D12 use them as a node group?
I want to add RayTracing into my API but want to test AFR / mGPU support with it & Nvidia has made this very unclear about what this means for D3D12 / Vulkan.

The answer is you can't use Linked GPUs to do AFR with these GPUs without driver hacks.
However I can do AFR by creating two D3D12 devices & manually do the swapping & copping of buffers.
This will also allow me to do cross GPU vendor AFR rendering as well.
Will my API I'm creating support this? Yes, yes it will ;)

Related

Vulkan API : max MSAA samples supported is VK_SAMPLE_COUNT_8_BIT

I am writing Vulkan API based renderer. Currently I am trying to add MSAA for color attachment.
I was pretty sure I could use VK_SAMPLE_COUNT_16_BIT ,but limits.framebufferColorSampleCounts returns bit flags that allow MSAA level up to VK_SAMPLE_COUNT_8_BIT (inclusive)
I run on a brand new NVIDIA QUADRO RTX 3000 card. I also use latest NVIDIA driver: 441.28
I checked the limits in OpenGL and GPU caps viewer shows
GL_MAX_FRAMEBUFFER_SAMPLES = 32
How does it make sense? is the limit dictated by the Vulkan API only? And if the hardware doesn't support more than x8 then does it mean OpenGL driver simulates it on CPU, e.g via stuff like supersampling? That's what I was said by several rendering developers at khronosdev.slack ? Does it make sense? Doesn't a vendor have to compile with the standard and either implement MSAA the right way or not to implement at all?
Is that possible that OpenGL doesn't "really" support more than x8 MSAA ,but the drivers simulate it via stuff like supersampling?
UPDATE
This page explains the whole state of MSAA implmentation for OpenGL and actually it becomes clear from it why Vulkan doesn't provide more than x8 samples on my card. Here is the punch line:
Some NVIDIA drivers support multisample modes which are internally
implemented as a combination of multisampling and automatic
supersampling in order to obtain a higher level of anti-aliasing than
can be directly supported by hardware.
framebufferColorSampleCounts is flags, not a count. See this enum for the values: https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkSampleCountFlagBits.html
15 offers VK_SAMPLE_COUNT_1_BIT, VK_SAMPLE_COUNT_2_BIT, VK_SAMPLE_COUNT_4_BIT or VK_SAMPLE_COUNT_8_BIT.
This answers why you get 15, rather than a power of two, but it still begs the question why the NVidia driver is limiting you more than the OpenGL driver. Perhaps a question for the NVidia forums. You should double-check that your driver is up to date and that you're actually picking your NVidia card and not an integrated one.
I've also come across a similar problem (not Vulkan though, but OpenGL, but also NVidia): on my NVidia GeForce GTX 750 Ti, the Linux driver nvidia reports GL_MAX_SAMPLES=32, but anything higher than 8 samples results in ugly blurring of everything including e.g. text, even with glDisable(GL_MULTISAMPLING) for all rendering.
I remember seeing the same blurring problems when I enabled FXAA globally (via nvidia-settings --assign=fxaa=1) and ran KWin (KDE's compositing window manager) with this setting on. So I suspect this behavior with samples>=9 is because the driver enables FXAA in addition to (or instead of) MSAA.

D3D11 - How to deal with SLI and Nvidia Surround?

Is it needed to worry about Nvidia SLI with or without Surround while enumerating adapters and outputs?
Assume a fictional build:
(2x) GTX 960 in SLI
(3X) 1920x1080 displays attached in landscape mode by Surround, yielding 5760x1080
While using IDXGIFactory::EnumAdapters to enumerate adapters, does it show two of the GPUs as separate adapters or just one combined? (assuming SLI is enabled and we occluded any integrated GPUs and Microsoft Basic Render Driver). Same case for Outputs, while using IDXGIAdapter::EnumOutputs, does it return 3 distinct outputs or just one? (assuming Surround is enabled). If it returns only one, IDXGIOutput::GetDisplayModeList will include atleast one display mode that is 5760x1080, prove me right or wrong. But if it is three distinct outputs, should I create one swapchain per output?
Notes:
This doesn't answer my question properly
I don't want any NvAPI based approach, just pure Directx11
The Surround Best Practices doesn't give much information
I currently don't have any SLI+Surround setup so I can't answer my own question. And I have to deal with AMD Eyefinity as well

WebGL Compute Shader and VBO/UBO's

AFAIK is the compute shader model very limited in WebGL. The documentation on this is even less. I have a hard time to find any answers to my questions.
Is there a possibility to execute a compute shader on one or multiple VBO/UBO's and alter their values?
Update: On April 9 2019, the Khronos group released the a draft standard for compute shaders in WebGL 2.
Original answer:
In this press release, the Khronos group stated that they are working on an extension to WebGL 2 to allow for compute shaders:
What’s next? An extension to WebGL 2.0 providing compute shader support is under development, which will bring many leading-edge graphics algorithms to the web. Khronos is also beginning work on the next generation of WebGL, to bring the enhanced performance of the new generation of explicit 3D APIs to the web. Stay tuned for more news!
Your best bet is to wait about a year or two for it to happen on a limited number of GPU + browser combination.
2022 UPDATE
It has been declared here (in red) that the WebGL 2.0 Compute specification has instead been moved into the new WebGPU spec and is deprecated for WebGL 2.0.
WebGPU has nowhere near global coverage across browsers yet, whereas WebGL 2.0 reached global coverage as of Feb 2022. WebGL 2.0 Compute is implemented only in Google Chrome (Windows, Linux) and Microsoft Edge Insider Channels and will not be implemented elsewhere.
This is obviously a severe limitation for those wanting compute capability on the web. But it is still possible to do informal compute using other methods, such as using regular graphics shaders + the expanded input and output buffer functionalities supplied by WebGL 2.0.
I would recommend Amanda Ghassaei's gpu-io for this. It does all the work for you in wrapping regular GL calls to give compute capability that "just works" (in either WebGL or WebGL 2.0).

Switching between graphics cards Nvidia or ATI in OpenCV

I'm going to run my project on servers with a lot of ATI and NVidia Tesla. How can I optimize the use of graphics cards? Can I choose the specific video card when I start the instance application?
Depending on your definition of "specific":
If you just want to select between NVIDIA and AMD, you can use CL_PLATFORM_VENDOR with clGetPlatformInfo and look for "AMD" or "NVIDIA".
If you want to get back to a specific GPU you've used before, you can use CL_DEVICE_VENDOR_ID with clGetDeviceInfo and compare the saved value.
Sometimes those are the same in a dual-GPU installation. Use vendor extensions to get more specific (see Associating OpenCL device ids with GPU).

OpenCV with 2 cameras VC++

I am importing a source code for stereo visions. The next code of the author works. It takes two cameras sources. I have two different cameras currently and i receive images. Both works. It crashes at capture2. interesting part is that if i change the orders of the webcams(Unplugging them and invert the orders) the first camera it will be the second one. We it doesn't work? I tested also with Windows XP sp3 and Windows 7 X64. The same problem.
//---------Starting WebCam----------
capture1= cvCaptureFromCAM(1);
assert(capture1!=NULL); cvWaitKey(100);
capture2= cvCaptureFromCAM(2);
assert(capture2!=NULL);
Also If i use -1 for paramters the just give me the first one(all the time).
Or any method to capture two camers using function cvCaptureFrom
Firstly the cameras are generally numbered from 0 - is this just the problem?
Secondly, directshow and multiple USB webcams is notoriously bad in windows. Sometimes it will work with two identical camera, sometimes only if they are different.
You can also try a delay between initialising the cameras, sometimes one will lock the capture stream until it is sending data, preventing the other being detected.
Often the drivers assume they are the only camera and make incorrect calls to lock up the entire capture graph. This isn't helped by it being extremely complicated to write correct drivers+fdirectshow filters in Windows
some mother board can not work with some usb 2.0 cameras. one usb 2.0 camera take 40-60% of usb controller. solution is connect second usb 2.0 camera from pci2usb controller
Get 2 PS3 Eyes, around EUR 10 each, and the free codelaboratories.com SDK, this gets you support up to 2 cameras using C, C#, Java, and AS3 incl. examples etc. You also get FIXED frame rates up 75 fps # 640*480. Their free driver only version 5.1.1.0177 provides decent DirectShow component, but for a single camera only.
COmment for the rest: Multi-cam DirectShow drivers should be a default for any manufacturer, not providing this is a direct failure to implement THE VERY BASIC PORPUSE AND FEATURE OF USB as an interface. It is also VERY EASY to implement, compared to implementing the driver itself for a particular sensor / chipset.
Alternatives that are confirmed to work in identical pairs (via DirectShow):
Microsoft Lifecam HD Cinema (use general UVC driver if you can, less limited fps)
Logitech Webcam Pro 9000 (not to be confused with QuickCam Pro 9000, which DOES NOT work)
Creative VF0220
Creative VF0330
Canyon WCAMN-1N
If you're serious about your work, get a pair of machine vision cameras to get PERFORMANCE. Cheapest on the market, with german engineering quality, CCD, CMOS, mono, colour, GigE (ethernet), USB, FireWire, excellent range of dedicated drivers:
http://www.theimagingsource.com

Resources